Initial commit
This commit is contained in:
36
src/main.cpp
Normal file
36
src/main.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <SDL3/SDL.h>
|
||||
#include <GL/gl.h>
|
||||
|
||||
int main() {
|
||||
SDL_Init(SDL_INIT_VIDEO);
|
||||
|
||||
SDL_Window* window = SDL_CreateWindow(
|
||||
"Cinecraft",
|
||||
800, 600,
|
||||
SDL_WINDOW_OPENGL
|
||||
);
|
||||
|
||||
SDL_GLContext context = SDL_GL_CreateContext(window);
|
||||
|
||||
bool running = true;
|
||||
SDL_Event e;
|
||||
|
||||
while (running) {
|
||||
while (SDL_PollEvent(&e)) {
|
||||
if (e.type == SDL_EVENT_QUIT) {
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
|
||||
glClearColor(0.1f, 0.2f, 0.3f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
SDL_GL_SwapWindow(window);
|
||||
}
|
||||
|
||||
SDL_GL_DestroyContext(context);
|
||||
SDL_DestroyWindow(window);
|
||||
SDL_Quit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user