1 | #pragma once
|
2 |
|
3 | /*
|
4 | Sound, Input, and Graphics Integration Library (SIGIL) 0.9.0
|
5 | Geoff Nagy
|
6 | */
|
7 |
|
8 | #ifdef _MSC_VER
|
9 | #define SIGIL_API __declspec(dllexport)
|
10 | #else
|
11 | #define SIGIL_API
|
12 | #endif
|
13 |
|
14 | // text alignment symbolic constants
|
15 | #define SL_ALIGN_CENTER 0
|
16 | #define SL_ALIGN_RIGHT 1
|
17 | #define SL_ALIGN_LEFT 2
|
18 |
|
19 | // input key symbolic constants
|
20 | #define SL_KEY_ESCAPE 256
|
21 | #define SL_KEY_ENTER 257
|
22 | #define SL_KEY_TAB 258
|
23 | #define SL_KEY_BACKSPACE 259
|
24 | #define SL_KEY_INSERT 260
|
25 | #define SL_KEY_DELETE 261
|
26 | #define SL_KEY_RIGHT 262
|
27 | #define SL_KEY_LEFT 263
|
28 | #define SL_KEY_DOWN 264
|
29 | #define SL_KEY_UP 265
|
30 | #define SL_KEY_PAGE_UP 266
|
31 | #define SL_KEY_PAGE_DOWN 267
|
32 | #define SL_KEY_HOME 268
|
33 | #define SL_KEY_END 269
|
34 | #define SL_KEY_CAPS_LOCK 280
|
35 | #define SL_KEY_SCROLL_LOCK 281
|
36 | #define SL_KEY_NUM_LOCK 282
|
37 | #define SL_KEY_PRINT_SCREEN 283
|
38 | #define SL_KEY_PAUSE 284
|
39 | #define SL_KEY_F1 290
|
40 | #define SL_KEY_F2 291
|
41 | #define SL_KEY_F3 292
|
42 | #define SL_KEY_F4 293
|
43 | #define SL_KEY_F5 294
|
44 | #define SL_KEY_F6 295
|
45 | #define SL_KEY_F7 296
|
46 | #define SL_KEY_F8 297
|
47 | #define SL_KEY_F9 298
|
48 | #define SL_KEY_F10 299
|
49 | #define SL_KEY_F11 300
|
50 | #define SL_KEY_F12 301
|
51 | #define SL_KEY_F13 302
|
52 | #define SL_KEY_F14 303
|
53 | #define SL_KEY_F15 304
|
54 | #define SL_KEY_F16 305
|
55 | #define SL_KEY_F17 306
|
56 | #define SL_KEY_F18 307
|
57 | #define SL_KEY_F19 308
|
58 | #define SL_KEY_F20 309
|
59 | #define SL_KEY_F21 310
|
60 | #define SL_KEY_F22 311
|
61 | #define SL_KEY_F23 312
|
62 | #define SL_KEY_F24 313
|
63 | #define SL_KEY_F25 314
|
64 | #define SL_KEY_KEYPAD_0 320
|
65 | #define SL_KEY_KEYPAD_1 321
|
66 | #define SL_KEY_KEYPAD_2 322
|
67 | #define SL_KEY_KEYPAD_3 323
|
68 | #define SL_KEY_KEYPAD_4 324
|
69 | #define SL_KEY_KEYPAD_5 325
|
70 | #define SL_KEY_KEYPAD_6 326
|
71 | #define SL_KEY_KEYPAD_7 327
|
72 | #define SL_KEY_KEYPAD_8 328
|
73 | #define SL_KEY_KEYPAD_9 329
|
74 | #define SL_KEY_KEYPAD_DECIMAL 330
|
75 | #define SL_KEY_KEYPAD_DIVIDE 331
|
76 | #define SL_KEY_KEYPAD_MULTIPLY 332
|
77 | #define SL_KEY_KEYPAD_SUBTRACT 333
|
78 | #define SL_KEY_KEYPAD_ADD 334
|
79 | #define SL_KEY_KEYPAD_ENTER 335
|
80 | #define SL_KEY_KEYPAD_EQUAL 336
|
81 | #define SL_KEY_LEFT_SHIFT 340
|
82 | #define SL_KEY_LEFT_CONTROL 341
|
83 | #define SL_KEY_LEFT_ALT 342
|
84 | #define SL_KEY_LEFT_SUPER 343
|
85 | #define SL_KEY_RIGHT_SHIFT 344
|
86 | #define SL_KEY_RIGHT_CONTROL 345
|
87 | #define SL_KEY_RIGHT_ALT 346
|
88 | #define SL_KEY_RIGHT_SUPER 347
|
89 |
|
90 | // mouse input symbolic constants
|
91 | #define SL_MOUSE_BUTTON_1 0
|
92 | #define SL_MOUSE_BUTTON_2 1
|
93 | #define SL_MOUSE_BUTTON_3 2
|
94 | #define SL_MOUSE_BUTTON_4 3
|
95 | #define SL_MOUSE_BUTTON_5 4
|
96 | #define SL_MOUSE_BUTTON_6 5
|
97 | #define SL_MOUSE_BUTTON_7 6
|
98 | #define SL_MOUSE_BUTTON_8 7
|
99 | #define SL_MOUSE_BUTTON_LEFT SL_MOUSE_BUTTON_1
|
100 | #define SL_MOUSE_BUTTON_RIGHT SL_MOUSE_BUTTON_2
|
101 | #define SL_MOUSE_BUTTON_MIDDLE SL_MOUSE_BUTTON_3
|
102 |
|
103 | #ifdef __cplusplus
|
104 | extern "C" {
|
105 | #endif
|
106 |
|
107 | // initialization commands
|
108 |
|
109 | SIGIL_API void slWindow(int width, int height, const char *title, int fullScreen);
|
110 | SIGIL_API void slShowCursor(int showCursor);
|
111 | SIGIL_API void slClose();
|
112 | SIGIL_API int slShouldClose();
|
113 |
|
114 | // simple input
|
115 |
|
116 | SIGIL_API int slGetKey(int key);
|
117 |
|
118 | SIGIL_API int slGetMouseButton(int button);
|
119 | SIGIL_API int slGetMouseX();
|
120 | SIGIL_API int slGetMouseY();
|
121 |
|
122 | // simple frame timing
|
123 |
|
124 | SIGIL_API double slGetDeltaTime();
|
125 | SIGIL_API double slGetTime();
|
126 |
|
127 | // rendering commands
|
128 |
|
129 | SIGIL_API void slRender();
|
130 |
|
131 | // color control
|
132 |
|
133 | SIGIL_API void slSetBackColor(double red, double green, double blue);
|
134 | SIGIL_API void slSetForeColor(double red, double green, double blue, double alpha);
|
135 |
|
136 | // blending control
|
137 |
|
138 | SIGIL_API void slSetAdditiveBlend(int additiveBlend);
|
139 |
|
140 | // transformations
|
141 |
|
142 | SIGIL_API void slPush();
|
143 | SIGIL_API void slPop();
|
144 |
|
145 | SIGIL_API void slTranslate(double x, double y);
|
146 | SIGIL_API void slRotate(double degrees);
|
147 | SIGIL_API void slScale(double x, double y);
|
148 |
|
149 | // texture loading
|
150 |
|
151 | SIGIL_API int slLoadTexture(const char *filename);
|
152 |
|
153 | // sound loading and playing
|
154 |
|
155 | SIGIL_API int slLoadWAV(const char *filename);
|
156 | SIGIL_API int slSoundPlay(int sound);
|
157 | SIGIL_API int slSoundLoop(int sound);
|
158 | SIGIL_API void slSoundPause(int sound);
|
159 | SIGIL_API void slSoundStop(int sound);
|
160 | SIGIL_API void slSoundPauseAll();
|
161 | SIGIL_API void slSoundResumeAll();
|
162 | SIGIL_API void slSoundStopAll();
|
163 | SIGIL_API int slSoundPlaying(int sound);
|
164 | SIGIL_API int slSoundLooping(int sound);
|
165 |
|
166 | // simple shape commands
|
167 |
|
168 | SIGIL_API void slTriangleFill(double x, double y, double width, double height);
|
169 | SIGIL_API void slTriangleOutline(double x, double y, double width, double height);
|
170 |
|
171 | SIGIL_API void slRectangleFill(double x, double y, double width, double height);
|
172 | SIGIL_API void slRectangleOutline(double x, double y, double width, double height);
|
173 |
|
174 | SIGIL_API void slCircleFill(double x, double y, double radius, int numVertices);
|
175 | SIGIL_API void slCircleOutline(double x, double y, double radius, int numVertices);
|
176 |
|
177 | SIGIL_API void slSemiCircleFill(double x, double y, double radius, int numVertices, double degrees);
|
178 | SIGIL_API void slSemiCircleOutline(double x, double y, double radius, int numVertices, double degrees);
|
179 |
|
180 | SIGIL_API void slPoint(double x, double y);
|
181 |
|
182 | SIGIL_API void slLine(double x1, double y1, double x2, double y2);
|
183 |
|
184 | SIGIL_API void slSetSpriteTiling(double x, double y);
|
185 | SIGIL_API void slSetSpriteScroll(double x, double y);
|
186 | SIGIL_API void slSprite(int texture, double x, double y, double width, double height);
|
187 |
|
188 | // text commands
|
189 |
|
190 | SIGIL_API void slSetTextAlign(int fontAlign);
|
191 | SIGIL_API double slGetTextWidth(const char *text);
|
192 | SIGIL_API double slGetTextHeight(const char *text);
|
193 | SIGIL_API int slLoadFont(const char *fontFilename);
|
194 | SIGIL_API void slSetFont(int font, int fontSize);
|
195 | SIGIL_API void slSetFontSize(int fontSize);
|
196 | SIGIL_API void slText(double x, double y, const char *text);
|
197 |
|
198 | #ifdef __cplusplus
|
199 | } // closing brace for extern "C"
|
200 | #endif
|
201 | |