aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_win.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-05-13 15:30:36 +0000
committerDavid Robillard <d@drobilla.net>2014-05-13 15:30:36 +0000
commita739e6116f026e2fe334f447082616712a1cfd78 (patch)
tree8b6b3fb3bcfb9cd41dae872d5789a54fc5a4c3c5 /pugl/pugl_win.cpp
parente86043f765dd18a51cb2450f45d1d204fd4cb4d9 (diff)
downloadpugl-a739e6116f026e2fe334f447082616712a1cfd78.tar.gz
pugl-a739e6116f026e2fe334f447082616712a1cfd78.tar.bz2
pugl-a739e6116f026e2fe334f447082616712a1cfd78.zip
Fix non-extensible puglInit API.
Fix memory leak.
Diffstat (limited to 'pugl/pugl_win.cpp')
-rw-r--r--pugl/pugl_win.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/pugl/pugl_win.cpp b/pugl/pugl_win.cpp
index 47ba18e..3cdfcb5 100644
--- a/pugl/pugl_win.cpp
+++ b/pugl/pugl_win.cpp
@@ -50,12 +50,28 @@ LRESULT CALLBACK
wndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
PuglView*
-puglCreate(PuglNativeWindow parent,
- const char* title,
- int width,
- int height,
- bool resizable,
- bool visible)
+puglInit()
+{
+ PuglView* view = (PuglView*)calloc(1, sizeof(PuglView));
+ PuglInternals* impl = (PuglInternals*)calloc(1, sizeof(PuglInternals));
+ if (!view || !impl) {
+ return NULL;
+ }
+
+ view->impl = impl;
+ view->width = 640;
+ view->height = 480;
+
+ return view;
+}
+
+PuglView*
+puglCreateInternals(PuglNativeWindow parent,
+ const char* title,
+ int width,
+ int height,
+ bool resizable,
+ bool visible)
{
PuglView* view = (PuglView*)calloc(1, sizeof(PuglView));
PuglInternals* impl = (PuglInternals*)calloc(1, sizeof(PuglInternals));