aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/win.c
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/detail/win.c')
-rw-r--r--pugl/detail/win.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/pugl/detail/win.c b/pugl/detail/win.c
index 4606d60..6d8a99e 100644
--- a/pugl/detail/win.c
+++ b/pugl/detail/win.c
@@ -160,12 +160,10 @@ puglPollWinEvents(PuglWorld* world, const double timeout)
}
PuglStatus
-puglCreateWindow(PuglView* view, const char* title)
+puglRealize(PuglView* view)
{
PuglInternals* impl = view->impl;
- title = title ? title : view->world->className;
-
// Get refresh rate for resize draw timer
DEVMODEA devMode = {0};
EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &devMode);
@@ -187,8 +185,8 @@ puglCreateWindow(PuglView* view, const char* title)
return PUGL_CREATE_CONTEXT_FAILED;
}
- if (title) {
- puglSetWindowTitle(view, title);
+ if (view->title) {
+ puglSetWindowTitle(view, view->title);
}
puglSetFrame(view, view->frame);
@@ -919,10 +917,12 @@ puglSetWindowTitle(PuglView* view, const char* title)
{
puglSetString(&view->title, title);
- wchar_t* wtitle = puglUtf8ToWideChar(title);
- if (wtitle) {
- SetWindowTextW(view->impl->hwnd, wtitle);
- free(wtitle);
+ if (view->impl->hwnd) {
+ wchar_t* wtitle = puglUtf8ToWideChar(title);
+ if (wtitle) {
+ SetWindowTextW(view->impl->hwnd, wtitle);
+ free(wtitle);
+ }
}
return PUGL_SUCCESS;