summaryrefslogtreecommitdiff
path: root/pugl/pugl_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/pugl_internal.h')
-rw-r--r--pugl/pugl_internal.h48
1 files changed, 46 insertions, 2 deletions
diff --git a/pugl/pugl_internal.h b/pugl/pugl_internal.h
index 74aae55..6813fef 100644
--- a/pugl/pugl_internal.h
+++ b/pugl/pugl_internal.h
@@ -39,8 +39,6 @@
# define PUGL_LOGF(fmt, ...)
#endif
-void puglDefaultReshape(PuglView* view, int width, int height);
-
typedef struct PuglInternalsImpl PuglInternals;
struct PuglViewImpl {
@@ -56,15 +54,61 @@ struct PuglViewImpl {
PuglInternals* impl;
+ PuglNativeWindow parent;
+
int width;
int height;
int mods;
bool mouse_in_view;
bool ignoreKeyRepeat;
bool redisplay;
+ bool resizable;
uint32_t event_timestamp_ms;
};
+PuglInternals* puglInitInternals();
+
+void puglDefaultReshape(PuglView* view, int width, int height);
+
+PuglView*
+puglInit(int* pargc, char** argv)
+{
+ PuglView* view = (PuglView*)calloc(1, sizeof(PuglView));
+ if (!view) {
+ return NULL;
+ }
+
+ PuglInternals* impl = puglInitInternals();
+ if (!impl) {
+ return NULL;
+ }
+
+ view->impl = impl;
+ view->width = 640;
+ view->height = 480;
+
+ return view;
+}
+
+void
+puglInitWindowSize(PuglView* view, int width, int height)
+{
+ view->width = width;
+ view->height = height;
+}
+
+void
+puglInitWindowParent(PuglView* view, PuglNativeWindow parent)
+{
+ view->parent = parent;
+}
+
+void
+puglInitResizable(PuglView* view, bool resizable)
+{
+ view->resizable = true;
+}
+
void
puglSetHandle(PuglView* view, PuglHandle handle)
{