|
@ -144,26 +144,16 @@ INT WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine |
|
|
/*¼àÌý²¢´¦ÀíÓû§ÇëÇó*/ |
|
|
/*¼àÌý²¢´¦ÀíÓû§ÇëÇó*/ |
|
|
MSG msg; |
|
|
MSG msg; |
|
|
|
|
|
|
|
|
while (true) { |
|
|
|
|
|
if (PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE)) { |
|
|
|
|
|
if (msg.message == WM_QUIT) { |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
TranslateMessage(&msg); |
|
|
|
|
|
DispatchMessage(&msg); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto what = [&]()->void { |
|
|
glm::mat4 normalMatrix = glm::inverseTranspose(model); |
|
|
glm::mat4 normalMatrix = glm::inverseTranspose(model); |
|
|
|
|
|
|
|
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
|
|
|
|
|
|
|
|
|
|
|
glUseProgram(program); |
|
|
glUseProgram(program); |
|
|
glUniformMatrix4fv(MLocation, 1, GL_FALSE, glm::value_ptr(model)); |
|
|
glUniformMatrix4fv(MLocation, 1, GL_FALSE, glm::value_ptr(model)); |
|
|
glUniformMatrix4fv(VLocation, 1, GL_FALSE, identify); |
|
|
glUniformMatrix4fv(VLocation, 1, GL_FALSE, identify); |
|
|
glUniformMatrix4fv(PLocation, 1, GL_FALSE, glm::value_ptr(projection)); |
|
|
glUniformMatrix4fv(PLocation, 1, GL_FALSE, glm::value_ptr(projection)); |
|
|
glUniformMatrix4fv(NMLocation, 1, GL_FALSE, glm::value_ptr(normalMatrix)); |
|
|
glUniformMatrix4fv(NMLocation, 1, GL_FALSE, glm::value_ptr(normalMatrix)); |
|
|
|
|
|
|
|
|
glBindTexture(GL_TEXTURE_2D, secondTexture); |
|
|
|
|
|
|
|
|
glBindTexture(GL_TEXTURE_2D, mainTexture); |
|
|
glUniform1i(textureLocation, 0); |
|
|
glUniform1i(textureLocation, 0); |
|
|
|
|
|
|
|
|
glBindBuffer(GL_ARRAY_BUFFER, vbo); |
|
|
glBindBuffer(GL_ARRAY_BUFFER, vbo); |
|
@ -179,6 +169,22 @@ INT WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine |
|
|
glDrawElements(GL_TRIANGLES, indexCount, GL_UNSIGNED_INT, 0); |
|
|
glDrawElements(GL_TRIANGLES, indexCount, GL_UNSIGNED_INT, 0); |
|
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); |
|
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); |
|
|
glUseProgram(0); |
|
|
glUseProgram(0); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
while (true) { |
|
|
|
|
|
if (PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE)) { |
|
|
|
|
|
if (msg.message == WM_QUIT) { |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
TranslateMessage(&msg); |
|
|
|
|
|
DispatchMessage(&msg); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
|
|
|
|
|
|
|
|
|
|
|
glEnable(GL_SCISSOR_TEST); |
|
|
|
|
|
glScissor(400,300, 100, 100); |
|
|
|
|
|
what(); |
|
|
|
|
|
|
|
|
SwapBuffers(dc); |
|
|
SwapBuffers(dc); |
|
|
} |
|
|
} |
|
|