WIP testing non-callback
This commit is contained in:
parent
4806cff440
commit
33ceed2d22
3 changed files with 38 additions and 3 deletions
19
glonkers.c
19
glonkers.c
|
|
@ -1,5 +1,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <stdint.h>
|
||||
|
|
@ -55,11 +56,23 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
Renderer renderer = new_renderer();
|
||||
|
||||
while (state.running) {
|
||||
bool running = true;
|
||||
while (running) {
|
||||
double time = time_since_start();
|
||||
render(&renderer, state.width, state.height, time, shader_path, 0);
|
||||
commit(&state);
|
||||
|
||||
struct event event;
|
||||
wait_for_event(&state, &event);
|
||||
if (event.type == EVENT_DRAW) {
|
||||
int width = event.data.draw.width;
|
||||
int height = event.data.draw.height;
|
||||
render(&renderer, width, height, time, shader_path, 0);
|
||||
}
|
||||
}
|
||||
//while (state.running) {
|
||||
// double time = time_since_start();
|
||||
// render(&renderer, state.width, state.height, time, shader_path, 0);
|
||||
// commit(&state);
|
||||
//}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue