diff options
author | David Robillard <d@drobilla.net> | 2014-05-13 15:30:36 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-05-13 15:30:36 +0000 |
commit | a739e6116f026e2fe334f447082616712a1cfd78 (patch) | |
tree | 8b6b3fb3bcfb9cd41dae872d5789a54fc5a4c3c5 /pugl/pugl_win.cpp | |
parent | e86043f765dd18a51cb2450f45d1d204fd4cb4d9 (diff) | |
download | pugl-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.cpp | 28 |
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)); |