This commit is contained in:
maelstrom 2024-09-27 18:31:14 +02:00
parent 038aee2f1c
commit a98844bf95
3 changed files with 24 additions and 0 deletions

View file

@ -3,6 +3,8 @@
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
#include <stdio.h> #include <stdio.h>
#include "renderer.h"
void errorCatcher(int id, const char* str); void errorCatcher(int id, const char* str);
int main() { int main() {
@ -12,7 +14,13 @@ int main() {
GLFWwindow *window = glfwCreateWindow(1200, 900, "GLTest", NULL, NULL); GLFWwindow *window = glfwCreateWindow(1200, 900, "GLTest", NULL, NULL);
glfwMakeContextCurrent(window); glfwMakeContextCurrent(window);
glewInit();
renderInit(window);
do { do {
render(window);
glfwSwapBuffers(window); glfwSwapBuffers(window);
glfwPollEvents(); glfwPollEvents();
} while(!glfwWindowShouldClose(window)); } while(!glfwWindowShouldClose(window));

11
src/renderer.cpp Normal file
View file

@ -0,0 +1,11 @@
#include "renderer.h"
#include "GLFW/glfw3.h"
void renderInit(GLFWwindow* window) {
}
void render(GLFWwindow* window) {
glClearColor(0.1f, 0.1f, 0.1f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}

5
src/renderer.h Normal file
View file

@ -0,0 +1,5 @@
#pragma once
#include <GLFW/glfw3.h>
void renderInit(GLFWwindow* window);
void render(GLFWwindow* window);