init
This commit is contained in:
26
c/opengl.c
Normal file
26
c/opengl.c
Normal file
@ -0,0 +1,26 @@
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
glfwInit();
|
||||
|
||||
GLFWwindow* window = glfwCreateWindow(400, 400, "baller", NULL, NULL);
|
||||
glfwMakeContextCurrent(window);
|
||||
|
||||
while (!glfwWindowShouldClose(window)) {
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
glVertex2f(-0.5f, -0.5f);
|
||||
glVertex2f( 0.5f, -0.5f);
|
||||
glVertex2f( 0.5f, 0.5f);
|
||||
glVertex2f(-0.5f, 0.5f);
|
||||
glEnd();
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
glfwTerminate();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user