Input test.

This commit is contained in:
2025-06-08 17:36:13 -05:00
parent 5cc38e14d6
commit 2309fea9f3
17 changed files with 301 additions and 19 deletions

View File

@@ -5,14 +5,34 @@
* https://opensource.org/licenses/MIT
*/
#include "input.h"
#include "util/random.h"
#include "display/render.h"
#include "rpg/entity/entity.h"
int32_t main(const int32_t argc, const char **argv) {
inputInit();
randomInit();
renderInit();
entity_t *ent;
ent = &ENTITIES[0];
entityInit(ent, ENTITY_TYPE_PLAYER);
while(1) {
inputUpdate();
ent = ENTITIES;
do {
if(ent->type == ENTITY_TYPE_NULL) {
ent++;
continue;
}
entityUpdate(ent++);
} while(ent < (ENTITIES + ENTITY_COUNT));
renderUpdate();
usleep(100 * 1000); // Sleep for 16 milliseconds (60 FPS)
}