Start working on the raytracer
This commit is contained in:
parent
c836f3758f
commit
e6a3b73f99
37
src/raytracer/main.c
Normal file
37
src/raytracer/main.c
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#include "SDL_events.h"
|
||||||
|
#include "c_cpp_aliases/aliases.h"
|
||||||
|
#include "window/window.h"
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
colour_t bg = (colour_t){.r = 128, .g = 128, .b = 128, .a = 255};
|
||||||
|
|
||||||
|
window_t window = {0};
|
||||||
|
|
||||||
|
if (!init_window(&window, 1000, 800, "CG From Scratch")) {
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool running = true;
|
||||||
|
SDL_Event event = {0};
|
||||||
|
|
||||||
|
while (running) {
|
||||||
|
while (SDL_PollEvent(&event)) {
|
||||||
|
switch (event.type) {
|
||||||
|
case SDL_QUIT:
|
||||||
|
running = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
clear_window(&window, bg);
|
||||||
|
|
||||||
|
swap_buffers(&window);
|
||||||
|
}
|
||||||
|
|
||||||
|
close_window(&window);
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user