summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3a25947)
raw | patch | inline | side by side (parent: 3a25947)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 23 Jun 2018 22:27:53 +0000 (01:27 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 23 Jun 2018 22:29:38 +0000 (01:29 +0300) |
23 files changed:
index 7cedece869ad86196a84b09b7356cedbd0b9078d..c8ab1625a9eb0e2f627d56852e0304a5bf872353 100644 (file)
--- a/README
+++ b/README
If you want SDL_mixer instead of FMOD, add -dUSE_SDLMIXER.
If you want the server to be able to forward ports via UPNP, add -dUSE_MINIUPNPC.
-If you want to debug game with Holmes, add -dENABLE_HOLMES.
+If you want to debug game with Holmes, add -dENABLE_HOLMES (not supported in GLES mode).
+If you want to render graphics using OpenGL ES, add -dUSE_GLES1.
To build a headless (no video/audio, for dedicated servers) executable, add -dHEADLESS.
Replace -O3 with -g -gl to enable debugging features. Run the game with --gdb when using a debugger to
prevent it from eating exceptions.
diff --git a/android/README b/android/README
index de9cb1bab91ac03abe7e57b9357b7afb63e6385e..b10d352fa604c729e6b7e63aed1fe7d93a01edc7 100644 (file)
--- a/android/README
+++ b/android/README
* FPC >= 3.0.4;
* SDL >= 2.0.7;
* SDL_mixer >= 2.0;
-* libenet >= 1.3.13;
-* nanoGL.
+* libenet >= 1.3.13.
-D2DF uses special version of nanoGL ( https://github.com/DeaDDooMER/nanogl ) with some added functions.
Build all shared libraries using NDK toolchain and put into directory ./ass/lib/armeabi-v7a/.
Also you need to build FPC crosscompiler ( http://wiki.freepascal.org/Android ).
Put game resources into direcotor resources/ (or install it manually into external/internal storage).
mkdir -p tmp
cd ../src/game
ppcrossarm \
- -g -gl -dUSE_SDLMIXER -dUSE_NANOGL -O3 \
+ -g -gl -dUSE_SDLMIXER -dUSE_GLES1 -O3 \
-Tandroid \
-Cparmv7a \
-Cfvfpv3 \
index c5ec8f36e94baae90f47ca21bbd20d32416a36d9..d0f967230f0c31c94f7e575f926414ed9927bc72 100644 (file)
interface
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL, GLExt,
-{$ENDIF}
+ {$INCLUDE ../nogl/noGLuses.inc}
SysUtils, Classes, Math, e_log, e_texture, SDL2, MAPDEF, ImagingTypes, Imaging, ImagingUtility;
type
with e_TextureFonts[id] do
begin
-{$IF not DEFINED(USE_NANOGL)}
+{$IF not DEFINED(USE_NANOGL) and not DEFINED(USE_NOGL)}
Base := glGenLists(XCount*YCount);
{$ENDIF}
TextureID := e_Textures[Tex].tx.id;
SPC := Space;
end;
-{$IF not DEFINED(USE_NANOGL)}
+{$IF not DEFINED(USE_NANOGL) and not DEFINED(USE_NOGL)}
glBindTexture(GL_TEXTURE_2D, e_Textures[Tex].tx.id);
for loop1 := 0 to XCount*YCount-1 do
begin
procedure e_TextureFontKill(FontID: DWORD);
begin
if e_NoGraphics then Exit;
-{$IF not DEFINED(USE_NANOGL)}
+{$IF not DEFINED(USE_NANOGL) and not DEFINED(USE_NOGL)}
glDeleteLists(e_TextureFonts[FontID].Base, 256);
{$ENDIF}
e_TextureFonts[FontID].Base := 0;
end;
-{$IFDEF USE_NANOGL}
+{$IF DEFINED(USE_NANOGL) or DEFINED(USE_NOGL)}
procedure e_TextureFontDrawChar(ch: Char; FontID: DWORD);
var
index: Integer;
glBindTexture(GL_TEXTURE_2D, e_TextureFonts[FontID].TextureID);
glEnable(GL_TEXTURE_2D);
glTranslatef(x, y, 0);
-{$IFDEF USE_NANOGL}
+{$IF DEFINED(USE_NANOGL) or DEFINED(USE_NOGL)}
e_TextureFontDrawString(Text, FontID);
{$ELSE}
glListBase(DWORD(Integer(e_TextureFonts[FontID].Base)-32));
begin
glColor4ub(0, 0, 0, 128);
glTranslatef(X+1, Y+1, 0);
-{$IFDEF USE_NANOGL}
+{$IF DEFINED(USE_NANOGL) or DEFINED(USE_NOGL)}
e_TextureFontDrawChar(Ch, FontID);
{$ELSE}
glCallLists(1, GL_UNSIGNED_BYTE, @Ch);
glColor4ub(e_Colors.R, e_Colors.G, e_Colors.B, 255);
glTranslatef(X, Y, 0);
-{$IFDEF USE_NANOGL}
+{$IF DEFINED(USE_NANOGL) or DEFINED(USE_NOGL)}
e_TextureFontDrawChar(Ch, FontID);
{$ELSE}
glCallLists(1, GL_UNSIGNED_BYTE, @Ch);
glBindTexture(GL_TEXTURE_2D, e_TextureFonts[FontID].TextureID);
glEnable(GL_TEXTURE_2D);
-{$IF not DEFINED(USE_NANOGL)}
+{$IF not DEFINED(USE_NANOGL) and not DEFINED(USE_NOGL)}
glListBase(DWORD(Integer(e_TextureFonts[FontID].Base)-32));
{$ENDIF}
glBindTexture(GL_TEXTURE_2D, e_TextureFonts[FontID].TextureID);
glEnable(GL_TEXTURE_2D);
-{$IF not DEFINED(USE_NANOGL)}
+{$IF not DEFINED(USE_NANOGL) and not DEFINED(USE_NOGL)}
glListBase(DWORD(Integer(e_TextureFonts[FontID].Base)-32));
{$ENDIF}
glColor4ub(0, 0, 0, 128);
glTranslatef(x+1, y+1, 0);
glScalef(Scale, Scale, 0);
-{$IFDEF USE_NANOGL}
+{$IF DEFINED(USE_NANOGL) or DEFINED(USE_NOGL)}
e_TextureFontDrawString(Text, FontID);
{$ELSE}
glCallLists(Length(Text), GL_UNSIGNED_BYTE, PChar(Text));
glColor4ub(Red, Green, Blue, 255);
glTranslatef(x, y, 0);
glScalef(Scale, Scale, 0);
-{$IFDEF USE_NANOGL}
+{$IF DEFINED(USE_NANOGL) or DEFINED(USE_NOGL)}
e_TextureFontDrawString(Text, FontID);
{$ELSE}
glCallLists(Length(Text), GL_UNSIGNED_BYTE, PChar(Text));
for i := 0 to High(e_TextureFonts) do
if e_TextureFonts[i].Base <> 0 then
begin
-{$IFNDEF USE_NANOGL}
+{$IF not DEFINED(USE_NANOGL) and not DEFINED(USE_NOGL)}
glDeleteLists(e_TextureFonts[i].Base, 256);
{$ENDIF}
e_TextureFonts[i].Base := 0;
index c99d4eb3c070a626230b842232744487eec605dd..e4ffca316d70101e641265c4ac13eeb2f9a9f228 100644 (file)
--- a/src/engine/e_texture.pas
+++ b/src/engine/e_texture.pas
interface
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL, GLExt,
-{$ENDIF}
- SysUtils, e_log,
- ImagingTypes, Imaging, ImagingUtility;
+ {$INCLUDE ../nogl/noGLuses.inc}
+ SysUtils, e_log, ImagingTypes, Imaging, ImagingUtility;
type
GLTexture = record
index d38669972b47769f7e56636a87ac0d648fcd4680..a226deee0cc7175a2a7d7ddafadae3e1229d8992 100644 (file)
interface
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL, GLExt,
-{$ENDIF}
+ {$INCLUDE ../nogl/noGLuses.inc}
SysUtils, Classes,
SDL2,
sdlcarcass,
index 4bd2a6b135bb91dbd9c57dea5d86689fa3b83b94..26bea1f40bd55dee87e093fba95bb116d00f23a7 100644 (file)
uses
SysUtils, Classes,
- {$IFDEF USE_NANOGL}
- nanoGL,
- {$ELSE}
- GL, GLExt,
- {$ENDIF}
+ {$INCLUDE ../nogl/noGLuses.inc}
{$IF DEFINED(LINUX) OR DEFINED(ANDROID)}
unixtype, linux
{$ELSEIF DEFINED(WINDOWS)}
diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr
index 91fd3a6276cf4a7778f5322d5616a1107ea3124a..3c3c94a706a5f93a11c0733af44340fe056bf4cc 100644 (file)
--- a/src/game/Doom2DF.lpr
+++ b/src/game/Doom2DF.lpr
conbuf in '../shared/conbuf.pas',
geom in '../shared/geom.pas',
math,
-{$IFDEF USE_NANOGL}
- nanoGL in '../lib/nanogl/nanoGL.pas',
-{$ELSE}
- GL,
- GLExt,
-{$ENDIF}
+
+{$INCLUDE ../nogl/noGLuses.inc}
+
{$IFDEF USE_MINIUPNPC}
miniupnpc in '../lib/miniupnpc/miniupnpc.pas',
{$ENDIF}
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 83da6868652f16de51be42ce2b2026d4e117e383..bb112696f83a22627358153f194e37ab0719d729 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
implementation
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL, GLExt,
-{$ENDIF}
+{$INCLUDE ../nogl/noGLuses.inc}
{$IFDEF ENABLE_HOLMES}
g_holmes,
{$ENDIF}
diff --git a/src/game/g_gfx.pas b/src/game/g_gfx.pas
index df1d3c7590952e9375c783422b56e29efb2027f6..4e9cdd89354dc382ed48437bc452b2f20043cf94 100644 (file)
--- a/src/game/g_gfx.pas
+++ b/src/game/g_gfx.pas
implementation
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL, GLExt,
-{$ENDIF}
+ {$INCLUDE ../nogl/noGLuses.inc}
g_map, g_panel, g_basic, Math, e_graphics,
g_options, g_console, SysUtils, g_triggers, MAPDEF,
g_game, g_language, g_net, utils, xprofiler;
diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas
index 96df55bc44e88dac950b19aee30557de087cf4dd..d50e9a6d7f1e1931c261a95b1178aebefa2dc8a8 100644 (file)
--- a/src/game/g_gui.pas
+++ b/src/game/g_gui.pas
implementation
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL, GLExt,
-{$ENDIF}
+ {$INCLUDE ../nogl/noGLuses.inc}
g_textures, g_sound, SysUtils,
g_game, Math, StrUtils, g_player, g_options,
g_map, g_weapons, xdynrec, wadreader;
diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas
index 83b74acc2ba7c6d00f9cbee483d13832f3adf8b1..96c1c01fe676b667b37f0c14d1746c08c211f448 100644 (file)
--- a/src/game/g_holmes.pas
+++ b/src/game/g_holmes.pas
implementation
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL,
-{$ENDIF}
+ {$INCLUDE ../nogl/noGLuses.inc}
{rttiobj,} typinfo, e_texture,
SysUtils, Classes, SDL2,
MAPDEF, g_main, g_options,
diff --git a/src/game/g_main.pas b/src/game/g_main.pas
index 874907ed63c9598bfe9a9b214617787588b3cb8e..34de5cf99b8397a677492d5bcec19060bf434b7b 100644 (file)
--- a/src/game/g_main.pas
+++ b/src/game/g_main.pas
implementation
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL, GLExt,
-{$ENDIF}
+{$INCLUDE ../nogl/noGLuses.inc}
{$IFDEF ENABLE_HOLMES}
g_holmes, fui_wadread, fui_style, fui_gfx_gl,
{$ENDIF}
diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index 4e347ef549b1aceaec2e9e27d9025e1956c8a20a..97c56d0c399f8682f3122caa345d79ac9a28aa05 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
implementation
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL, GLExt,
-{$ENDIF}
+ {$INCLUDE ../nogl/noGLuses.inc}
e_input, g_main, e_log, e_texture, g_items, g_gfx, g_console,
g_weapons, g_game, g_sound, e_sound, CONFIG,
g_options, g_triggers, g_player,
diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index b84467fcc9c5052b997dce6079aab4098c585898..a9b4566ca562904817564e8f963f757597906adf 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
implementation
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL, GLExt,
-{$ENDIF}
+ {$INCLUDE ../nogl/noGLuses.inc}
g_gui, g_textures, e_graphics, g_main, g_window, g_game, g_map,
g_basic, g_console, g_sound, g_gfx, g_player, g_options, g_weapons,
e_log, SysUtils, CONFIG, g_playermodel, DateUtils, sdl2,
diff --git a/src/game/g_options.pas b/src/game/g_options.pas
index 54acb699e1be8cecfc7e402a00589f8895e1d97b..42b3ef70704fe4fb9469680c8fbc802f83728a0a 100644 (file)
--- a/src/game/g_options.pas
+++ b/src/game/g_options.pas
implementation
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL, GLExt,
-{$ENDIF}
+ {$INCLUDE ../nogl/noGLuses.inc}
e_log, e_input, g_window, g_sound, g_gfx, g_player, Math,
g_map, g_net, g_netmaster, SysUtils, CONFIG, g_game, g_main, e_texture,
g_items, wadreader, e_graphics, g_touch, SDL2;
diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas
index c3d822480045e29454919fe9c3c5e9cb9f4609f3..0268c097b672b950344e3342b9d5e441152ec8ca 100644 (file)
--- a/src/game/g_panel.pas
+++ b/src/game/g_panel.pas
implementation
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL,
-{$ENDIF}
+ {$INCLUDE ../nogl/noGLuses.inc}
e_texture, g_basic, g_map, g_game, g_gfx, e_graphics, g_weapons, g_triggers,
g_console, g_language, g_monsters, g_player, g_grid, e_log, geom, utils, xstreams;
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index 8c626569dfe2dd1e25476321c64567ea7333f5ff..355ecf323985108f69d23d047c3a34399fb77dcc 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
implementation
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL,
-{$ENDIF}
+{$INCLUDE ../nogl/noGLuses.inc}
{$IFDEF ENABLE_HOLMES}
g_holmes,
{$ENDIF}
index 5400de6b9b67c34df657353b8f7a09be33f382bd..af85837aaa8a16e9c88514b2bdf1e5de26c6be97 100644 (file)
@@ -141,11 +141,7 @@ function g_PlayerModel_GetGibs(ModelName: String; var Gibs: TGibsArray): Boolea
implementation
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL, GLExt,
-{$ENDIF}
+ {$INCLUDE ../nogl/noGLuses.inc}
g_main, g_sound, g_console, SysUtils, g_player, CONFIG,
e_sound, g_options, g_map, Math, e_log, wadreader;
index 72b65b560c814875b020eb124a2e0068d419c9c8..9f551f5b830ce6a3aa19d1746256bec631750950 100644 (file)
--- a/src/game/g_textures.pas
+++ b/src/game/g_textures.pas
implementation
uses
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL,
-{$ENDIF}
+ {$INCLUDE ../nogl/noGLuses.inc}
g_game, e_log, g_basic, g_console, wadreader,
g_language, utils, xstreams;
diff --git a/src/game/g_window.pas b/src/game/g_window.pas
index 7f542509b7b9febaf98200f072db129d08de578d..e57defe11cf4067a739f8f8c986dba9fef8f763b 100644 (file)
--- a/src/game/g_window.pas
+++ b/src/game/g_window.pas
uses
{$IFDEF WINDOWS}Windows,{$ENDIF}
-{$IFDEF USE_NANOGL}
- nanoGL,
-{$ELSE}
- GL, GLExt,
-{$ENDIF}
+{$INCLUDE ../nogl/noGLuses.inc}
{$IFDEF ENABLE_HOLMES}
g_holmes, sdlcarcass, fui_ctls,
{$ENDIF}
if (h_Wnd <> nil) then SDL_DestroyWindow(h_Wnd);
if (h_GL <> nil) and (not preserveGL) then
begin
+
{$IFDEF USE_NANOGL}
nanoGL_Destroy;
-{$ENDIF USE_NANOGL}
+{$ENDIF}
+
+{$IFDEF USE_NOGL}
+ nogl_Quit;
+{$ENDIF}
+
SDL_GL_DeleteContext(h_GL);
end;
h_Wnd := nil;
e_WriteLog('nanoGL initialization error', TMsgType.Fatal);
exit;
end;
+{$ENDIF}
+{$IFDEF USE_NOGL}
+ nogl_Init;
{$ENDIF}
{$IFDEF ENABLE_HOLMES}
if (assigned(oglInitCB)) then oglInitCB();
procedure InitOpenGL ();
begin
{$IF not DEFINED(HEADLESS)}
- {$IFDEF USE_NANOGL}
+ {$IFDEF USE_GLES1}
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
diff --git a/src/nogl/noGL.pas b/src/nogl/noGL.pas
--- /dev/null
+++ b/src/nogl/noGL.pas
@@ -0,0 +1,175 @@
+{$INCLUDE ../shared/a_modes.inc}
+unit noGL;
+
+interface
+
+ uses ctypes;
+
+ type
+ GLenum = cuint; PGLenum = ^GLenum;
+ GLboolean = cuchar; PGLboolean = ^GLboolean;
+ GLbitfield = cuint; PGLbitfield = ^GLbitfield;
+ GLbyte = cschar; PGLbyte = ^GLbyte;
+ GLshort = cshort; PGLshort = ^GLshort;
+ GLint = cint; PGLint = ^GLint;
+ GLsizei = cint; PGLsizei = ^GLsizei;
+ GLubyte = cuchar; PGLubyte = ^GLubyte;
+ GLushort = cushort; PGLushort = ^GLushort;
+ GLuint = cuint; PGLuint = ^GLuint;
+ GLfloat = cfloat; PGLfloat = ^GLfloat;
+ GLclampf = cfloat; PGLclampf = ^GLclampf;
+ GLdouble = cdouble; PGLdouble = ^GLdouble;
+ GLclampd = cdouble; PGLclampd = ^GLclampd;
+ { GLvoid = void; } PGLvoid = Pointer; PPGLvoid = ^PGLvoid;
+ GLfixed = cint; PGLfixed = ^Integer;
+ GLclampx = cint; PGLclampx = ^Integer;
+
+ TGLenum = GLenum;
+ TGLboolean = GLboolean;
+ TGLbitfield = GLbitfield;
+ TGLbyte = GLbyte;
+ TGLshort = GLshort;
+ TGLint = GLint;
+ TGLsizei = GLsizei;
+ TGLubyte = GLubyte;
+ TGLushort = GLushort;
+ TGLuint = GLuint;
+ TGLfloat = GLfloat;
+ TGLclampf = GLclampf;
+ TGLdouble = GLdouble;
+ TGLclampd = GLclampd;
+ TGLfixed = GLfixed;
+ TGLclampx = GLclampx;
+
+ const
+ GL_NEAREST = $2600;
+ GL_DEPTH_TEST = $0B71;
+ GL_SCISSOR_TEST = $0C11;
+ GL_MODELVIEW = $1700;
+ GL_PROJECTION = $1701;
+ GL_BLEND = $0BE2;
+ GL_SRC_ALPHA = $0302;
+ GL_ONE_MINUS_SRC_ALPHA = $0303;
+ GL_ONE = $1;
+ GL_TEXTURE_2D = $0DE1;
+ GL_QUADS = $0007;
+ GL_ZERO = $0;
+ GL_POINTS = $0000;
+ GL_LINES = $0001;
+ GL_DST_COLOR = $0306;
+ GL_SRC_COLOR = $0300;
+ GL_ONE_MINUS_DST_COLOR = $0307;
+ GL_GREATER = $0204;
+ GL_COLOR_BUFFER_BIT = $00004000;
+ GL_RGB = $1907;
+ GL_UNSIGNED_BYTE = $1401;
+ GL_ALPHA_TEST = $0BC0;
+ GL_VIEWPORT = $0BA2;
+ GL_TEXTURE_WRAP_S = $2802;
+ GL_TEXTURE_WRAP_T = $2803;
+ GL_REPEAT = $2901;
+ GL_TEXTURE_MIN_FILTER = $2801;
+ GL_TEXTURE_MAG_FILTER = $2800;
+ GL_RGBA = $1908;
+ GL_POINT_SMOOTH = $0B10;
+ GL_STENCIL_TEST = $0B90;
+ GL_SCISSOR_BOX = $0C10;
+ GL_FALSE = $0;
+ GL_TRUE = $1;
+ GL_ALWAYS = $0207;
+ GL_STENCIL_BUFFER_BIT = $00000400;
+ GL_EQUAL = $0202;
+ GL_KEEP = $1E00;
+ GL_INCR = $1E02;
+ GL_LINEAR = $2601;
+ GL_EXTENSIONS = $1F03;
+ GL_TEXTURE_ENV = $2300;
+ GL_TEXTURE_ENV_MODE = $2200;
+ GL_MODULATE = $2100;
+
+// const
+// GL_CULL_FACE = $0B44;
+// GL_FLOAT = $1406;
+// GL_VERTEX_ARRAY = $8074;
+// GL_NORMAL_ARRAY = $8075;
+// GL_COLOR_ARRAY = $8076;
+// GL_TEXTURE_COORD_ARRAY = $8078;
+// GL_NOTEQUAL = $0205;
+// GL_LINE_SMOOTH = $0B20;
+// GL_POLYGON_SMOOTH = $0B41;
+// GL_LIGHTING = $0B50;
+// GL_DITHER = $0BD0;
+// GL_MODELVIEW_MATRIX = $0BA6;
+// GL_MATRIX_MODE = $0BA0;
+// GL_TEXTURE_BINDING_2D = $8069;
+// GL_TEXTURE = $1702;
+// GL_COLOR = $1800;
+// GL_ALL_ATTRIB_BITS = $000FFFFF;
+
+ procedure glEnable(cap: GLenum);
+ procedure glDisable(cap: GLenum);
+ function glIsEnabled(cap: GLenum): GLboolean;
+ function glGetString(name: GLenum): PChar;
+ procedure glClearColor(red, green, blue, alpha: GLclampf);
+ procedure glClear(mask: GLbitfield);
+ procedure glAlphaFunc(func: GLenum; ref: GLclampf);
+ procedure glBlendFunc(sfactor, dfactor: GLenum);
+ procedure glPointSize(size: GLfloat);
+ procedure glLineWidth(width: GLfloat);
+ procedure glGetIntegerv(pname: GLenum; params: PGLint);
+ procedure glFlush;
+ procedure glFinish;
+
+ procedure glBegin(mode: GLenum);
+ procedure glEnd;
+ procedure glTexCoord2f(s, t: GLfloat);
+ procedure glVertex2i(x, y: GLint);
+ procedure glColor4ub(red, green, blue, alpha: GLubyte);
+ procedure glColor3ub(red, green, blue: GLubyte);
+ procedure glVertex2f(x, y: GLfloat);
+ procedure glTexCoord2i(s, t: GLint);
+ procedure glColor4f(red, green, blue, alpha: GLfloat);
+
+ procedure glReadPixels(x, y: GLint; width, height: GLsizei; format, atype: GLenum; pixels: Pointer);
+
+ procedure glLoadIdentity;
+ procedure glScissor(x, y: GLint; width, height: GLsizei);
+ procedure glViewport(x, y: GLint; width, height: GLsizei);
+ procedure glMatrixMode(mode: GLenum);
+ procedure glLoadMatrixd(const m: PGLdouble);
+ procedure glPushMatrix;
+ procedure glTranslatef(x, y, z: GLfloat);
+ procedure glRotatef(angle, x, y, z: GLfloat);
+ procedure glScalef(x, y, z: GLfloat);
+ procedure glPopMatrix;
+
+ procedure glStencilMask(mask: GLuint);
+ procedure glStencilFunc(func: GLenum; ref: GLint; mask: GLuint);
+ procedure glStencilOp(fail, zfail, zpass: GLenum);
+ procedure glColorMask(red, green, blue, alpha: GLboolean);
+
+ procedure glBindTexture(target: GLenum; texture: GLuint);
+ procedure glGenTextures(n: GLsizei; textures: PGLuint);
+ procedure glTexEnvi(target: GLenum; pname: GLenum; param: GLint);
+ procedure glTexParameterf(target: GLenum; pname: GLenum; param: GLfloat);
+ procedure glTexParameteri(target: GLenum; pname: GLenum; param: GLint);
+ procedure glTexImage2D(target: GLenum; level, internalformat: GLint; width, height: GLsizei; border: GLint; format, atype: GLenum; const pixels: Pointer);
+ procedure glTexSubImage2D(target: GLenum; level, xoffset, yoffset: GLint; width, height: GLsizei; format, atype: GLenum; const pixels: Pointer);
+ procedure glDeleteTextures(n: GLsizei; const textures: PGLuint);
+
+// procedure glVertexPointer(size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer);
+// procedure glEnableClientState(aarray: GLenum);
+// procedure glDisableClientState(aarray: GLenum);
+// procedure glDrawArrays(mode: GLenum; first: GLint; count: GLsizei);
+// procedure glGetFloatv(pname: GLenum; params: PGLfloat);
+// procedure glPushAttrib(mask: GLbitfield);
+// procedure glOrtho(left, right, bottom, top, zNear, zFar: GLdouble);
+// procedure glPopAttrib;
+// procedure glColorPointer(size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer);
+
+ procedure nogl_Init;
+ procedure nogl_Quit;
+
+{$I noGLES1.inc}
+
+end.
diff --git a/src/nogl/noGLES1.inc b/src/nogl/noGLES1.inc
--- /dev/null
+++ b/src/nogl/noGLES1.inc
@@ -0,0 +1,519 @@
+implementation
+
+ uses SDL2;
+
+ const
+ GL_FLOAT = $1406;
+ GL_VERTEX_ARRAY = $8074;
+ GL_NORMAL_ARRAY = $8075;
+ GL_COLOR_ARRAY = $8076;
+ GL_TEXTURE_COORD_ARRAY = $8078;
+ GL_TRIANGLES = $0004;
+ GL_TEXTURE0 = $84C0;
+ GL_INVALID_ENUM = $0500;
+
+ const
+ ValPerVertex = 2;
+ ValPerColor = 4;
+ ValPerCoord = 2;
+
+ type
+ TArrayFloat = array of GLfloat;
+
+ TCmds = record
+ mode: GLenum;
+ v, c, t: TArrayFloat;
+ end;
+
+ var
+ cmds: TCmds;
+
+ var
+ es_glVertexPointer: procedure (size: GLint; _type: GLenum; stride: GLsizei; pointer: PGLvoid); cdecl;
+ es_glColorPointer: procedure (size: GLint; _type: GLenum; stride: GLsizei; pointer: PGLvoid); cdecl;
+ es_glTexCoordPointer: procedure (size: GLint; _type: GLenum; stride: GLsizei; pointer: PGLvoid); cdecl;
+ es_glEnableClientState: procedure (arr: GLenum); cdecl;
+ es_glDisableClientState: procedure (arr: GLenum); cdecl;
+ es_glDrawArrays: procedure (mode: GLenum; first: GLint; count: GLsizei); cdecl;
+ es_glActiveTexture: procedure(texture: GLenum); cdecl;
+ es_glClientActiveTexture: procedure(texture: GLenum); cdecl;
+ es_glColor4f: procedure(red, green, blue, alpha: GLfloat); cdecl;
+
+ es_glEnable: procedure (cap: GLenum); cdecl;
+ es_glDisable: procedure (cap: GLenum); cdecl;
+ es_glIsEnabled: function (cap: GLenum): GLBoolean; cdecl;
+ es_glGetString: function (name: GLenum): PChar; cdecl;
+ es_glClearColor: procedure (red, green, blue, alpha: GLclampf); cdecl;
+ es_glClear: procedure (mask: GLbitfield); cdecl;
+ es_glAlphaFunc: procedure (func: GLenum; ref: GLclampf); cdecl;
+ es_glBlendFunc: procedure (sfactor, dfactor: GLenum); cdecl;
+ es_glPointSize: procedure (size: GLfloat); cdecl;
+ es_glLineWidth: procedure (width: GLfloat); cdecl;
+ es_glGetIntegerv: procedure (pname: GLenum; params: PGLint); cdecl;
+ es_glFlush: procedure; cdecl;
+ es_glFinish: procedure; cdecl;
+
+ es_glLoadIdentity: procedure; cdecl;
+ es_glMatrixMode: procedure (mode: GLenum); cdecl;
+ es_glLoadMatrixf: procedure (m: PGLfloat); cdecl;
+ es_glPushMatrix: procedure; cdecl;
+ es_glPopMatrix: procedure; cdecl;
+ es_glTranslatef: procedure (x, y, z: GLfloat); cdecl;
+ es_glRotatef: procedure (angle, x, y, z: GLfloat); cdecl;
+ es_glScalef: procedure (x, y, z: GLfloat); cdecl;
+
+ es_glReadPixels: procedure (x, y: GLint; width, height: GLsizei; format,_type: GLenum; pixels: PGLvoid); cdecl;
+
+ es_glViewport: procedure (x, y: GLint; width, height: GLsizei); cdecl;
+ es_glScissor: procedure (x, y: GLint; width, height: GLsizei); cdecl;
+ es_glStencilMask: procedure (mask: GLuint); cdecl;
+ es_glStencilFunc: procedure (func: GLenum; ref: GLint; mask: GLuint); cdecl;
+ es_glStencilOp: procedure (fail, zfail, zpass: GLenum); cdecl;
+ es_glColorMask: procedure (red: GLboolean; green: GLboolean; blue: GLboolean; alpha: GLboolean); cdecl;
+
+ es_glBindTexture: procedure (target: GLenum; texture: GLuint); cdecl;
+ es_glGenTextures: procedure (n: GLsizei; textures: PGLuint); cdecl;
+ es_glTexEnvi: procedure (target: GLenum; pname: GLenum; param: GLint); cdecl;
+ es_glTexParameterf: procedure (target: GLenum; pname: GLenum; param: GLfloat); cdecl;
+ es_glTexParameteri: procedure (target: GLenum; pname: GLenum; param: GLint); cdecl;
+ es_glTexImage2D: procedure (target: GLenum; level, internalformat: GLint; width, height: GLsizei; border: GLint; format, _type:GLenum; pixels: PGLvoid); cdecl;
+ es_glTexSubImage2D: procedure (target: GLenum; level: GLint; xoffset, yoffset: GLint; width, height: GLsizei; format, _type: GLenum; pixels: PGLvoid); cdecl;
+ es_glDeleteTextures: procedure (n: GLsizei; textures: PGLuint); cdecl;
+
+ procedure glEnable(cap: GLenum);
+ begin
+ es_glEnable(cap);
+ end;
+
+ procedure glDisable(cap: GLenum);
+ begin
+ es_glDisable(cap);
+ end;
+
+ function glIsEnabled(cap: GLenum): GLboolean;
+ begin
+ result := es_glIsEnabled(cap);
+ end;
+
+ function glGetString(name: GLenum): PChar;
+ begin
+ result := es_glGetString(name);
+ end;
+
+ procedure glClearColor(red, green, blue, alpha: GLclampf);
+ begin
+ es_glClearColor(red, green, blue, alpha);
+ end;
+
+ procedure glClear(mask: GLbitfield);
+ begin
+ es_glClear(mask);
+ end;
+
+ procedure glAlphaFunc(func: GLenum; ref: GLclampf);
+ begin
+ es_glAlphaFunc(func, ref);
+ end;
+
+ procedure glBlendFunc(sfactor, dfactor: GLenum);
+ begin
+ es_glBlendFunc(sfactor, dfactor);
+ end;
+
+ procedure glPointSize(size: GLfloat);
+ begin
+ es_glPointSize(size);
+ end;
+
+ procedure glLineWidth(width: GLfloat);
+ begin
+ es_glLineWidth(width);
+ end;
+
+ procedure glGetIntegerv(pname: GLenum; params: PGLint);
+ begin
+ es_glGetIntegerv(pname, params);
+ end;
+
+ procedure glFlush;
+ begin
+ es_glFlush;
+ end;
+
+ procedure glFinish;
+ begin
+ es_glFinish;
+ end;
+
+
+
+
+
+ procedure glBegin(mode: GLenum);
+ begin
+ assert(cmds.mode = GL_INVALID_ENUM);
+ assert((mode = GL_POINTS) or (mode = GL_LINES) or (mode = GL_QUADS));
+ cmds.mode := mode;
+ SetLength(cmds.v, 0);
+ SetLength(cmds.c, 0);
+ SetLength(cmds.t, 0);
+ end;
+
+ procedure glEnd;
+ var count: Integer;
+ begin
+ assert(cmds.mode <> GL_INVALID_ENUM);
+ assert(Length(cmds.v) mod ValPerVertex = 0);
+ assert(Length(cmds.c) mod ValPerColor = 0);
+ assert(Length(cmds.t) mod ValPerCoord = 0);
+ if Length(cmds.c) <> 0 then
+ assert(Length(cmds.v) div ValPerVertex = Length(cmds.c) div ValPerColor);
+ if Length(cmds.t) <> 0 then
+ assert(Length(cmds.v) div ValPerVertex = Length(cmds.t) div ValPerCoord);
+
+ es_glVertexPointer(ValPerVertex, GL_FLOAT, 0, @cmds.v[0]);
+ es_glColorPointer(ValPerColor, GL_FLOAT, 0, @cmds.c[0]);
+ es_glTexCoordPointer(ValPerCoord, GL_FLOAT, 0, @cmds.t[0]);
+ es_glEnableClientState(GL_VERTEX_ARRAY);
+ es_glEnableClientState(GL_COLOR_ARRAY);
+ es_glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ es_glDisableClientState(GL_NORMAL_ARRAY);
+
+ if Length(cmds.c) = 0 then
+ es_glDisableClientState(GL_COLOR_ARRAY);
+ if Length(cmds.t) = 0 then
+ es_glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ if cmds.mode = GL_QUADS then
+ es_glDrawArrays(GL_TRIANGLES, 0, Length(cmds.v) div ValPerVertex)
+ else
+ es_glDrawArrays(cmds.mode, 0, Length(cmds.v) div ValPerVertex);
+
+ SetLength(cmds.v, 0);
+ SetLength(cmds.c, 0);
+ SetLength(cmds.t, 0);
+ cmds.mode := GL_INVALID_ENUM;
+ end;
+
+(* ---------- begin internals ---------- *)
+
+ procedure AddFloatRaw (var x: TArrayFloat; f: GLfloat);
+ var i: Integer;
+ begin
+ i := Length(x);
+ SetLength(x, i + 1);
+ x[i] := f;
+ end;
+
+ procedure AddFloatX (var x: TArrayFloat; v: array of GLfloat); inline;
+ var i, j, vpx: Integer;
+ begin
+ i := Length(x);
+ vpx := Length(v);
+ if (cmds.mode = GL_QUADS) and (i div vpx mod 4 = 3) then
+ begin
+ for j := 0 to vpx - 1 do
+ AddFloatRaw(x, x[i - 3*vpx + j]);
+ for j := 0 to vpx - 1 do
+ AddFloatRaw(x, x[i - 1*vpx + j]);
+ end;
+ for j := 0 to vpx - 1 do
+ AddFloatRaw(x, v[j]);
+ end;
+
+(* ---------- end internals ---------- *)
+
+ procedure glVertex2f(x, y: GLfloat);
+ begin
+ AddFloatX(cmds.v, [x, y]);
+ end;
+
+ procedure glVertex2i(x, y: GLint);
+ begin
+ AddFloatX(cmds.v, [x, y]);
+ end;
+
+ procedure glColor4f(red, green, blue, alpha: GLfloat);
+ begin
+ if cmds.mode = GL_INVALID_ENUM then
+ es_glColor4f(red, green, blue, alpha)
+ else
+ AddFloatX(cmds.c, [red, green, blue, alpha])
+ end;
+
+ procedure glColor4ub(red, green, blue, alpha: GLubyte);
+ begin
+ glColor4f(red / 255, green / 255, blue / 255, alpha / 255)
+ end;
+
+ procedure glColor3ub(red, green, blue: GLubyte);
+ begin
+ glColor4f(red / 255, green / 255, blue / 255, 255)
+ end;
+
+ procedure glTexCoord2f(s, t: GLfloat);
+ begin
+ AddFloatX(cmds.t, [s, t]);
+ end;
+
+ procedure glTexCoord2i(s, t: GLint);
+ begin
+ AddFloatX(cmds.t, [s, t]);
+ end;
+
+
+
+
+
+
+
+ procedure glReadPixels(x, y: GLint; width, height: GLsizei; format, atype: GLenum; pixels: Pointer);
+ begin
+ es_glReadPixels(x, y, width, height, format, atype, pixels);
+ end;
+
+
+
+
+
+
+ procedure glLoadIdentity;
+ begin
+ es_glLoadIdentity;
+ end;
+
+ procedure glMatrixMode(mode: GLenum);
+ begin
+ es_glMatrixMode(mode);
+ end;
+
+ procedure glLoadMatrixd(const m: PGLdouble);
+ var
+ i: Integer;
+ n: array [0..15] of GLfloat;
+ begin
+ for i := 0 to 15 do
+ n[i] := m[i];
+ es_glLoadMatrixf(@n[0]);
+ end;
+
+ procedure glPushMatrix;
+ begin
+ es_glPushMatrix;
+ end;
+
+ procedure glPopMatrix;
+ begin
+ es_glPopMatrix;
+ end;
+
+ procedure glTranslatef(x, y, z: GLfloat);
+ begin
+ es_glTranslatef(x, y, z);
+ end;
+
+ procedure glRotatef(angle, x, y, z: GLfloat);
+ begin
+ es_glRotatef(angle, x, y, z);
+ end;
+
+ procedure glScalef(x, y, z: GLfloat);
+ begin
+ es_glScalef(x, y, z);
+ end;
+
+
+
+
+
+
+ procedure glViewport(x, y: GLint; width, height: GLsizei);
+ begin
+ es_glViewport(x, y, width, height);
+ end;
+
+ procedure glScissor(x, y: GLint; width, height: GLsizei);
+ begin
+ es_glScissor(x, y, width, height);
+ end;
+
+ procedure glStencilMask(mask: GLuint);
+ begin
+ es_glStencilMask(mask);
+ end;
+
+ procedure glStencilFunc(func: GLenum; ref: GLint; mask: GLuint);
+ begin
+ es_glStencilFunc(func, ref, mask);
+ end;
+
+ procedure glStencilOp(fail, zfail, zpass: GLenum);
+ begin
+ es_glStencilOp(fail, zfail, zpass);
+ end;
+
+ procedure glColorMask(red, green, blue, alpha: GLboolean);
+ begin
+ es_glColorMask(red, green, blue, alpha);
+ end;
+
+
+
+
+
+
+ procedure glBindTexture(target: GLenum; texture: GLuint);
+ begin
+ es_glBindTexture(target, texture);
+ end;
+
+ procedure glGenTextures(n: GLsizei; textures: PGLuint);
+ begin
+ es_glGenTextures(n, textures);
+ end;
+
+ procedure glTexEnvi(target: GLenum; pname: GLenum; param: GLint);
+ begin
+ es_glTexEnvi(target, pname, param);
+ end;
+
+ procedure glTexParameterf(target: GLenum; pname: GLenum; param: GLfloat);
+ begin
+ es_glTexParameterf(target, pname, param);
+ end;
+
+ procedure glTexParameteri(target: GLenum; pname: GLenum; param: GLint);
+ begin
+ es_glTexParameteri(target, pname, param);
+ end;
+
+ procedure glTexImage2D(target: GLenum; level, internalformat: GLint; width, height: GLsizei; border: GLint; format, atype: GLenum; const pixels: Pointer);
+ begin
+ es_glTexImage2D(target, level, internalformat, width, height, border, format, atype, pixels);
+ end;
+
+ procedure glTexSubImage2D(target: GLenum; level, xoffset, yoffset: GLint; width, height: GLsizei; format, atype: GLenum; const pixels: Pointer);
+ begin
+ es_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, atype, pixels);
+ end;
+
+ procedure glDeleteTextures(n: GLsizei; const textures: PGLuint);
+ begin
+ es_glDeleteTextures(n, textures);
+ end;
+
+
+
+
+
+ procedure nogl_Init;
+ begin
+ es_glVertexPointer := SDL_GL_GetProcAddress('glVertexPointer');
+ es_glColorPointer := SDL_GL_GetProcAddress('glColorPointer');
+ es_glTexCoordPointer := SDL_GL_GetProcAddress('glTexCoordPointer');
+ es_glEnableClientState := SDL_GL_GetProcAddress('glEnableClientState');
+ es_glDisableClientState := SDL_GL_GetProcAddress('glDisableClientState');
+ es_glDrawArrays := SDL_GL_GetProcAddress('glDrawArrays');
+ es_glActiveTexture := SDL_GL_GetProcAddress('glActiveTexture');
+ es_glClientActiveTexture := SDL_GL_GetProcAddress('glClientActiveTexture');
+ es_glColor4f := SDL_GL_GetProcAddress('glColor4f');
+
+ es_glEnable := SDL_GL_GetProcAddress('glEnable');
+ es_glDisable := SDL_GL_GetProcAddress('glDisable');
+ es_glIsEnabled := SDL_GL_GetProcAddress('glIsEnabled');
+ es_glGetString := SDL_GL_GetProcAddress('glGetString');
+ es_glClearColor := SDL_GL_GetProcAddress('glClearColor');
+ es_glClear := SDL_GL_GetProcAddress('glClear');
+ es_glAlphaFunc := SDL_GL_GetProcAddress('glAlphaFunc');
+ es_glBlendFunc := SDL_GL_GetProcAddress('glBlendFunc');
+ es_glPointSize := SDL_GL_GetProcAddress('glPointSize');
+ es_glLineWidth := SDL_GL_GetProcAddress('glLineWidth');
+ es_glGetIntegerv := SDL_GL_GetProcAddress('glGetIntegerv');
+ es_glFlush := SDL_GL_GetProcAddress('glFlush');
+ es_glFinish := SDL_GL_GetProcAddress('glFinish');
+
+ es_glLoadIdentity := SDL_GL_GetProcAddress('glLoadIdentity');
+ es_glMatrixMode := SDL_GL_GetProcAddress('glMatrixMode');
+ es_glLoadMatrixf := SDL_GL_GetProcAddress('glLoadMatrixf');
+ es_glPushMatrix := SDL_GL_GetProcAddress('glPushMatrix');
+ es_glPopMatrix := SDL_GL_GetProcAddress('glPopMatrix');
+ es_glTranslatef := SDL_GL_GetProcAddress('glTranslatef');
+ es_glRotatef := SDL_GL_GetProcAddress('glRotatef');
+ es_glScalef := SDL_GL_GetProcAddress('glScalef');
+
+ es_glReadPixels := SDL_GL_GetProcAddress('glReadPixels');
+
+ es_glViewport := SDL_GL_GetProcAddress('glViewport');
+ es_glScissor := SDL_GL_GetProcAddress('glScissor');
+ es_glStencilMask := SDL_GL_GetProcAddress('glStencilMask');
+ es_glStencilFunc := SDL_GL_GetProcAddress('glStencilFunc');
+ es_glStencilOp := SDL_GL_GetProcAddress('glStencilOp');
+ es_glColorMask := SDL_GL_GetProcAddress('glColorMask');
+
+ es_glBindTexture := SDL_GL_GetProcAddress('glBindTexture');
+ es_glGenTextures := SDL_GL_GetProcAddress('glGenTextures');
+ es_glTexEnvi := SDL_GL_GetProcAddress('glTexEnvi');
+ es_glTexParameterf := SDL_GL_GetProcAddress('glTexParameterf');
+ es_glTexParameteri := SDL_GL_GetProcAddress('glTexParameteri');
+ es_glTexImage2D := SDL_GL_GetProcAddress('glTexImage2D');
+ es_glTexSubImage2D := SDL_GL_GetProcAddress('glTexSubImage2D');
+ es_glDeleteTextures := SDL_GL_GetProcAddress('glDeleteTextures');
+
+ cmds.mode := GL_INVALID_ENUM
+ end;
+
+ procedure nogl_Quit;
+ begin
+ es_glVertexPointer := nil;
+ es_glColorPointer := nil;
+ es_glTexCoordPointer := nil;
+ es_glEnableClientState := nil;
+ es_glDisableClientState := nil;
+ es_glDrawArrays := nil;
+ es_glActiveTexture := nil;
+ es_glClientActiveTexture := nil;
+ es_glColor4f := nil;
+
+ es_glEnable := nil;
+ es_glDisable := nil;
+ es_glIsEnabled := nil;
+ es_glGetString := nil;
+ es_glClearColor := nil;
+ es_glClear := nil;
+ es_glAlphaFunc := nil;
+ es_glBlendFunc := nil;
+ es_glPointSize := nil;
+ es_glLineWidth := nil;
+ es_glGetIntegerv := nil;
+ es_glFlush := nil;
+ es_glFinish := nil;
+
+ es_glLoadIdentity := nil;
+ es_glMatrixMode := nil;
+ es_glLoadMatrixf := nil;
+ es_glPushMatrix := nil;
+ es_glPopMatrix := nil;
+ es_glTranslatef := nil;
+ es_glRotatef := nil;
+ es_glScalef := nil;
+
+ es_glReadPixels := nil;
+
+ es_glViewport := nil;
+ es_glScissor := nil;
+ es_glStencilMask := nil;
+ es_glStencilFunc := nil;
+ es_glStencilOp := nil;
+ es_glColorMask := nil;
+
+ es_glBindTexture := nil;
+ es_glGenTextures := nil;
+ es_glTexEnvi := nil;
+ es_glTexParameterf := nil;
+ es_glTexParameteri := nil;
+ es_glTexImage2D := nil;
+ es_glTexSubImage2D := nil;
+ es_glDeleteTextures := nil;
+ end;
+
+initialization
diff --git a/src/nogl/noGLuses.inc b/src/nogl/noGLuses.inc
--- /dev/null
+++ b/src/nogl/noGLuses.inc
@@ -0,0 +1,27 @@
+{$IFDEF USE_NANOGL}
+ {$DEFINE USE_GLES1}
+{$ELSE}
+ {$IFDEF USE_NOGL}
+ {$DEFINE USE_GLES1}
+ {$ENDIF}
+{$ENDIF}
+
+{$IFDEF USE_GLES1}
+ {$IFNDEF USE_NANOGL}
+ {$DEFINE USE_NOGL}
+ {$ENDIF}
+{$ENDIF}
+
+{$IF DEFINED(USE_NANOGL) and DEFINED(USE_NOGL)}
+ {$WARNING you can use only one OpenGL ES wrapper}
+{$ENDIF}
+
+{$IFDEF USE_NANOGL}
+ nanoGL in '../lib/nanogl/nanoGL.pas',
+{$ELSE}
+ {$IFDEF USE_NOGL}
+ noGL in '../nogl/noGL.pas',
+ {$ELSE}
+ GL, GLExt,
+ {$ENDIF}
+{$ENDIF}