소스코드
#include <GLFW/glfw3.h>
int main(void)
{
GLFWwindow* window;
/* Initialize the library */
if (!glfwInit())
return -1;
/* Create a windowed mode window and its OpenGL context */
window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
if (!window)
{
glfwTerminate();
return -1;
}
/* Make the window's context current */
glfwMakeContextCurrent(window);
/* Loop until the user closes the window */
while (!glfwWindowShouldClose(window))
{
/* Render here */
glClear(GL_COLOR_BUFFER_BIT);
/* Swap front and back buffers */
glfwSwapBuffers(window);
/* Poll for and process events */
glfwPollEvents();
}
glfwTerminate();
return 0;
}
'DirectX | OpenGL' 카테고리의 다른 글
[OpenGL] 기초 4. 삼각형에 vertex shader / fragment shader 적용 (0) | 2021.12.02 |
---|---|
[OpenGL] 기초 3. 삼각형 만들기 (0) | 2021.12.02 |
[OpenGL] 기초 1. Visual Studio 2019에서 OpenGL, GLFW, GLES 사용하기 (0) | 2021.12.02 |