aboutsummaryrefslogtreecommitdiffstats
path: root/src/platform.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-06-06 21:01:12 -0400
committerDavid Robillard <d@drobilla.net>2022-06-08 22:01:15 -0400
commit8f505887090d0d6a16a0f3b06638fa297b9a4255 (patch)
tree28fb5c9fa2cc239f260ba207f923de2844b43488 /src/platform.h
parent27ce10b5039e931eaad33e9499a630552d4e1f06 (diff)
downloadpugl-8f505887090d0d6a16a0f3b06638fa297b9a4255.tar.gz
pugl-8f505887090d0d6a16a0f3b06638fa297b9a4255.tar.bz2
pugl-8f505887090d0d6a16a0f3b06638fa297b9a4255.zip
Separate platform.h from internal.h
This makes the internal header structure match the "kinds" of definition inside Pugl: common implementations of public API, things available internally to platform implementations, and things the platform must define.
Diffstat (limited to 'src/platform.h')
-rw-r--r--src/platform.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/platform.h b/src/platform.h
new file mode 100644
index 0000000..ec16197
--- /dev/null
+++ b/src/platform.h
@@ -0,0 +1,33 @@
+// Copyright 2012-2022 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+// The API that a platform implementation must define
+
+#ifndef PUGL_PLATFORM_H
+#define PUGL_PLATFORM_H
+
+#include "types.h"
+
+#include "pugl/pugl.h"
+
+PUGL_BEGIN_DECLS
+
+/// Allocate and initialise world internals (implemented once per platform)
+PuglWorldInternals*
+puglInitWorldInternals(PuglWorldType type, PuglWorldFlags flags);
+
+/// Destroy and free world internals (implemented once per platform)
+void
+puglFreeWorldInternals(PuglWorld* world);
+
+/// Allocate and initialise view internals (implemented once per platform)
+PuglInternals*
+puglInitViewInternals(PuglWorld* world);
+
+/// Destroy and free view internals (implemented once per platform)
+void
+puglFreeViewInternals(PuglView* view);
+
+PUGL_END_DECLS
+
+#endif // PUGL_PLATFORM_H