rename global window to member window in ptk.c
This commit is contained in:
parent
db65f8d5bf
commit
f03c3260ce
1 changed files with 8 additions and 8 deletions
16
src/ptk.c
16
src/ptk.c
|
@ -21,7 +21,7 @@
|
|||
#include <stdlib.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) {
|
||||
(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);
|
||||
|
||||
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");
|
||||
return false;
|
||||
}
|
||||
|
||||
glfwSetFramebufferSizeCallback(g_window, framebuffer_resize_callback);
|
||||
glfwSetKeyCallback(g_window, key_callback);
|
||||
glfwSetMouseButtonCallback(g_window, mouse_button_callback);
|
||||
glfwSetFramebufferSizeCallback(m_window, framebuffer_resize_callback);
|
||||
glfwSetKeyCallback(m_window, key_callback);
|
||||
glfwSetMouseButtonCallback(m_window, mouse_button_callback);
|
||||
|
||||
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");
|
||||
return false;
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ void init_component(PtkHandle component) {
|
|||
int ptk_run(PtkHandle root) {
|
||||
init_component(root);
|
||||
|
||||
while (!glfwWindowShouldClose(g_window)) {
|
||||
while (!glfwWindowShouldClose(m_window)) {
|
||||
glfwPollEvents();
|
||||
if (!vk_draw_frame()) {
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue