Cross-Platform OpenGL Windowing Library
修订版 | b24c243c2b46b87cd865db972591ae5d6b771f3a (tree) |
---|---|
时间 | 2020-01-04 16:57:07 |
作者 | AlaskanEmily <emily@alas...> |
Commiter | AlaskanEmily |
Slightly nicer formatting
@@ -12,6 +12,8 @@ | ||
12 | 12 | extern "C" { |
13 | 13 | #endif |
14 | 14 | |
15 | +/******************************************************************************/ | |
16 | + | |
15 | 17 | #if defined ( __GNUC__ ) && ( __GNUC__ > 4 ) |
16 | 18 | #define GLOW_CONST __attribute__((const)) |
17 | 19 | #define GLOW_PURE __attribute__((pure)) |
@@ -22,9 +24,13 @@ extern "C" { | ||
22 | 24 | #define GLOW_RETURNS_NOT_NULL |
23 | 25 | #endif |
24 | 26 | |
27 | +/******************************************************************************/ | |
28 | +/* Flags for Glow_CreateWindow */ | |
25 | 29 | #define GLOW_RESIZABLE (1<<0) |
26 | 30 | #define GLOW_UNDECORATED (1<<1) |
27 | 31 | |
32 | +/******************************************************************************/ | |
33 | + | |
28 | 34 | #if defined _WIN32 && defined GLOW_DLL |
29 | 35 | #ifdef GLOW_EXPORTS |
30 | 36 | #define GLOW_EXPORT __declspec(dllexport) |
@@ -35,6 +41,7 @@ extern "C" { | ||
35 | 41 | #define GLOW_EXPORT |
36 | 42 | #endif |
37 | 43 | |
44 | +/******************************************************************************/ | |
38 | 45 | |
39 | 46 | enum Glow_EventType { |
40 | 47 | eGlowKeyboardPressed, |
@@ -46,6 +53,8 @@ enum Glow_EventType { | ||
46 | 53 | eGlowQuit = 0xFF |
47 | 54 | }; |
48 | 55 | |
56 | +/******************************************************************************/ | |
57 | + | |
49 | 58 | enum Glow_MouseButton{ |
50 | 59 | eGlowLeft, |
51 | 60 | eGlowRight, |
@@ -53,14 +62,22 @@ enum Glow_MouseButton{ | ||
53 | 62 | eGlow_NUM_BUTTONS |
54 | 63 | }; |
55 | 64 | |
65 | +/******************************************************************************/ | |
66 | + | |
56 | 67 | #define GLOW_COORD_X 0 |
57 | 68 | #define GLOW_COORD_Y 1 |
58 | 69 | |
70 | +/******************************************************************************/ | |
71 | + | |
59 | 72 | #define GLOW_GET_X(THAT) (THAT[0]) |
60 | 73 | #define GLOW_GET_Y(THAT) (THAT[1]) |
61 | 74 | |
75 | +/******************************************************************************/ | |
76 | + | |
62 | 77 | typedef unsigned short glow_pixel_coords_t[2]; |
63 | 78 | |
79 | +/******************************************************************************/ | |
80 | + | |
64 | 81 | /* Key constants */ |
65 | 82 | #define GLOW_ESCAPE "escape" |
66 | 83 | #define GLOW_SHIFT "shift" |
@@ -75,6 +92,8 @@ typedef unsigned short glow_pixel_coords_t[2]; | ||
75 | 92 | #define GLOW_RETURN GLOW_ENTER |
76 | 93 | #define GLOW_TAB "tab" |
77 | 94 | |
95 | +/******************************************************************************/ | |
96 | + | |
78 | 97 | #define GLOW_MAX_KEY_NAME_SIZE 16 |
79 | 98 | struct Glow_Event{ |
80 | 99 | enum Glow_EventType type; |
@@ -386,6 +386,8 @@ GLOW_PURE static enum Glow_MouseButton glow_message_button(const MSG *msg){ | ||
386 | 386 | } |
387 | 387 | } |
388 | 388 | |
389 | +/******************************************************************************/ | |
390 | + | |
389 | 391 | static BOOL glow_translate_event(const MSG *msg, struct Glow_Window *window, |
390 | 392 | struct Glow_Event *out_event){ |
391 | 393 | BOOL pressed = FALSE; |