I recently started C programming so I decided to check out allegro 5. I've statically linked everything and confirmed allegro is correctly installed by running some examples.
I want to create a simple game loop tied to vsync but I cannot do so. I've tried every combination of these I can think of but it always crashes the moment an event is found. I've tried debugging but it fails with [Inferior 1 (process 2552) exited with code 03] every time I try to add an event loop.
To be clear I do not want delta time, I do not want to use timers and I do not want to pause my program's execution to wait for events. I want an SDL-style event loop where I continually render at 60 FPS regardless if there are any events in the queue. I've done this in the past with SDL 2.0, SFML and CSFML but I cannot do it with allegro.
And yes, I am aware that my game's speed will be tied to framerate and that the game will not even boot if the user does not have vsync.
ALLEGRO_EVENT* event = NULL; int value = 0; while (window_open) { while (al_get_next_event(window_queue, event)) {
You're passing NULL to al_get_next_event. You need to declare an ALLEGRO_EVENT and pass its address not an empty pointer.
Hey, I got it working! Keyboard input too! Thanks for your help.