Added some defineable types
This commit is contained in:
@ -13,7 +13,11 @@ int32_t main() {
|
||||
platform_t platform = {
|
||||
.name = "glfw",
|
||||
.screenWidth = WINDOW_WIDTH_DEFAULT,
|
||||
.screenHeight = WINDOW_HEIGHT_DEFAULT
|
||||
.screenHeight = WINDOW_HEIGHT_DEFAULT,
|
||||
|
||||
.inputSourceCount = 0,
|
||||
.inputValues = NULL,
|
||||
.inputSource = NULL
|
||||
};
|
||||
|
||||
// Attempt to init GLFW
|
||||
@ -38,6 +42,10 @@ int32_t main() {
|
||||
runningGame = gameInit(&platform);
|
||||
if(runningGame == NULL) return 1;
|
||||
|
||||
// Update the window title.
|
||||
engine_t *engine = gameGetEngine(runningGame);
|
||||
glfwSetWindowTitle(window, engine->name);
|
||||
|
||||
// Main Render Loop
|
||||
while(!glfwWindowShouldClose(window)) {
|
||||
gameUpdate(runningGame);
|
||||
@ -65,11 +73,8 @@ void glfwOnResize(GLFWwindow *window, int32_t width, int32_t height) {
|
||||
void glfwOnKey(GLFWwindow *window,
|
||||
int32_t key, int32_t scancode, int32_t action, int32_t mods
|
||||
) {
|
||||
char *title = glfwGetKeyName(key, scancode);
|
||||
if(title == NULL) {
|
||||
printf("Unknown Key %d", scancode);
|
||||
} else {
|
||||
printf(title);
|
||||
}
|
||||
printf("\n");
|
||||
float force = action == GLFW_PRESS ? 1 : 0;
|
||||
engine_t *engine = gameGetEngine(runningGame);
|
||||
|
||||
engine->input->current[scancode] = force;
|
||||
}
|
Reference in New Issue
Block a user