DEADSOFTWARE

game: ... but only if we're not in game right now
[d2df-sdl.git] / src / nogl / noGL.pas
1 {$INCLUDE ../shared/a_modes.inc}
2 unit noGL;
4 interface
6 uses ctypes;
8 type
9 GLenum = cuint; PGLenum = ^GLenum;
10 GLboolean = cuchar; PGLboolean = ^GLboolean;
11 GLbitfield = cuint; PGLbitfield = ^GLbitfield;
12 GLbyte = cschar; PGLbyte = ^GLbyte;
13 GLshort = cshort; PGLshort = ^GLshort;
14 GLint = cint; PGLint = ^GLint;
15 GLsizei = cint; PGLsizei = ^GLsizei;
16 GLubyte = cuchar; PGLubyte = ^GLubyte;
17 GLushort = cushort; PGLushort = ^GLushort;
18 GLuint = cuint; PGLuint = ^GLuint;
19 GLfloat = cfloat; PGLfloat = ^GLfloat;
20 GLclampf = cfloat; PGLclampf = ^GLclampf;
21 GLdouble = cdouble; PGLdouble = ^GLdouble;
22 GLclampd = cdouble; PGLclampd = ^GLclampd;
23 { GLvoid = void; } PGLvoid = Pointer; PPGLvoid = ^PGLvoid;
24 GLfixed = cint; PGLfixed = ^Integer;
25 GLclampx = cint; PGLclampx = ^Integer;
27 TGLenum = GLenum;
28 TGLboolean = GLboolean;
29 TGLbitfield = GLbitfield;
30 TGLbyte = GLbyte;
31 TGLshort = GLshort;
32 TGLint = GLint;
33 TGLsizei = GLsizei;
34 TGLubyte = GLubyte;
35 TGLushort = GLushort;
36 TGLuint = GLuint;
37 TGLfloat = GLfloat;
38 TGLclampf = GLclampf;
39 TGLdouble = GLdouble;
40 TGLclampd = GLclampd;
41 TGLfixed = GLfixed;
42 TGLclampx = GLclampx;
44 const
45 GL_NO_ERROR = 0;
46 GL_NEAREST = $2600;
47 GL_DEPTH_TEST = $0B71;
48 GL_SCISSOR_TEST = $0C11;
49 GL_MODELVIEW = $1700;
50 GL_PROJECTION = $1701;
51 GL_BLEND = $0BE2;
52 GL_SRC_ALPHA = $0302;
53 GL_ONE_MINUS_SRC_ALPHA = $0303;
54 GL_ONE = $1;
55 GL_TEXTURE_2D = $0DE1;
56 GL_QUADS = $0007;
57 GL_ZERO = $0;
58 GL_POINTS = $0000;
59 GL_LINES = $0001;
60 GL_DST_COLOR = $0306;
61 GL_SRC_COLOR = $0300;
62 GL_ONE_MINUS_DST_COLOR = $0307;
63 GL_GREATER = $0204;
64 GL_COLOR_BUFFER_BIT = $00004000;
65 GL_RGB = $1907;
66 GL_UNSIGNED_BYTE = $1401;
67 GL_ALPHA_TEST = $0BC0;
68 GL_VIEWPORT = $0BA2;
69 GL_TEXTURE_WRAP_S = $2802;
70 GL_TEXTURE_WRAP_T = $2803;
71 GL_REPEAT = $2901;
72 GL_TEXTURE_MIN_FILTER = $2801;
73 GL_TEXTURE_MAG_FILTER = $2800;
74 GL_RGBA = $1908;
75 GL_POINT_SMOOTH = $0B10;
76 GL_STENCIL_TEST = $0B90;
77 GL_SCISSOR_BOX = $0C10;
78 GL_FALSE = $0;
79 GL_TRUE = $1;
80 GL_ALWAYS = $0207;
81 GL_STENCIL_BUFFER_BIT = $00000400;
82 GL_EQUAL = $0202;
83 GL_KEEP = $1E00;
84 GL_INCR = $1E02;
85 GL_LINEAR = $2601;
86 GL_TEXTURE_ENV = $2300;
87 GL_TEXTURE_ENV_MODE = $2200;
88 GL_MODULATE = $2100;
90 GL_INVALID_FRAMEBUFFER_OPERATION = $0506;
91 GL_FRAMEBUFFER_DEFAULT = $8218;
92 GL_FRAMEBUFFER_UNDEFINED = $8219;
93 GL_DEPTH_STENCIL_ATTACHMENT = $821A;
94 GL_MAX_RENDERBUFFER_SIZE = $84E8;
95 GL_DEPTH_STENCIL = $84F9;
96 GL_DEPTH_COMPONENT16 = $81A5;
97 GL_DEPTH24_STENCIL8 = $88F0;
98 GL_FRAMEBUFFER_BINDING = $8CA6;
99 GL_DRAW_FRAMEBUFFER_BINDING = GL_FRAMEBUFFER_BINDING;
100 GL_RENDERBUFFER_BINDING = $8CA7;
101 GL_READ_FRAMEBUFFER = $8CA8;
102 GL_DRAW_FRAMEBUFFER = $8CA9;
103 GL_READ_FRAMEBUFFER_BINDING = $8CAA;
104 GL_RENDERBUFFER_SAMPLES = $8CAB;
105 GL_FRAMEBUFFER_COMPLETE = $8CD5;
106 GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = $8CD6;
107 GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = $8CD7;
108 GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = $8CDB;
109 GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = $8CDC;
110 GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = $8D56;
111 GL_FRAMEBUFFER_UNSUPPORTED = $8CDD;
112 GL_MAX_COLOR_ATTACHMENTS = $8CDF;
113 GL_COLOR_ATTACHMENT0 = $8CE0;
114 GL_DEPTH_ATTACHMENT = $8D00;
115 GL_STENCIL_ATTACHMENT = $8D20;
116 GL_FRAMEBUFFER = $8D40;
117 GL_RENDERBUFFER = $8D41;
118 GL_STENCIL_INDEX1 = $8D46;
119 GL_STENCIL_INDEX4 = $8D47;
120 GL_STENCIL_INDEX8 = $8D48;
121 GL_MAX_SAMPLES = $8D57;
123 GL_VENDOR = $1F00;
124 GL_RENDERER = $1F01;
125 GL_VERSION = $1F02;
126 GL_EXTENSIONS = $1F03;
127 GL_SHADING_LANGUAGE_VERSION = $8B8C;
129 // const
130 // GL_CULL_FACE = $0B44;
131 // GL_FLOAT = $1406;
132 // GL_VERTEX_ARRAY = $8074;
133 // GL_NORMAL_ARRAY = $8075;
134 // GL_COLOR_ARRAY = $8076;
135 // GL_TEXTURE_COORD_ARRAY = $8078;
136 // GL_NOTEQUAL = $0205;
137 // GL_LINE_SMOOTH = $0B20;
138 // GL_POLYGON_SMOOTH = $0B41;
139 // GL_LIGHTING = $0B50;
140 // GL_DITHER = $0BD0;
141 // GL_MODELVIEW_MATRIX = $0BA6;
142 // GL_MATRIX_MODE = $0BA0;
143 // GL_TEXTURE_BINDING_2D = $8069;
144 // GL_TEXTURE = $1702;
145 // GL_COLOR = $1800;
146 // GL_ALL_ATTRIB_BITS = $000FFFFF;
148 procedure glEnable(cap: GLenum);
149 procedure glDisable(cap: GLenum);
150 function glIsEnabled(cap: GLenum): GLboolean;
151 function glGetString(name: GLenum): PChar;
152 function glGetError: GLenum;
153 procedure glClearColor(red, green, blue, alpha: GLclampf);
154 procedure glClear(mask: GLbitfield);
155 procedure glAlphaFunc(func: GLenum; ref: GLclampf);
156 procedure glBlendFunc(sfactor, dfactor: GLenum);
157 procedure glPointSize(size: GLfloat);
158 procedure glLineWidth(width: GLfloat);
159 procedure glGetIntegerv(pname: GLenum; params: PGLint);
160 procedure glFlush;
161 procedure glFinish;
163 procedure glBegin(mode: GLenum);
164 procedure glEnd;
165 procedure glTexCoord2f(s, t: GLfloat);
166 procedure glVertex2i(x, y: GLint);
167 procedure glColor4ub(red, green, blue, alpha: GLubyte);
168 procedure glColor3ub(red, green, blue: GLubyte);
169 procedure glVertex2f(x, y: GLfloat);
170 procedure glTexCoord2i(s, t: GLint);
171 procedure glColor4f(red, green, blue, alpha: GLfloat);
173 procedure glReadPixels(x, y: GLint; width, height: GLsizei; format, atype: GLenum; pixels: Pointer);
175 procedure glLoadIdentity;
176 procedure glScissor(x, y: GLint; width, height: GLsizei);
177 procedure glViewport(x, y: GLint; width, height: GLsizei);
178 procedure glMatrixMode(mode: GLenum);
179 procedure glLoadMatrixd(const m: PGLdouble);
180 procedure glPushMatrix;
181 procedure glTranslatef(x, y, z: GLfloat);
182 procedure glRotatef(angle, x, y, z: GLfloat);
183 procedure glScalef(x, y, z: GLfloat);
184 procedure glPopMatrix;
186 procedure glStencilMask(mask: GLuint);
187 procedure glStencilFunc(func: GLenum; ref: GLint; mask: GLuint);
188 procedure glStencilOp(fail, zfail, zpass: GLenum);
189 procedure glColorMask(red, green, blue, alpha: GLboolean);
191 procedure glBindTexture(target: GLenum; texture: GLuint);
192 procedure glGenTextures(n: GLsizei; textures: PGLuint);
193 procedure glTexEnvi(target: GLenum; pname: GLenum; param: GLint);
194 procedure glTexParameterf(target: GLenum; pname: GLenum; param: GLfloat);
195 procedure glTexParameteri(target: GLenum; pname: GLenum; param: GLint);
196 procedure glTexImage2D(target: GLenum; level, internalformat: GLint; width, height: GLsizei; border: GLint; format, atype: GLenum; const pixels: Pointer);
197 procedure glTexSubImage2D(target: GLenum; level, xoffset, yoffset: GLint; width, height: GLsizei; format, atype: GLenum; const pixels: Pointer);
198 procedure glDeleteTextures(n: GLsizei; const textures: PGLuint);
200 procedure glGenFramebuffers(n: GLsizei; framebuffers: PGLuint);
201 procedure glBindFramebuffer(target: GLenum; framebuffer: GLuint);
202 procedure glFramebufferTexture2D(target, attachment, textarget: GLenum; texture: GLuint; level: GLint);
203 procedure glFramebufferRenderbuffer(target, attachment, rbotarget: GLenum; rbo: GLuint);
204 function glCheckFramebufferStatus(framebuffer: GLuint): GLenum;
205 procedure glDeleteFramebuffers(n: GLsizei; const framebuffers: PGLuint);
207 procedure glGenRenderbuffers(n: GLsizei; renderbuffers: PGLuint);
208 procedure glBindRenderbuffer(target: GLenum; renderbuffer: GLuint);
209 procedure glRenderbufferStorage(target, internalformat: GLenum; w, h: GLsizei);
210 procedure glDeleteRenderbuffers(n: GLsizei; const renderbuffers: PGLuint);
212 // procedure glVertexPointer(size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer);
213 // procedure glEnableClientState(aarray: GLenum);
214 // procedure glDisableClientState(aarray: GLenum);
215 // procedure glDrawArrays(mode: GLenum; first: GLint; count: GLsizei);
216 // procedure glGetFloatv(pname: GLenum; params: PGLfloat);
217 // procedure glPushAttrib(mask: GLbitfield);
218 // procedure glOrtho(left, right, bottom, top, zNear, zFar: GLdouble);
219 // procedure glPopAttrib;
220 // procedure glColorPointer(size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer);
222 procedure nogl_Init;
223 procedure nogl_Quit;
224 function nogl_ExtensionSupported(ext: string): Boolean;
226 {$IFDEF USE_GLES1}
227 {$I noGLES1.inc}
228 {$ENDIF}
229 {$IFDEF USE_GLSTUB}
230 {$I noGLSTUB.inc}
231 {$ENDIF}
233 end.