Reshuffled
This commit is contained in:
@ -42,11 +42,12 @@ int32_t main() {
|
||||
if(runningGame == NULL) return 1;
|
||||
|
||||
// Update the window title.
|
||||
engine_t *engine = gameGetEngine(runningGame);
|
||||
glfwSetWindowTitle(window, engine->name);
|
||||
glfwSetWindowTitle(window, runningGame->engine->name);
|
||||
|
||||
// Bind inputs
|
||||
inputBind(engine->input, INPUT_NULL, (inputsource_t *)GLFW_KEY_ESCAPE);
|
||||
inputBind(runningGame->engine->input, INPUT_NULL,
|
||||
(inputsource_t *)GLFW_KEY_ESCAPE
|
||||
);
|
||||
|
||||
// Main Render Loop
|
||||
while(!glfwWindowShouldClose(window)) {
|
||||
@ -67,10 +68,9 @@ int32_t main() {
|
||||
}
|
||||
|
||||
void glfwOnResize(GLFWwindow *window, int32_t width, int32_t height) {
|
||||
engine_t *engine = gameGetEngine(runningGame);
|
||||
engine->platform->screenWidth = width;
|
||||
engine->platform->screenWidth = height;
|
||||
renderSetResolution(engine->render, width, height);
|
||||
runningGame->engine->platform->screenWidth = width;
|
||||
runningGame->engine->platform->screenWidth = height;
|
||||
renderSetResolution(runningGame->engine->render, width, height);
|
||||
}
|
||||
|
||||
void glfwOnKey(GLFWwindow *window,
|
||||
@ -78,10 +78,9 @@ void glfwOnKey(GLFWwindow *window,
|
||||
) {
|
||||
if(runningGame == NULL) return;
|
||||
|
||||
engine_t *engine = gameGetEngine(runningGame);
|
||||
if(action == GLFW_PRESS) {
|
||||
engine->input->buffer[key] = 1;
|
||||
runningGame->engine->input->buffer[key] = 1;
|
||||
} else if(action == GLFW_RELEASE) {
|
||||
engine->input->buffer[key] = 0;
|
||||
runningGame->engine->input->buffer[key] = 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user