Render test

This commit is contained in:
2025-06-10 17:09:33 -05:00
parent a2fd58fda7
commit 1b6db0c643
47 changed files with 219 additions and 370 deletions

47
src/duskraylib/input.c Normal file
View File

@ -0,0 +1,47 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "input.h"
#include "raylib.h"
typedef struct {
int32_t key;
uint8_t flag;
} inputmap_t;
const inputmap_t INPUT_MAP[] = {
{ KEY_W, INPUT_UP },
{ KEY_S, INPUT_DOWN },
{ KEY_A, INPUT_LEFT },
{ KEY_D, INPUT_RIGHT },
{ KEY_SPACE, INPUT_ACTION },
{ KEY_ESCAPE, INPUT_CANCEL },
{ 0, 0 }
};
void inputInit() {
}
void inputUpdate() {
uint8_t state = 0;
inputmap_t *map = INPUT_MAP;
do {
if(IsKeyDown(map->key)) {
state |= map->flag;
}
map++;
} while(map->key != 0);
INPUT.previous = INPUT.current;
INPUT.current = state;
}
void inputDispose() {
}