opengl(2)
-
OpenGL과 GLFW, GLEW 설명과 마름모 생성 튜토리얼
OpenGL과 GLFW, GLEW 설명과 마름모 생성 튜토리얼 #include #include #include //OpenGL 확장팩 #include #include using namespace glm; GLFWwindow* window; void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) { if (key == GLFW_KEY_E && action == GLFW_PRESS) { printf("E Pressed\n"); } if (key == GLFW_KEY_Q && action == GLFW_RELEASE) { printf("Q Released\n"); } } int main() { // Initialise..
2020.08.11 -
OpenGL과 GLFW 새 창 열기 튜토리얼
OpenGL은 출력해주고 GLFW는 만들어준다. 즉, GLFW가 만든것을 OpenGL이 출력해준다는 것이다. GLFW는 입력과 출력을 하며 창을 만들어주고, OpenGL에서는 그것을 모니터에 그려준다. 모든 프로그래밍의 기초는 오류 처리이다. 먼저 알고 넘어가자 0. 오류 처리 error handling #include #include 위 두가지 헤더의 fprintf와 stderr(표준 오류)로 오류를 기본 출력 매체인 모니터(console, 콘솔)로 출력하겠다. fprintf( stderr, "Failed to .....\n" ); 이러한 형식이 되겠다. 1. opengl 헤더와 glfw 헤더 파일 추가 #include #include using namespace glm; 이로써 입력을 받으며 창을 생..
2020.08.10