Created
May 15, 2012 02:01
-
-
Save jsimmons/2698514 to your computer and use it in GitHub Desktop.
SGL Core headers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef SGL_EVENT_H | |
| #define SGL_EVENT_H | |
| #include <stdint.h> | |
| #include "button.h" | |
| struct _SWindow; | |
| typedef enum | |
| { | |
| S_UNKNOWN_EVENT, | |
| S_BUTTON_PRESS_EVENT, | |
| S_BUTTON_RELEASE_EVENT, | |
| S_MOUSE_EVENT, | |
| S_RESIZE_EVENT, | |
| S_CLOSE_EVENT, | |
| } SEventType; | |
| typedef struct | |
| { | |
| int x; | |
| int y; | |
| uint32_t character; | |
| SButton button; | |
| SModifier modifiers; | |
| } SButtonEventData; | |
| typedef struct | |
| { | |
| int x; | |
| int y; | |
| } SMouseEventData; | |
| typedef struct | |
| { | |
| int x, y; | |
| int width, height; | |
| } SResizeEventData; | |
| typedef struct | |
| { | |
| SEventType type; | |
| union | |
| { | |
| SButtonEventData button; | |
| SMouseEventData mouse; | |
| SResizeEventData resize; | |
| } data; | |
| } SEvent; | |
| int sgl_window_get_event(struct _SWindow *window, SEvent *event); | |
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef SGL_CONTEXT_H | |
| #define SGL_CONTEXT_H | |
| #include <stdbool.h> | |
| struct SWindowImpl; | |
| typedef struct _SWindow | |
| { | |
| struct SWindowImpl *impl; | |
| } SWindow; | |
| typedef struct | |
| { | |
| int screen_width; | |
| int screen_height; | |
| int gl_version_major; | |
| int gl_version_minor; | |
| } SWindowOptions; | |
| bool sgl_window(SWindow *window, SWindowOptions *options); | |
| void sgl_window_swap(SWindow *window); | |
| void sgl_window_destroy(SWindow *window); | |
| #endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment