From a739e6116f026e2fe334f447082616712a1cfd78 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 13 May 2014 15:30:36 +0000 Subject: Fix non-extensible puglInit API. Fix memory leak. --- pugl/pugl_win.cpp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'pugl/pugl_win.cpp') 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)); -- cgit v1.2.1