summaryrefslogtreecommitdiff
path: root/gfx-app/src
diff options
context:
space:
mode:
Diffstat (limited to 'gfx-app/src')
-rw-r--r--gfx-app/src/gfx_app.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gfx-app/src/gfx_app.c b/gfx-app/src/gfx_app.c
index 31f8448..2d54e3d 100644
--- a/gfx-app/src/gfx_app.c
+++ b/gfx-app/src/gfx_app.c
@@ -95,8 +95,10 @@ bool gfx_app_run(const GfxAppDesc* desc, const GfxAppCallbacks* callbacks) {
95 // TODO: Test antialiasing later on. 95 // TODO: Test antialiasing later on.
96 // glfwWindowHint(GLFW_SAMPLES, 4); 96 // glfwWindowHint(GLFW_SAMPLES, 4);
97 97
98 g_gfx_app.window = glfwCreateWindow( 98 const char* title = desc->title ? desc->title : "Gfx Application";
99 desc->width, desc->height, "Gfx Application", NULL, NULL); 99
100 g_gfx_app.window =
101 glfwCreateWindow(desc->width, desc->height, title, NULL, NULL);
100 if (!g_gfx_app.window) { 102 if (!g_gfx_app.window) {
101 LOGE("glfwCreateWindow() failed"); 103 LOGE("glfwCreateWindow() failed");
102 goto cleanup; 104 goto cleanup;
@@ -128,3 +130,7 @@ cleanup:
128 glfwTerminate(); 130 glfwTerminate();
129 return success; 131 return success;
130} 132}
133
134void gfx_app_get_mouse_position(double* x, double* y) {
135 glfwGetCursorPos(g_gfx_app.window, x, y);
136}