progress
This commit is contained in:
parent
0d3340713c
commit
27b04eb7d4
3 changed files with 33 additions and 3 deletions
31
main.c
31
main.c
|
|
@ -1,5 +1,34 @@
|
|||
#include <stdio.h>
|
||||
#include <GL/gl.h>
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
int main() {
|
||||
printf("hi");
|
||||
printf("Good Morning 🍵\n");
|
||||
SDL_Init(SDL_INIT_VIDEO);
|
||||
SDL_Window* window = SDL_CreateWindow("SDL3 OpenGL Cube",
|
||||
800, 600, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE);
|
||||
if (!window) {
|
||||
printf("CreateWindow Error: %s\n", SDL_GetError());
|
||||
SDL_Quit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
SDL_GLContext glContext = SDL_GL_CreateContext(window);
|
||||
if (!glContext) {
|
||||
printf("GL Context Error: %s\n", SDL_GetError());
|
||||
SDL_DestroyWindow(window);
|
||||
SDL_Quit();
|
||||
return 1;
|
||||
}
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
SDL_Event e;
|
||||
int running = 1;
|
||||
while (SDL_PollEvent(&e)) {
|
||||
if (e.type == SDL_EVENT_QUIT) running = false;
|
||||
// Rendorrrr
|
||||
glViewport(0, 0, 800, 600);
|
||||
glClearColor(0.1f, 0.1f, 0.1f, 1.0f); // Dark gray background
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue