error handling + draw loop
This commit is contained in:
12
pog.cpp
12
pog.cpp
@@ -17,9 +17,21 @@ int main() {
|
|||||||
if (window == NULL) {
|
if (window == NULL) {
|
||||||
// error handling
|
// error handling
|
||||||
std::cout << "AH HECK INIT FAILED BRUV" << std::endl;
|
std::cout << "AH HECK INIT FAILED BRUV" << std::endl;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
glViewport(0, 0, 1920, 1080);
|
glViewport(0, 0, 1920, 1080);
|
||||||
glfwMakeContextCurrent(window);
|
glfwMakeContextCurrent(window);
|
||||||
|
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
|
||||||
|
|
||||||
|
while (!glfwWindowShouldClose(window)) {
|
||||||
|
processInput(window);
|
||||||
|
|
||||||
|
glClearColor(0.2f, 0.3f, 0.6f, 1.0f);
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
|
glfwSwapBuffers(window);
|
||||||
|
glfwPollEvents();
|
||||||
|
}
|
||||||
float vertices[] = {
|
float vertices[] = {
|
||||||
-0.5f, -0.5f, 0.0f,
|
-0.5f, -0.5f, 0.0f,
|
||||||
0.5f, -0.5f, 0.0f,
|
0.5f, -0.5f, 0.0f,
|
||||||
|
|||||||
Reference in New Issue
Block a user