diff options
Diffstat (limited to 'rgfw.c3')
| -rw-r--r-- | rgfw.c3 | 83 |
1 files changed, 83 insertions, 0 deletions
@@ -0,0 +1,83 @@ +module rgfw; + +alias Window = void; +alias GlContext = void; +alias EglContext = void; +alias Proc = fn void (); + +enum GlReleaseBehavior: int +{ + GL_RELEASE_FLUSH, + GL_RELEASE_NONE, +} + +enum GlProfile: int +{ + GL_CORE, + GL_FORWARD_COMPATIBILITY, + GL_COMPATIBILITY, + GL_ES, +} + +enum GlRenderer: int +{ + GL_ACCELERATED, + GL_SOFTWARE, +} + +constdef WindowFlags : uint +{ + WINDOW_NO_BORDER = 1 << 0, + WINDOW_NO_RESIZE = 1 << 1, + WINDOW_ALLOW_DND = 1 << 2, + WINDOW_HIDE_MOUSE = 1 << 3, + WINDOW_FULLSCREEN = 1 << 4, + WINDOW_TRANSLUCENT = 1 << 5, + WINDOW_TRANSPARENT = WINDOW_TRANSLUCENT, + WINDOW_CENTER = 1 << 6, + WINDOW_RAW_MOUSE = 1 << 7, + WINDOW_SCALE_TO_MONITOR = 1 << 8, + WINDOW_HIDE = 1 << 9, + WINDOW_MAXIMIZE = 1 << 10, + WINDOW_CENTER_CURSOR = 1 << 11, + WINDOW_FLOATING = 1 << 12, + WINDOW_FOCUS_ON_SHOW = 1 << 13, + WINDOW_MINIMIZE = 1 << 14, + WINDOW_FOCUS = 1 << 15, + WINDOW_CAPTURE_MOUSE = 1 << 16, + WINDOW_OPENGL = 1 << 17, + WINDOW_EGL = 1 << 18, + NO_DEINIT_ON_CLOSE = 1 << 19, + WINDOWED_FULLSCREEN = WINDOW_NO_BORDER | WINDOW_MAXIMIZE, + WINDOW_CAPTURE_RAW_MOUSE = WINDOW_CAPTURE_MOUSE | WINDOW_RAW_MOUSE, +} + +struct GlHints +{ + int stencil; + int samples; + int stereo; + int auxBuffers; + int doubleBuffer; + int red; int green; int blue; int alpha; + int depth; + int accumRed; int accumGreen; int accumBlue; int accumAlpha; + bool sRGB; + bool robustness; + bool debug; + bool noError; + GlReleaseBehavior releaseBehavior; + GlProfile profile; + int major; int minor; + GlContext* share; + EglContext* shareEGL; + GlRenderer renderer; +} + +extern fn Window* createWindow(ZString, int, int, int, int, WindowFlags) @cname("RGFW_createWindow"); +extern fn bool window_shouldClose(Window*) @cname("RGFW_window_shouldClose"); +extern fn bool window_close(Window*) @cname("RGFW_window_close"); +extern fn void pollEvents() @cname("RGFW_pollEvents"); +extern fn GlHints* getGlobalHints_OpenGL() @cname("RGFW_getGlobalHints_OpenGL"); +extern fn void setGlobalHints_OpenGL(GlHints*) @cname("RGFW_setGlobalHints_OpenGL"); +extern fn Proc getProcAddress_OpenGL(ZString) @cname("RGFW_getProcAddress_OpenGL"); |
