rename global window to member window in ptk.c

This commit is contained in:
jacekpoz 2024-08-13 15:15:48 +02:00
parent db65f8d5bf
commit f03c3260ce
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -21,7 +21,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
static GLFWwindow *g_window = NULL; static GLFWwindow *m_window = NULL;
static void framebuffer_resize_callback(GLFWwindow *window, int width, int height) { static void framebuffer_resize_callback(GLFWwindow *window, int width, int height) {
(void)window; (void)width; (void)height; (void)window; (void)width; (void)height;
@ -111,20 +111,20 @@ bool ptk_init(const size_t width, const size_t height, const char *title, const
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
g_window = glfwCreateWindow(width, height, title, NULL, NULL); m_window = glfwCreateWindow(width, height, title, NULL, NULL);
if (g_window == NULL) { if (m_window == NULL) {
PTK_ERR("failed creating GLFW window"); PTK_ERR("failed creating GLFW window");
return false; return false;
} }
glfwSetFramebufferSizeCallback(g_window, framebuffer_resize_callback); glfwSetFramebufferSizeCallback(m_window, framebuffer_resize_callback);
glfwSetKeyCallback(g_window, key_callback); glfwSetKeyCallback(m_window, key_callback);
glfwSetMouseButtonCallback(g_window, mouse_button_callback); glfwSetMouseButtonCallback(m_window, mouse_button_callback);
vk_components_init(); vk_components_init();
if (!vk_init(g_window, width, height, title, application_version)) { if (!vk_init(m_window, width, height, title, application_version)) {
PTK_ERR("failed initializing vulkan"); PTK_ERR("failed initializing vulkan");
return false; return false;
} }
@ -210,7 +210,7 @@ void init_component(PtkHandle component) {
int ptk_run(PtkHandle root) { int ptk_run(PtkHandle root) {
init_component(root); init_component(root);
while (!glfwWindowShouldClose(g_window)) { while (!glfwWindowShouldClose(m_window)) {
glfwPollEvents(); glfwPollEvents();
if (!vk_draw_frame()) { if (!vk_draw_frame()) {
break; break;