forked from simple2d/simple2d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple2d.h
735 lines (627 loc) · 16.6 KB
/
simple2d.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
// simple2d.h
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
// Set Platform Constants //////////////////////////////////////////////////////
// Apple
#ifdef __APPLE__
#ifndef __TARGETCONDITIONALS__
#include "TargetConditionals.h"
#endif
#if TARGET_OS_OSX
#define MACOS true
#elif TARGET_OS_IOS
#define IOS true
#elif TARGET_OS_TV
#define TVOS true
#endif
#endif
// Windows
#ifdef _WIN32
#define WINDOWS true
#endif
// Windows and MinGW
#ifdef __MINGW32__
#define MINGW true
#endif
// GLES
#if defined(__arm__) || IOS || TVOS
#define GLES true
#else
#define GLES false
#endif
// Includes ////////////////////////////////////////////////////////////////////
// Define to get GNU extension functions and types, like `vasprintf()` and M_PI
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#if WINDOWS && !MINGW
#include <io.h>
#define F_OK 0 // For testing file existence
#else
#include <unistd.h>
#endif
#if WINDOWS
#include <stdio.h>
#include <math.h>
#include <windows.h>
// For terminal colors
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif
#endif
// SDL
#if IOS || TVOS
#include "SDL2/SDL.h"
#else
#include <SDL2/SDL.h>
#endif
// If MinGW, undefine `main()` from SDL_main.c
#if MINGW
#undef main
#endif
// OpenGL
#if GLES
#if IOS || TVOS
#include "SDL2/SDL_opengles2.h"
#else
#include <SDL2/SDL_opengles2.h>
#endif
#else
#define GL_GLEXT_PROTOTYPES 1
#if WINDOWS
#include <glew.h>
#endif
#include <SDL2/SDL_opengl.h>
#endif
// SDL libraries
#if IOS || TVOS
#include "SDL2/SDL_image.h"
#include "SDL2/SDL_mixer.h"
#include "SDL2/SDL_ttf.h"
#else
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_mixer.h>
#include <SDL2/SDL_ttf.h>
#endif
// Simple 2D Definitions ///////////////////////////////////////////////////////
// Messages
#define S2D_INFO 1
#define S2D_WARN 2
#define S2D_ERROR 3
// Window attributes
#define S2D_RESIZABLE SDL_WINDOW_RESIZABLE
#define S2D_BORDERLESS SDL_WINDOW_BORDERLESS
#define S2D_FULLSCREEN SDL_WINDOW_FULLSCREEN_DESKTOP
#define S2D_HIGHDPI SDL_WINDOW_ALLOW_HIGHDPI
#define S2D_DISPLAY_WIDTH 0
#define S2D_DISPLAY_HEIGHT 0
// Viewport scaling modes
#define S2D_FIXED 1
#define S2D_EXPAND 2
#define S2D_SCALE 3
#define S2D_STRETCH 4
// Positions
#define S2D_CENTER 1
#define S2D_TOP_LEFT 2
#define S2D_TOP_RIGHT 3
#define S2D_BOTTOM_LEFT 4
#define S2D_BOTTOM_RIGHT 5
// Keyboard events
#define S2D_KEY_DOWN 1 // key is pressed
#define S2D_KEY_HELD 2 // key is held down
#define S2D_KEY_UP 3 // key is released
// Mouse events
#define S2D_MOUSE_DOWN 1 // mouse button pressed
#define S2D_MOUSE_UP 2 // mouse button released
#define S2D_MOUSE_SCROLL 3 // mouse scrolling or wheel movement
#define S2D_MOUSE_MOVE 4 // mouse movement
#define S2D_MOUSE_LEFT SDL_BUTTON_LEFT
#define S2D_MOUSE_MIDDLE SDL_BUTTON_MIDDLE
#define S2D_MOUSE_RIGHT SDL_BUTTON_RIGHT
#define S2D_MOUSE_X1 SDL_BUTTON_X1
#define S2D_MOUSE_X2 SDL_BUTTON_X2
#define S2D_MOUSE_SCROLL_NORMAL SDL_MOUSEWHEEL_NORMAL
#define S2D_MOUSE_SCROLL_INVERTED SDL_MOUSEWHEEL_FLIPPED
// Controller events
#define S2D_AXIS 1
#define S2D_BUTTON_DOWN 2
#define S2D_BUTTON_UP 3
// Controller axis labels
#define S2D_AXIS_INVALID SDL_CONTROLLER_AXIS_INVALID
#define S2D_AXIS_LEFTX SDL_CONTROLLER_AXIS_LEFTX
#define S2D_AXIS_LEFTY SDL_CONTROLLER_AXIS_LEFTY
#define S2D_AXIS_RIGHTX SDL_CONTROLLER_AXIS_RIGHTX
#define S2D_AXIS_RIGHTY SDL_CONTROLLER_AXIS_RIGHTY
#define S2D_AXIS_TRIGGERLEFT SDL_CONTROLLER_AXIS_TRIGGERLEFT
#define S2D_AXIS_TRIGGERRIGHT SDL_CONTROLLER_AXIS_TRIGGERRIGHT
#define S2D_AXIS_MAX SDL_CONTROLLER_AXIS_MAX
// Controller button labels
#define S2D_BUTTON_INVALID SDL_CONTROLLER_BUTTON_INVALID
#define S2D_BUTTON_A SDL_CONTROLLER_BUTTON_A
#define S2D_BUTTON_B SDL_CONTROLLER_BUTTON_B
#define S2D_BUTTON_X SDL_CONTROLLER_BUTTON_X
#define S2D_BUTTON_Y SDL_CONTROLLER_BUTTON_Y
#define S2D_BUTTON_BACK SDL_CONTROLLER_BUTTON_BACK
#define S2D_BUTTON_GUIDE SDL_CONTROLLER_BUTTON_GUIDE
#define S2D_BUTTON_START SDL_CONTROLLER_BUTTON_START
#define S2D_BUTTON_LEFTSTICK SDL_CONTROLLER_BUTTON_LEFTSTICK
#define S2D_BUTTON_RIGHTSTICK SDL_CONTROLLER_BUTTON_RIGHTSTICK
#define S2D_BUTTON_LEFTSHOULDER SDL_CONTROLLER_BUTTON_LEFTSHOULDER
#define S2D_BUTTON_RIGHTSHOULDER SDL_CONTROLLER_BUTTON_RIGHTSHOULDER
#define S2D_BUTTON_DPAD_UP SDL_CONTROLLER_BUTTON_DPAD_UP
#define S2D_BUTTON_DPAD_DOWN SDL_CONTROLLER_BUTTON_DPAD_DOWN
#define S2D_BUTTON_DPAD_LEFT SDL_CONTROLLER_BUTTON_DPAD_LEFT
#define S2D_BUTTON_DPAD_RIGHT SDL_CONTROLLER_BUTTON_DPAD_RIGHT
#define S2D_BUTTON_MAX SDL_CONTROLLER_BUTTON_MAX
// Internal Shared Data ////////////////////////////////////////////////////////
extern bool S2D_diagnostics; // flag for whether to print diagnostics with S2D_Log
// Type Definitions ////////////////////////////////////////////////////////////
// S2D_Event
typedef struct {
int which;
int type;
int button;
bool dblclick;
const char *key;
int x;
int y;
int delta_x;
int delta_y;
int direction;
int axis;
int value;
} S2D_Event;
typedef void (*S2D_Update)();
typedef void (*S2D_Render)();
typedef void (*S2D_On_Key)(S2D_Event e);
typedef void (*S2D_On_Mouse)(S2D_Event e);
typedef void (*S2D_On_Controller)(S2D_Event e);
// S2D_GL_Point, for graphics calculations
typedef struct {
GLfloat x;
GLfloat y;
} S2D_GL_Point;
// S2D_Color
typedef struct {
GLfloat r;
GLfloat g;
GLfloat b;
GLfloat a;
} S2D_Color;
// S2D_Mouse
typedef struct {
int visible;
int x;
int y;
} S2D_Mouse;
// S2D_Viewport
typedef struct {
int width;
int height;
int mode;
} S2D_Viewport;
// S2D_Window
typedef struct {
SDL_Window *sdl;
SDL_GLContext glcontext;
const GLubyte *S2D_GL_VENDOR;
const GLubyte *S2D_GL_RENDERER;
const GLubyte *S2D_GL_VERSION;
GLint S2D_GL_MAJOR_VERSION;
GLint S2D_GL_MINOR_VERSION;
const GLubyte *S2D_GL_SHADING_LANGUAGE_VERSION;
const char *title;
int width;
int height;
int orig_width;
int orig_height;
S2D_Viewport viewport;
S2D_Update update;
S2D_Render render;
int flags;
S2D_Mouse mouse;
S2D_On_Key on_key;
S2D_On_Mouse on_mouse;
S2D_On_Controller on_controller;
bool vsync;
int fps_cap;
S2D_Color background;
const char *icon;
Uint32 frames;
Uint32 elapsed_ms;
Uint32 loop_ms;
Uint32 delay_ms;
double fps;
bool close;
} S2D_Window;
// S2D_Image
typedef struct {
const char *path;
SDL_Surface *surface;
int format;
GLuint texture_id;
S2D_Color color;
int x;
int y;
int width;
int height;
int orig_width;
int orig_height;
GLfloat rotate; // Rotation angle in degrees
GLfloat rx; // X coordinate to be rotated around
GLfloat ry; // Y coordinate to be rotated around
} S2D_Image;
// S2D_Sprite
typedef struct {
const char *path;
S2D_Image *img;
S2D_Color color;
int x;
int y;
int width;
int height;
int clip_width;
int clip_height;
GLfloat rotate; // Rotation angle in degrees
GLfloat rx; // X coordinate to be rotated around
GLfloat ry; // Y coordinate to be rotated around
GLfloat tx1;
GLfloat ty1;
GLfloat tx2;
GLfloat ty2;
GLfloat tx3;
GLfloat ty3;
GLfloat tx4;
GLfloat ty4;
} S2D_Sprite;
// S2D_Text
typedef struct {
const char *font;
SDL_Surface *surface;
GLuint texture_id;
TTF_Font *font_data;
S2D_Color color;
char *msg;
int x;
int y;
int width;
int height;
GLfloat rotate; // Rotation angle in degrees
GLfloat rx; // X coordinate to be rotated around
GLfloat ry; // Y coordinate to be rotated around
} S2D_Text;
// S2D_Sound
typedef struct {
const char *path;
Mix_Chunk *data;
} S2D_Sound;
// S2D_Music
typedef struct {
const char *path;
Mix_Music *data;
} S2D_Music;
// Simple 2D Functions /////////////////////////////////////////////////////////
/*
* Checks if a file exists and can be accessed
*/
bool S2D_FileExists(const char *path);
/*
* Logs standard messages to the console
*/
void S2D_Log(int type, const char *msg, ...);
/*
* Logs Simple 2D errors to the console, with caller and message body
*/
void S2D_Error(const char *caller, const char *msg, ...);
/*
* Enable/disable logging of diagnostics
*/
void S2D_Diagnostics(bool status);
/*
* Enable terminal colors in Windows
*/
void S2D_Windows_EnableTerminalColors();
/*
* Initialize Simple 2D subsystems
*/
bool S2D_Init();
/*
* Gets the primary display's dimentions
*/
void S2D_GetDisplayDimensions(int *w, int *h);
/*
* Quits Simple 2D subsystems
*/
void S2D_Quit(void);
// Shapes //////////////////////////////////////////////////////////////////////
/*
* Rotate a point around a given point
* Params:
* p The point to rotate
* angle The angle in degrees
* rx The x coordinate to rotate around
* ry The y coordinate to rotate around
*/
S2D_GL_Point S2D_RotatePoint(S2D_GL_Point p, GLfloat angle, GLfloat rx, GLfloat ry);
/*
* Get the point to be rotated around given a position in a rectangle
*/
S2D_GL_Point S2D_GetRectRotationPoint(int x, int y, int w, int h, int position);
/*
* Draw a triangle
*/
void S2D_DrawTriangle(
GLfloat x1, GLfloat y1,
GLfloat r1, GLfloat g1, GLfloat b1, GLfloat a1,
GLfloat x2, GLfloat y2,
GLfloat r2, GLfloat g2, GLfloat b2, GLfloat a2,
GLfloat x3, GLfloat y3,
GLfloat r3, GLfloat g3, GLfloat b3, GLfloat a3
);
/*
* Draw a quad, using two triangles
*/
void S2D_DrawQuad(
GLfloat x1, GLfloat y1,
GLfloat r1, GLfloat g1, GLfloat b1, GLfloat a1,
GLfloat x2, GLfloat y2,
GLfloat r2, GLfloat g2, GLfloat b2, GLfloat a2,
GLfloat x3, GLfloat y3,
GLfloat r3, GLfloat g3, GLfloat b3, GLfloat a3,
GLfloat x4, GLfloat y4,
GLfloat r4, GLfloat g4, GLfloat b4, GLfloat a4
);
/*
* Draw a line from a quad
*/
void S2D_DrawLine(
GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2,
GLfloat width,
GLfloat r1, GLfloat g1, GLfloat b1, GLfloat a1,
GLfloat r2, GLfloat g2, GLfloat b2, GLfloat a2,
GLfloat r3, GLfloat g3, GLfloat b3, GLfloat a3,
GLfloat r4, GLfloat g4, GLfloat b4, GLfloat a4
);
/*
* Draw a circle from triangles
*/
void S2D_DrawCircle(
GLfloat x, GLfloat y, GLfloat radius, int sectors,
GLfloat r, GLfloat g, GLfloat b, GLfloat a
);
// Image ///////////////////////////////////////////////////////////////////////
/*
* Create an image, given a file path
*/
S2D_Image *S2D_CreateImage(const char *path);
/*
* Rotate an image
*/
void S2D_RotateImage(S2D_Image *img, GLfloat angle, int position);
/*
* Draw an image
*/
void S2D_DrawImage(S2D_Image *img);
/*
* Free an image
*/
void S2D_FreeImage(S2D_Image *img);
// Sprite //////////////////////////////////////////////////////////////////////
/*
* Create a sprite, given an image file path
*/
S2D_Sprite *S2D_CreateSprite(const char *path);
/*
* Clip a sprite
*/
void S2D_ClipSprite(S2D_Sprite *spr, int x, int y, int w, int h);
/*
* Rotate a sprite
*/
void S2D_RotateSprite(S2D_Sprite *spr, GLfloat angle, int position);
/*
* Draw a sprite
*/
void S2D_DrawSprite(S2D_Sprite *spr);
/*
* Free a sprite
*/
void S2D_FreeSprite(S2D_Sprite *spr);
// Text ////////////////////////////////////////////////////////////////////////
/*
* Create text, given a font file path, the message, and size
*/
S2D_Text *S2D_CreateText(const char *font, const char *msg, int size);
/*
* Set the text message
*/
void S2D_SetText(S2D_Text *txt, const char *msg, ...);
/*
* Rotate text
*/
void S2D_RotateText(S2D_Text *txt, GLfloat angle, int position);
/*
* Draw text
*/
void S2D_DrawText(S2D_Text *txt);
/*
* Free the text
*/
void S2D_FreeText(S2D_Text *txt);
// Sound ///////////////////////////////////////////////////////////////////////
/*
* Create a sound, given an audio file path
*/
S2D_Sound *S2D_CreateSound(const char *path);
/*
* Play the sound
*/
void S2D_PlaySound(S2D_Sound *snd);
/*
* Free the sound
*/
void S2D_FreeSound(S2D_Sound *snd);
// Music ///////////////////////////////////////////////////////////////////////
/*
* Create the music, given an audio file path
*/
S2D_Music *S2D_CreateMusic(const char *path);
/*
* Play the music
*/
void S2D_PlayMusic(S2D_Music *mus, bool loop);
/*
* Pause the playing music
*/
void S2D_PauseMusic();
/*
* Resume the current music
*/
void S2D_ResumeMusic();
/*
* Stop the playing music; interrupts fader effects
*/
void S2D_StopMusic();
/*
* Get the music volume
*/
int S2D_GetMusicVolume();
/*
* Set the music volume a given percentage
*/
void S2D_SetMusicVolume(int volume);
/*
* Fade out the playing music
*/
void S2D_FadeOutMusic(int ms);
/*
* Free the music
*/
void S2D_FreeMusic(S2D_Music *mus);
// Input ///////////////////////////////////////////////////////////////////////
/*
* Get the mouse coordinates relative to the viewport
*/
void S2D_GetMouseOnViewport(S2D_Window *window, int wx, int wy, int *x, int *y);
/*
* Show the cursor over the window
*/
void S2D_ShowCursor();
/*
* Hide the cursor over the window
*/
void S2D_HideCursor();
// Controllers /////////////////////////////////////////////////////////////////
/*
* Add controller mapping from string
*/
void S2D_AddControllerMapping(const char *map);
/*
* Load controller mappings from the specified file
*/
void S2D_AddControllerMappingsFromFile(const char *path);
/*
* Check if joystick is a controller
*/
bool S2D_IsController(SDL_JoystickID id);
/*
* Open controllers and joysticks
*/
void S2D_OpenControllers();
// Window //////////////////////////////////////////////////////////////////////
/*
* Create a window
*/
S2D_Window *S2D_CreateWindow(
const char *title, int width, int height, S2D_Update, S2D_Render, int flags
);
/*
* Show the window
*/
int S2D_Show(S2D_Window *window);
/*
* Set the icon for the window
*/
void S2D_SetIcon(S2D_Window *window, const char *icon);
/*
* Take a screenshot of the window
*/
void S2D_Screenshot(S2D_Window *window, const char *path);
/*
* Close the window
*/
int S2D_Close(S2D_Window *window);
/*
* Free all resources
*/
int S2D_FreeWindow(S2D_Window *window);
// Simple 2D OpenGL Functions //////////////////////////////////////////////////
int S2D_GL_Init(S2D_Window *window);
void S2D_GL_PrintError(char *error);
void S2D_GL_PrintContextInfo(S2D_Window *window);
void S2D_GL_StoreContextInfo(S2D_Window *window);
GLuint S2D_GL_LoadShader(GLenum type, const GLchar *shaderSrc, char *shaderName);
int S2D_GL_CheckLinked(GLuint program, char *name);
void S2D_GL_GetViewportScale(S2D_Window *window, int *w, int *h, double *scale);
void S2D_GL_SetViewport(S2D_Window *window);
void S2D_GL_CreateTexture(
GLuint *id, GLint format,
int w, int h,
const GLvoid *data, GLint filter);
void S2D_GL_DrawTriangle(
GLfloat x1, GLfloat y1,
GLfloat r1, GLfloat g1, GLfloat b1, GLfloat a1,
GLfloat x2, GLfloat y2,
GLfloat r2, GLfloat g2, GLfloat b2, GLfloat a2,
GLfloat x3, GLfloat y3,
GLfloat r3, GLfloat g3, GLfloat b3, GLfloat a3);
void S2D_GL_DrawImage(S2D_Image *img);
void S2D_GL_DrawSprite(S2D_Sprite *spr);
void S2D_GL_DrawText(S2D_Text *txt);
void S2D_GL_FreeTexture(GLuint *id);
void S2D_GL_Clear(S2D_Color clr);
// OpenGL & GLES Internal Functions ////////////////////////////////////////////
#if GLES
int S2D_GLES_Init();
void S2D_GLES_ApplyProjection(GLfloat orthoMatrix[16]);
void S2D_GLES_DrawTriangle(
GLfloat x1, GLfloat y1,
GLfloat r1, GLfloat g1, GLfloat b1, GLfloat a1,
GLfloat x2, GLfloat y2,
GLfloat r2, GLfloat g2, GLfloat b2, GLfloat a2,
GLfloat x3, GLfloat y3,
GLfloat r3, GLfloat g3, GLfloat b3, GLfloat a3);
void S2D_GLES_DrawImage(S2D_Image *img);
void S2D_GLES_DrawSprite(S2D_Sprite *spr);
void S2D_GLES_DrawText(S2D_Text *txt);
#else
int S2D_GL2_Init();
int S2D_GL3_Init();
void S2D_GL2_ApplyProjection(int w, int h);
void S2D_GL3_ApplyProjection(GLfloat orthoMatrix[16]);
void S2D_GL2_DrawTriangle(
GLfloat x1, GLfloat y1,
GLfloat r1, GLfloat g1, GLfloat b1, GLfloat a1,
GLfloat x2, GLfloat y2,
GLfloat r2, GLfloat g2, GLfloat b2, GLfloat a2,
GLfloat x3, GLfloat y3,
GLfloat r3, GLfloat g3, GLfloat b3, GLfloat a3);
void S2D_GL3_DrawTriangle(
GLfloat x1, GLfloat y1,
GLfloat r1, GLfloat g1, GLfloat b1, GLfloat a1,
GLfloat x2, GLfloat y2,
GLfloat r2, GLfloat g2, GLfloat b2, GLfloat a2,
GLfloat x3, GLfloat y3,
GLfloat r3, GLfloat g3, GLfloat b3, GLfloat a3);
void S2D_GL2_DrawImage(S2D_Image *img);
void S2D_GL3_DrawImage(S2D_Image *img);
void S2D_GL2_DrawSprite(S2D_Sprite *spr);
void S2D_GL3_DrawSprite(S2D_Sprite *spr);
void S2D_GL2_DrawText(S2D_Text *txt);
void S2D_GL3_DrawText(S2D_Text *txt);
#endif
#ifdef __cplusplus
}
#endif