36 lines
1,017 B
C
36 lines
1,017 B
C
#include <stdio.h>
|
|
#include <GL/gl.h>
|
|
#include <SDL3/SDL.h>
|
|
|
|
int main() {
|
|
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)) {
|
|
printf("INSgkldjsj\n");
|
|
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);
|
|
//SDL_GL_SwapWindow(window);
|
|
}
|
|
}
|