Gel2D - The free/open source game creation suite

gelNamespace.h
Go to the documentation of this file.
00001 /*
00002 Gel2D Game Engine - Cross-platform 2D gaming middleware
00003 Copyright (C) 2010-2011 Mark D. Procarione
00004 
00005 Gel2D is free software: you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation, either version 3 of the License, or
00008 (at your option) any later version.
00009 
00010 Gel2D is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013 GNU General Public License for more details.
00014 */
00015 
00016 #ifndef __GELNAMESPACE_H__
00017 #define __GELNAMESPACE_H__
00018 
00019 #include "gel.h"
00020 
00107 
00108 namespace gel
00109 {
00110     // Gel2D callback prototypes
00111     typedef void (*GelCallback)();
00112     typedef bool (*GelCallbackB)();
00113 
00114     // Custom type definitions
00115     typedef signed char         GELbyte;        // 1-byte signed
00116     typedef unsigned char   GELubyte;   // 1-byte unsigned      (BYTE)
00117     typedef unsigned short      GELushort;      // 2-byte unsigned      (WORD)
00118     typedef unsigned int    GELuint;    // 4-byte unsigned
00119     typedef unsigned long       GELulong;       // 4-byte unsigned      (DWORD)
00120 
00121     typedef GELulong    GELDWORD;
00122 
00124     typedef GELDWORD GELCOLOR;
00125 
00126         enum Alignment {
00127                 GEL_ALIGN_LEFT = 0x01,
00128                 GEL_ALIGN_CENTER = 0x02,
00129                 GEL_ALIGN_RIGHT = 0x03
00130         };
00131 
00132         enum Orientation {
00133                 GEL_HORIZONTAL = 0x01,
00134                 GEL_VERTICAL = 0x02
00135         };
00136 
00137         enum Interpolation {
00138                 GEL_IM_CONSTANT,
00139                 GEL_IM_LINEAR,
00140                 GEL_IM_BEZIER,
00141         };
00142 
00143         enum Relations {
00144                 GEL_ABSOLUTE = 0x01,
00145                 GEL_RELATIVE = 0x02
00146         };
00147 
00148         enum BlendMode {
00149                 GEL_BLEND_ALPHA = 0,
00150                 GEL_BLEND_ADD = 1,
00151                 GEL_BLEND_SUB = 2,
00152                 GEL_BLEND_DIFF = 3,
00153                 GEL_BLEND_SCREEN = 4,
00154                 GEL_BLEND_CLIP = 5
00155         };
00156 
00157         enum ImageType {
00158                 IMG_PNG,
00159                 IMG_TGA
00160         };
00161 
00162         enum PlayState {
00163                 GEL_STOP = 0,
00164                 GEL_PLAY = 1,
00165                 GEL_PAUSE = 3
00166         };
00167 
00168         enum PlayMode {
00169                 GEL_FWD = 0,
00170                 GEL_REV = 1,
00171                 GEL_PLAYSTOP = 0,
00172                 GEL_LOOP = 2,
00173                 GEL_PINGPONG = 4,
00174                 GEL_FLIPPER = 8
00175         };
00176 
00177         enum KeyState {
00178                 GEL_RELEASE = 0,
00179                 GEL_PRESS = 1
00180         };
00181 
00182         enum CollisionBounds {
00183                 GEL_BOUNDS_ALIGNED_BOX,
00184                 GEL_BOUNDS_ORIENTED_BOX,
00185                 GEL_BOUNDS_CIRCLE
00186         };
00187 
00188         enum CheckState {
00189                 GEL_UNCHECKED,
00190                 GEL_SEMICHECKED,
00191                 GEL_CHECKED
00192         };
00193 
00194         enum TextureFilter {
00195                 GEL_NEAREST,
00196                 GEL_LINEAR
00197         };
00198 
00199         enum TextureWrap {
00200                 GEL_REPEAT,
00201                 GEL_NO_REPEAT,
00202                 GEL_CLAMP
00203         };
00204 
00205         enum TextureFunction {
00206             GEL_DECAL,
00207                 GEL_MODULATE,
00208                 GEL_REPLACE
00209         };
00210 
00211         enum ColorMode {
00212                 GEL_RGB,
00213                 GEL_RGBA,
00214                 GEL_LUMINANCE,
00215                 GEL_LUMINANCE_ALPHA
00216         };
00217 
00218     enum LineMode {
00219                 GEL_LINES,
00220                 GEL_LINE_LOOP,
00221                 GEL_LINE_STRIP
00222         };
00223 
00224         enum RenderAPI {
00225             NullAPI,  
00226                 OpenGL,   
00227                 DirectX9, 
00228                 GelSR     
00229         };
00230 
00231         enum WindowMode {
00232                 GEL_WINDOWED,
00233                 GEL_FULLSCREEN,
00234                 GEL_DYNAMIC // Use for that *special* mode :)
00235         };
00236 
00237         enum WindowParam {
00238                 GEL_WND_OPEN,
00239                 GEL_WND_ACTIVE,
00240                 GEL_WND_ICONIFIED,
00241                 GEL_WND_FULLSCREEN
00242         };
00243 
00244     enum WindowStyle {
00245                 GEL_WND_SIZE = 0x40000,
00246         GEL_WND_MAX = 0x10000,
00247         GEL_WND_MIN = 0x20000
00248         };
00249 
00250     enum PowerSource {
00251                 PowerAC,
00252                 PowerACBackup,
00253                 PowerBattery,
00254                 PowerUnknown
00255         };
00256 
00257     enum BatteryStatus {
00258                 BatteryHigh,
00259                 BatteryLow,
00260                 BatteryCritical,
00261                 BatteryCharging,
00262                 BatteryNone,
00263                 BatteryUnknown
00264         };
00265 
00266     enum EventType {
00267         WindowClose,
00268         WindowResize,
00269         FocusInEvent,
00270         FocusOutEvent,
00271         KeyPressed,
00272         KeyReleased,
00273         MouseButtonPress,
00274         MouseButtonRelease,
00275         MouseButtonDblClick,
00276         MouseWheel,
00277         MouseMove
00278         };
00279 
00280     enum SysCursorShape {
00281         GEL_CURSOR_ARROW,
00282         GEL_CURSOR_BUSY,
00283         GEL_CURSOR_CROSS,
00284         GEL_CURSOR_HAND,
00285         GEL_CURSOR_HELP,
00286         GEL_CURSOR_IBEAM,
00287         GEL_CURSOR_NO,
00288         GEL_CURSOR_SIZEALL,
00289         GEL_CURSOR_SIZEVER,
00290         GEL_CURSOR_SIZEHOR,
00291         GEL_CURSOR_SIZERDIAG,
00292         GEL_CURSOR_SIZELDIAG,
00293         GEL_CURSOR_UPARROW,
00294         GEL_CURSOR_WAIT
00295         //GEL_CURSOR_OPENHAND,
00296         //GEL_CURSOR_CLOSEHAND,
00297         //GEL_CURSOR_VSPLITTER,
00298         //GEL_CURSOR_HSPLITTER,
00299     };
00300 
00301         enum DataSeek {
00302                 GEL_SEEK_START,
00303                 GEL_SEEK_CUR,
00304                 GEL_SEEK_END
00305         };
00306 
00307         enum FileMode {
00308                 GEL_FILE_READ,
00309                 GEL_FILE_WRITE,
00310                 GEL_FILE_READ_WRITE,
00311                 GEL_FILE_APPEND,
00312                 GEL_FILE_READ_APPEND
00313         };
00314 
00316         enum Key {
00317                 GEL_KEY_0 = 0x30,
00318                 GEL_KEY_1 = 0x31,
00319                 GEL_KEY_2 = 0x32,
00320                 GEL_KEY_3 = 0x33,
00321                 GEL_KEY_4 = 0x34,
00322                 GEL_KEY_5 = 0x35,
00323                 GEL_KEY_6 = 0x36,
00324                 GEL_KEY_7 = 0x37,
00325                 GEL_KEY_8 = 0x38,
00326                 GEL_KEY_9 = 0x39,
00327 
00328                 GEL_KEY_A = 0x41,
00329                 GEL_KEY_B = 0x42,
00330                 GEL_KEY_C = 0x43,
00331                 GEL_KEY_D = 0x44,
00332                 GEL_KEY_E = 0x45,
00333                 GEL_KEY_F = 0x46,
00334                 GEL_KEY_G = 0x47,
00335                 GEL_KEY_H = 0x48,
00336                 GEL_KEY_I = 0x49,
00337                 GEL_KEY_J = 0x4a,
00338                 GEL_KEY_K = 0x4b,
00339                 GEL_KEY_L = 0x4c,
00340                 GEL_KEY_M = 0x4d,
00341                 GEL_KEY_N = 0x4e,
00342                 GEL_KEY_O = 0x4f,
00343                 GEL_KEY_P = 0x50,
00344                 GEL_KEY_Q = 0x51,
00345                 GEL_KEY_R = 0x52,
00346                 GEL_KEY_S = 0x53,
00347                 GEL_KEY_T = 0x54,
00348                 GEL_KEY_U = 0x55,
00349                 GEL_KEY_V = 0x56,
00350                 GEL_KEY_W = 0x57,
00351                 GEL_KEY_X = 0x58,
00352                 GEL_KEY_Y = 0x59,
00353                 GEL_KEY_Z = 0x5a,
00354 
00355                 GEL_KEY_MINUS =         0x2d,
00356                 GEL_KEY_EQUAL =         0x3d,
00357 
00358                 GEL_KEY_LBRACKET =      0x5b,
00359                 GEL_KEY_RBRACKET =      0x5d,
00360                 GEL_KEY_BACKSLASH =     0x5c,
00361 
00362                 GEL_KEY_SEMICOLON =     0x3b,
00363                 GEL_KEY_APOSTROPHE =0x27,
00364 
00365                 GEL_KEY_COMMA =         0x2c,
00366                 GEL_KEY_PERIOD =        0x2e,
00367                 GEL_KEY_SLASH =         0x2f,
00368 
00369                 GEL_KEY_TILDE =         0x60,
00370 
00371                 GEL_KEY_UNKNOWN =       -1,
00372                 GEL_KEY_SPACE =         32,
00373                 GEL_KEY_SPECIAL =       256,
00374 
00375                 GEL_KEY_ESC =   GEL_KEY_SPECIAL+1,
00376 
00377                 GEL_KEY_F1 =    GEL_KEY_SPECIAL+2,
00378                 GEL_KEY_F2 =    GEL_KEY_SPECIAL+3,
00379                 GEL_KEY_F3 =    GEL_KEY_SPECIAL+4,
00380                 GEL_KEY_F4 =    GEL_KEY_SPECIAL+5,
00381                 GEL_KEY_F5 =    GEL_KEY_SPECIAL+6,
00382                 GEL_KEY_F6 =    GEL_KEY_SPECIAL+7,
00383                 GEL_KEY_F7 =    GEL_KEY_SPECIAL+8,
00384                 GEL_KEY_F8 =    GEL_KEY_SPECIAL+9,
00385                 GEL_KEY_F9 =    GEL_KEY_SPECIAL+10,
00386                 GEL_KEY_F10 =   GEL_KEY_SPECIAL+11,
00387                 GEL_KEY_F11 =   GEL_KEY_SPECIAL+12,
00388                 GEL_KEY_F12 =   GEL_KEY_SPECIAL+13,
00389                 GEL_KEY_F13 =   GEL_KEY_SPECIAL+14,
00390                 GEL_KEY_F14 =   GEL_KEY_SPECIAL+15,
00391                 GEL_KEY_F15 =   GEL_KEY_SPECIAL+16,
00392                 GEL_KEY_F16 =   GEL_KEY_SPECIAL+17,
00393                 GEL_KEY_F17 =   GEL_KEY_SPECIAL+18,
00394                 GEL_KEY_F18 =   GEL_KEY_SPECIAL+19,
00395                 GEL_KEY_F19 =   GEL_KEY_SPECIAL+20,
00396                 GEL_KEY_F20 =   GEL_KEY_SPECIAL+21,
00397                 GEL_KEY_F21 =   GEL_KEY_SPECIAL+22,
00398                 GEL_KEY_F22 =   GEL_KEY_SPECIAL+23,
00399                 GEL_KEY_F23 =   GEL_KEY_SPECIAL+24,
00400                 GEL_KEY_F24 =   GEL_KEY_SPECIAL+25,
00401                 // 25 - 35 only on X11
00402                 //GEL_KEY_F25 = GEL_KEY_SPECIAL+26,
00403 
00404                 GEL_KEY_UP =    GEL_KEY_SPECIAL+27,
00405                 GEL_KEY_DOWN =  GEL_KEY_SPECIAL+28,
00406                 GEL_KEY_LEFT =  GEL_KEY_SPECIAL+29,
00407                 GEL_KEY_RIGHT = GEL_KEY_SPECIAL+30,
00408 
00409                 GEL_KEY_LSHIFT =        GEL_KEY_SPECIAL+31,
00410                 GEL_KEY_RSHIFT =        GEL_KEY_SPECIAL+32,
00411                 GEL_KEY_LCTRL =         GEL_KEY_SPECIAL+33,
00412                 GEL_KEY_RCTRL =         GEL_KEY_SPECIAL+34,
00413                 GEL_KEY_LALT =          GEL_KEY_SPECIAL+35,
00414                 GEL_KEY_RALT =          GEL_KEY_SPECIAL+36,
00415 
00416                 GEL_KEY_TAB =           GEL_KEY_SPECIAL+37,
00417                 GEL_KEY_ENTER =         GEL_KEY_SPECIAL+38,
00418                 GEL_KEY_BACKSPACE =     GEL_KEY_SPECIAL+39,
00419 
00420                 GEL_KEY_INSERT =        GEL_KEY_SPECIAL+40,
00421                 GEL_KEY_DEL =           GEL_KEY_SPECIAL+41,
00422                 GEL_KEY_PAGEUP =        GEL_KEY_SPECIAL+42,
00423                 GEL_KEY_PAGEDOWN =      GEL_KEY_SPECIAL+43,
00424                 GEL_KEY_HOME =          GEL_KEY_SPECIAL+44,
00425                 GEL_KEY_END =           GEL_KEY_SPECIAL+45,
00426 
00427                 GEL_KEY_NUMPAD0 =       GEL_KEY_SPECIAL+46,
00428                 GEL_KEY_NUMPAD1 =       GEL_KEY_SPECIAL+47,
00429                 GEL_KEY_NUMPAD2 =       GEL_KEY_SPECIAL+48,
00430                 GEL_KEY_NUMPAD3 =       GEL_KEY_SPECIAL+49,
00431                 GEL_KEY_NUMPAD4 =       GEL_KEY_SPECIAL+50,
00432                 GEL_KEY_NUMPAD5 =       GEL_KEY_SPECIAL+51,
00433                 GEL_KEY_NUMPAD6 =       GEL_KEY_SPECIAL+52,
00434                 GEL_KEY_NUMPAD7 =       GEL_KEY_SPECIAL+53,
00435                 GEL_KEY_NUMPAD8 =       GEL_KEY_SPECIAL+54,
00436                 GEL_KEY_NUMPAD9 =       GEL_KEY_SPECIAL+55,
00437 
00438                 GEL_KEY_KP_DIVIDE =             GEL_KEY_SPECIAL+56,
00439                 GEL_KEY_KP_MULTIPLY =   GEL_KEY_SPECIAL+57,
00440                 GEL_KEY_KP_SUBTRACT =   GEL_KEY_SPECIAL+58,
00441                 GEL_KEY_KP_ADD =                GEL_KEY_SPECIAL+59,
00442                 GEL_KEY_KP_DECIMAL =    GEL_KEY_SPECIAL+60,
00443                 GEL_KEY_KP_EQUAL =              GEL_KEY_SPECIAL+61,
00444                 GEL_KEY_KP_ENTER =              GEL_KEY_SPECIAL+62,
00445 
00446                 GEL_KEY_NUMLOCK =               GEL_KEY_SPECIAL+63,
00447                 GEL_KEY_CAPSLOCK =              GEL_KEY_SPECIAL+64,
00448                 GEL_KEY_SCROLLLOCK =    GEL_KEY_SPECIAL+65,
00449 
00450                 GEL_KEY_PAUSE =         GEL_KEY_SPECIAL+66,
00451                 GEL_KEY_PRINT =         GEL_KEY_SPECIAL+67,
00452                 GEL_KEY_LSUPER =        GEL_KEY_SPECIAL+68,
00453                 GEL_KEY_RSUPER =        GEL_KEY_SPECIAL+69,
00454                 GEL_KEY_MENU =          GEL_KEY_SPECIAL+70,
00455 
00456                 GEL_KEY_VOL_MUTE =      GEL_KEY_SPECIAL+71,
00457                 GEL_KEY_VOL_DOWN =      GEL_KEY_SPECIAL+72,
00458                 GEL_KEY_VOL_UP =        GEL_KEY_SPECIAL+73,
00459 
00460                 GEL_KEY_ANY =   GEL_KEY_SPECIAL+74,
00461                 GEL_KEY_LAST =  GEL_KEY_ANY
00462         };
00463 
00464     enum KeyModifier {
00465         ShiftModifier = 0x02,
00466         CtrlModifier = 0x04,
00467         AltModifier = 0x08
00468     };
00469 
00471         enum MouseBtn {
00472                 GEL_MB_LEFT = 0,
00473                 GEL_MB_RIGHT = 1,
00474                 GEL_MB_MIDDLE = 2,
00475                 GEL_MB_L_DBLCLK = 3, 
00476                 GEL_MB_R_DBLCLK = 4, 
00477                 GEL_MB_M_DBLCLK = 5, 
00478                 GEL_MB_LAST = GEL_MB_M_DBLCLK,
00479                 GEL_MB_NONE
00480         };
00481 
00482     enum MouseButton {
00483         NoButton = 0,
00484                 LeftButton = 0x01,
00485                 RightButton = 0x02,
00486                 MiddleButton = 0x04,
00487                 //GEL_MB_L_DBLCLK = 0x06, //!< (Windows only)
00488                 //GEL_MB_R_DBLCLK = 0x08, //!< (Windows only)
00489                 //GEL_MB_M_DBLCLK = 0x010, //!< (Windows only)
00490                 //GEL_MB_LAST = GEL_MB_M_DBLCLK,
00491 
00492         };
00493 
00494         enum Joystick {
00495                 GEL_JOY_BTN_1 = 0,
00496                 GEL_JOY_BTN_2 = 1,
00497                 GEL_JOY_BTN_3 = 2,
00498                 GEL_JOY_BTN_4 = 3,
00499                 GEL_JOY_BTN_5 = 4,
00500                 GEL_JOY_BTN_6 = 5,
00501                 GEL_JOY_BTN_7 = 6,
00502                 GEL_JOY_BTN_8 = 7,
00503                 GEL_JOY_BTN_9 = 8,
00504                 GEL_JOY_BTN_10 = 9,
00505                 GEL_JOY_BTN_11 = 10,
00506                 GEL_JOY_BTN_12 = 11,
00507                 GEL_JOY_BTN_13 = 12,
00508                 GEL_JOY_BTN_14 = 13,
00509                 GEL_JOY_BTN_15 = 14,
00510                 GEL_JOY_BTN_16 = 15,
00511                 GEL_JOY_BTN_17 = 16,
00512                 GEL_JOY_BTN_18 = 17,
00513 
00514                 GEL_JOY_AXIS_1 = 0,
00515                 GEL_JOY_AXIS_2 = 1,
00516                 GEL_JOY_AXIS_3 = 2,
00517                 GEL_JOY_AXIS_4 = 3,
00518                 GEL_JOY_AXIS_5 = 4,
00519                 GEL_JOY_AXIS_6 = 5,
00520                 GEL_JOY_AXIS_7 = 6,
00521                 GEL_JOY_AXIS_8 = 7,
00522                 GEL_JOY_AXIS_9 = 8,
00523                 GEL_JOY_AXIS_10 = 9,
00524                 GEL_JOY_AXIS_11 = 10,
00525                 GEL_JOY_AXIS_12 = 11,
00526                 GEL_JOY_AXIS_13 = 12,
00527                 GEL_JOY_AXIS_14 = 13,
00528                 GEL_JOY_AXIS_15 = 14,
00529                 GEL_JOY_AXIS_16 = 15,
00530 
00531                 GEL_JOY_AXIS_X = GEL_JOY_AXIS_1,
00532                 GEL_JOY_AXIS_Y = GEL_JOY_AXIS_2,
00533 
00534                 GEL_JOY_HAT_CENTER = 0x00,
00535                 GEL_JOY_HAT_UP = 0x01,
00536                 GEL_JOY_HAT_DOWN = 0x02,
00537                 GEL_JOY_HAT_LEFT = 0x04,
00538                 GEL_JOY_HAT_RIGHT = 0x08,
00539                 GEL_JOY_HAT_RIGHTUP = (GEL_JOY_HAT_RIGHT|GEL_JOY_HAT_UP),
00540                 GEL_JOY_HAT_RIGHTDOWN = (GEL_JOY_HAT_RIGHT|GEL_JOY_HAT_DOWN),
00541                 GEL_JOY_HAT_LEFTUP = (GEL_JOY_HAT_LEFT|GEL_JOY_HAT_UP),
00542                 GEL_JOY_HAT_LEFTDOWN = (GEL_JOY_HAT_LEFT|GEL_JOY_HAT_DOWN),
00543 
00544                 GEL_JOYSTICK_1 = 0,
00545                 GEL_JOYSTICK_2 = 1,
00546                 GEL_JOYSTICK_3 = 2,
00547                 GEL_JOYSTICK_4 = 3,
00548                 GEL_JOYSTICK_5 = 4,
00549                 GEL_JOYSTICK_6 = 5,
00550                 GEL_JOYSTICK_7 = 6,
00551                 GEL_JOYSTICK_8 = 7,
00552                 GEL_JOYSTICK_9 = 8,
00553                 GEL_JOYSTICK_10 = 9,
00554                 GEL_JOYSTICK_11 = 10,
00555                 GEL_JOYSTICK_12 = 11,
00556                 GEL_JOYSTICK_13 = 12,
00557                 GEL_JOYSTICK_14 = 13,
00558                 GEL_JOYSTICK_15 = 14,
00559                 GEL_JOYSTICK_16 = 15
00560         };
00561 }
00562 
00563 #endif // __GELNAMESPACE_H__