lace_opengl_0.1.0_672a6415/private/gl/source/gl-safe.ads

  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
with
     Interfaces.C.Pointers;

package GL.safe
--
--  Provides types, constants and functions specific to the openGL 'Safety Critical' profile.
--
is
   ---------
   --  Types
   --

   --  GLubyte_Pointer
   --
   package GLubyte_Pointers is new C.Pointers (Index              => C.size_t,
                                               Element            => GLubyte,
                                               Element_Array      => GLubyte_array,
                                               Default_Terminator => 0);
   subtype GLubyte_Pointer  is GLubyte_Pointers.Pointer;


   --  GLint_Pointer
   --
   package GLint_Pointers is new C.Pointers (Index              => C.size_t,
                                             Element            => GLint,
                                             Element_Array      => GLint_array,
                                             Default_Terminator => 0);
   subtype GLint_Pointer  is GLint_Pointers.Pointer;


   --  GLfloat_Pointer
   --
   package GLfloat_Pointers is new C.Pointers (Index              => C.size_t,
                                               Element            => GLfloat,
                                               Element_Array      => GLfloat_array,
                                               Default_Terminator => 0.0);
   subtype GLfloat_Pointer  is GLfloat_Pointers.Pointer;


   --  GLvoid_Pointer
   --
   package GLvoid_Pointers is new C.Pointers (Index              => C.size_t,
                                              Element            => GLvoid,
                                              Element_Array      => GLvoid_array,
                                              Default_Terminator => 0);
   subtype GLvoid_Pointer  is GLvoid_Pointers.Pointer;


   --  GLvoid_Pointer_Pointer
   --
   type    GLvoid_Pointer_array    is array (C.size_t range <>) of aliased GLvoid_Pointer;
   package GLvoid_Pointer_Pointers is new C.Pointers (Index              => C.size_t,
                                                      Element            => GLvoid_Pointer,
                                                      Element_Array      => GLvoid_Pointer_array,
                                                      Default_Terminator => null);
   subtype GLvoid_Pointer_Pointer  is GLvoid_Pointer_Pointers.Pointer;



   -------------
   --  Constants
   --

   GL_ADD                            : constant := 16#0104#;
   GL_ALPHA_TEST                     : constant := 16#0BC0#;
   GL_ALPHA_TEST_FUNC                : constant := 16#0BC1#;
   GL_ALPHA_TEST_REF                 : constant := 16#0BC2#;
   GL_AMBIENT                        : constant := 16#1200#;
   GL_AMBIENT_AND_DIFFUSE            : constant := 16#1602#;
   GL_BLEND_DST                      : constant := 16#0BE0#;
   GL_BLEND_SRC                      : constant := 16#0BE1#;
   GL_CLIENT_ACTIVE_TEXTURE          : constant := 16#84E1#;
   GL_COLOR                          : constant := 16#1800#;
   GL_COLOR_ARRAY                    : constant := 16#8076#;
   GL_COLOR_ARRAY_POINTER            : constant := 16#8090#;
   GL_COLOR_ARRAY_SIZE               : constant := 16#8081#;
   GL_COLOR_ARRAY_STRIDE             : constant := 16#8083#;
   GL_COLOR_ARRAY_TYPE               : constant := 16#8082#;
   GL_COLOR_INDEX                    : constant := 16#1900#;
   GL_COLOR_INDEX8_EXT               : constant := 16#80E5#;
   GL_COLOR_MATERIAL                 : constant := 16#0B57#;
   GL_COLOR_TABLE_ALPHA_SIZE         : constant := 16#80DD#;
   GL_COLOR_TABLE_BLUE_SIZE          : constant := 16#80DC#;
   GL_COLOR_TABLE_FORMAT             : constant := 16#80D8#;
   GL_COLOR_TABLE_GREEN_SIZE         : constant := 16#80DB#;
   GL_COLOR_TABLE_INTENSITY_SIZE     : constant := 16#80DF#;
   GL_COLOR_TABLE_LUMINANCE_SIZE     : constant := 16#80DE#;
   GL_COLOR_TABLE_RED_Size           : constant := 16#80DA#;
   GL_COLOR_TABLE_WIDTH              : constant := 16#80D9#;
   GL_COMPILE                        : constant := 16#1300#;
   GL_CURRENT_COLOR                  : constant := 16#0B00#;
   GL_CURRENT_NORMAL                 : constant := 16#0B02#;
   GL_CURRENT_RASTER_COLOR           : constant := 16#0B04#;
   GL_CURRENT_RASTER_TEXTURE_COORDS  : constant := 16#0B06#;
   GL_CURRENT_TEXTURE_COORDS         : constant := 16#0B03#;
   GL_DECAL                          : constant := 16#2101#;
   GL_DIFFUSE                        : constant := 16#1201#;
   GL_EMISSION                       : constant := 16#1600#;
   GL_EXT_paletted_texture           : constant := 1;
   GL_FLAT                           : constant := 16#1D00#;
   GL_LIGHT0                         : constant := 16#4000#;
   GL_LIGHT1                         : constant := 16#4001#;
   GL_LIGHTING                       : constant := 16#0B50#;
   GL_LIGHT_MODEL_AMBIENT            : constant := 16#0B53#;
   GL_LINE_SMOOTH                    : constant := 16#0B20#;
   GL_LINE_SMOOTH_HINT               : constant := 16#0C52#;
   GL_LINE_STIPPLE                   : constant := 16#0B24#;
   GL_LINE_STIPPLE_PATTERN           : constant := 16#0B25#;
   GL_LINE_STIPPLE_REPEAT            : constant := 16#0B26#;
   GL_LIST_BASE                      : constant := 16#0B32#;
   GL_MATRIX_MODE                    : constant := 16#0BA0#;
   GL_MAX_ELEMENTS_INDICES           : constant := 16#80E9#;
   GL_MAX_ELEMENTS_VERTICES          : constant := 16#80E8#;
   GL_MAX_LIGHTS                     : constant := 16#0D31#;
   GL_MAX_LIST_NESTING               : constant := 16#0B31#;
   GL_MAX_MODELVIEW_STACK_DEPTH      : constant := 16#0D36#;
   GL_MAX_PROJECTION_STACK_DEPTH     : constant := 16#0D38#;
   GL_MAX_TEXTURE_UNITS              : constant := 16#84E2#;
   GL_MODELVIEW                      : constant := 16#1700#;
   GL_MODELVIEW_MATRIX               : constant := 16#0BA6#;
   GL_MODELVIEW_STACK_DEPTH          : constant := 16#0BA3#;
   GL_MODULATE                       : constant := 16#2100#;
   GL_NORMALIZE                      : constant := 16#0BA1#;
   GL_NORMAL_ARRAY                   : constant := 16#8075#;
   GL_NORMAL_ARRAY_POINTER           : constant := 16#808F#;
   GL_NORMAL_ARRAY_STRIDE            : constant := 16#807F#;
   GL_NORMAL_ARRAY_TYPE              : constant := 16#807E#;
   GL_OES_single_precision           : constant := 1;
   GL_OSC_VERSION_1_0                : constant := 1;
   GL_PERSPECTIVE_CORRECTION_HINT    : constant := 16#0C50#;
   GL_POINT_SIZE                     : constant := 16#0B11#;
   GL_POINT_SMOOTH                   : constant := 16#0B10#;
   GL_POINT_SMOOTH_HINT              : constant := 16#0C51#;
   GL_POLYGON_SMOOTH_HINT            : constant := 16#0C53#;
   GL_POLYGON_STIPPLE                : constant := 16#0B42#;
   GL_POSITION                       : constant := 16#1203#;
   GL_PROJECTION                     : constant := 16#1701#;
   GL_PROJECTION_MATRIX              : constant := 16#0BA7#;
   GL_PROJECTION_STACK_DEPTH         : constant := 16#0BA4#;
   GL_RESCALE_NORMAL                 : constant := 16#803A#;
   GL_SHADE_MODEL                    : constant := 16#0B54#;
   GL_SHININESS                      : constant := 16#1601#;
   GL_SMOOTH                         : constant := 16#1D01#;
   GL_SMOOTH_LINE_WIDTH_GRANULARITY  : constant := 16#0B23#;
   GL_SMOOTH_LINE_WIDTH_RANGE        : constant := 16#0B22#;
   GL_SMOOTH_POINT_SIZE_GRANULARITY  : constant := 16#0B13#;
   GL_SMOOTH_POINT_SIZE_RANGE        : constant := 16#0B12#;
   GL_SPECULAR                       : constant := 16#1202#;
   GL_STACK_OVERFLOW                 : constant := 16#0503#;
   GL_STACK_UNDERFLOW                : constant := 16#0504#;
   GL_TEXTURE_COORD_ARRAY            : constant := 16#8078#;
   GL_TEXTURE_COORD_ARRAY_POINTER    : constant := 16#8092#;
   GL_TEXTURE_COORD_ARRAY_SIZE       : constant := 16#8088#;
   GL_TEXTURE_COORD_ARRAY_STRIDE     : constant := 16#808A#;
   GL_TEXTURE_COORD_ARRAY_TYPE       : constant := 16#8089#;
   GL_TEXTURE_ENV                    : constant := 16#2300#;
   GL_TEXTURE_ENV_COLOR              : constant := 16#2201#;
   GL_TEXTURE_ENV_MODE               : constant := 16#2200#;
   GL_VERTEX_ARRAY                   : constant := 16#8074#;
   GL_VERTEX_ARRAY_POINTER           : constant := 16#808E#;
   GL_VERTEX_ARRAY_SIZE              : constant := 16#807A#;
   GL_VERTEX_ARRAY_STRIDE            : constant := 16#807C#;
   GL_VERTEX_ARRAY_TYPE              : constant := 16#807B#;


   --------------
   --   Functions
   --

   procedure glAlphaFunc           (Func           : in     GLenum;
                                    Ref            : in     GLclampf);
   procedure glBegin               (Mode           : in     GLenum);
   procedure glBitmap              (Width          : in     GLsizei;
                                    Height         : in     GLsizei;
                                    xOrig          : in     GLfloat;
                                    yOrig          : in     GLfloat;
                                    xMove          : in     GLfloat;
                                    yMove          : in     GLfloat;
                                    Bitmap         : in     GLubyte_Pointer);
   procedure glCallLists           (N              : in     GLsizei;
                                    the_Type       : in     GLenum;
                                    Lists          : in     GLvoid_Pointer);
   procedure glClientActiveTexture (Texture        : in     GLenum);
   procedure glColor4f             (Red            : in     GLfloat;
                                    Green          : in     GLfloat;
                                    Blue           : in     GLfloat;
                                    Alpha          : in     GLfloat);
   procedure glColor4fv            (V              : in     GLfloat_Pointer);
   procedure glColor4ub            (Red            : in     GLubyte;
                                    Green          : in     GLubyte;
                                    Blue           : in     GLubyte;
                                    Alpha          : in     GLubyte);
   procedure glColorPointer        (Size           : in     GLint;
                                    the_Type       : in     GLenum;
                                    Stride         : in     GLsizei;
                                    Ptr            : in     GLvoid_Pointer);
   procedure glCopyPixels          (X              : in     GLint;
                                    Y              : in     GLint;
                                    Width          : in     GLsizei;
                                    Height         : in     GLsizei;
                                    the_Type       : in     GLenum);
   procedure glDisableClientState  (Cap            : in     GLenum);
   procedure glDrawPixels          (Width          : in     GLsizei;
                                    Height         : in     GLsizei;
                                    Format         : in     GLenum;
                                    the_Type       : in     GLenum;
                                    Pixels         : in     GLvoid_Pointer);
   procedure glEnableClientState   (Cap            : in     GLenum);
   procedure glEnd;
   procedure glEndList;
   procedure glFrustumf            (Left           : in     GLfloat;
                                    Right          : in     GLfloat;
                                    Bottom         : in     GLfloat;
                                    Top            : in     GLfloat;
                                    near_Val       : in     GLfloat;
                                    far_Val        : in     GLfloat);
   function  glGenLists            (the_Range      : in     GLsizei) return GLuint;
   procedure glGetLightfv          (Light          : in     GLenum;
                                    pName          : in     GLenum;
                                    Params         : in     GLfloat_Pointer);
   procedure glGetMaterialfv       (Face           : in     GLenum;
                                    pName          : in     GLenum;
                                    Params         : in     GLfloat_Pointer);
   procedure glGetPointerv         (pName          : in     GLenum;
                                    Params         : in     GLvoid_Pointer_Pointer);
   procedure glGetPolygonStipple   (Mask           : in     GLubyte_Pointer);
   procedure glGetTexEnvfv         (Target         : in     GLenum;
                                    pName          : in     GLenum;
                                    Params         : in     GLfloat_Pointer);
   procedure glGetTexEnviv         (Target         : in     GLenum;
                                    pName          : in     GLenum;
                                    Params         : in     GLint_Pointer);
   procedure glLightModelfv        (pName          : in     GLenum;
                                    Params         : in     GLfloat_Pointer);
   procedure glLightfv             (Light          : in     GLenum;
                                    pName          : in     GLenum;
                                    Params         : in     GLfloat_Pointer);
   procedure glLineStipple         (Factor         : in     GLint;
                                    Pattern        : in     GLushort);
   procedure glListBase            (Base           : in     GLuint);
   procedure glLoadIdentity;
   procedure glLoadMatrixf         (M              : in     GLfloat_Pointer);
   procedure glMaterialf           (Face           : in     GLenum;
                                    pName          : in     GLenum;
                                    Param          : in     GLfloat);
   procedure glMaterialfv          (Face           : in     GLenum;
                                    pName          : in     GLenum;
                                    Params         : in     GLfloat_Pointer);
   procedure glMatrixMode          (Mode           : in     GLenum);
   procedure glMultMatrixf         (M              : in     GLfloat_Pointer);
   procedure glMultiTexCoord2f     (Target         : in     GLenum;
                                    S              : in     GLfloat;
                                    T              : in     GLfloat);
   procedure glMultiTexCoord2fv    (Target         : in     GLenum;
                                    V              : in     GLfloat_Pointer);
   procedure glNewList             (List           : in     GLuint;
                                    Mode           : in     GLenum);
   procedure glNormal3f            (nX             : in     GLfloat;
                                    nY             : in     GLfloat;
                                    nZ             : in     GLfloat);
   procedure glNormal3fv           (V              : in     GLfloat_Pointer);
   procedure glNormalPointer       (the_Type       : in     GLenum;
                                    Stride         : in     GLsizei;
                                    Ptr            : in     GLvoid_Pointer);
   procedure glOrthof              (Left           : in     GLfloat;
                                    Right          : in     GLfloat;
                                    Bottom         : in     GLfloat;
                                    Top            : in     GLfloat;
                                    Near           : in     GLfloat;
                                    Far            : in     GLfloat);
   procedure glPointSize           (Size           : in     GLfloat);
   procedure glPolygonStipple      (Mask           : in     GLubyte_Pointer);
   procedure glPopMatrix;
   procedure glPushMatrix;
   procedure glRasterPos3f         (X              : in     GLfloat;
                                    Y              : in     GLfloat;
                                    Z              : in     GLfloat);
   procedure glRotatef             (Angle          : in     GLfloat;
                                    X              : in     GLfloat;
                                    Y              : in     GLfloat;
                                    Z              : in     GLfloat);
   procedure glScalef              (X              : in     GLfloat;
                                    Y              : in     GLfloat;
                                    Z              : in     GLfloat);
   procedure glShadeModel          (Mode           : in     GLenum);
   procedure glTexCoordPointer     (Size           : in     GLint;
                                    the_Type       : in     GLenum;
                                    Stride         : in     GLsizei;
                                    Ptr            : in     GLvoid_Pointer);
   procedure glTexEnvfv            (Target         : in     GLenum;
                                    pName          : in     GLenum;
                                    Params         : in     GLfloat_Pointer);
   procedure glTexEnvi             (Target         : in     GLenum;
                                    pName          : in     GLenum;
                                    Param          : in     GLint);
   procedure glTranslatef          (X              : in     GLfloat;
                                    Y              : in     GLfloat;
                                    Z              : in     GLfloat);
   procedure glVertex2f            (X              : in     GLfloat;
                                    Y              : in     GLfloat);
   procedure glVertex2fv           (V              : in     GLfloat_Pointer);
   procedure glVertex3f            (X              : in     GLfloat;
                                    Y              : in     GLfloat;
                                    Z              : in     GLfloat);
   procedure glVertex3fv           (V              : in     GLfloat_Pointer);
   procedure glVertexPointer       (Size           : in     GLint;
                                    the_Type       : in     GLenum;
                                    Stride         : in     GLsizei;
                                    Ptr            : in     GLvoid_Pointer);

private

   pragma Import (StdCall, glAlphaFunc,           "glAlphaFunc");
   pragma Import (StdCall, glBegin,               "glBegin");
   pragma Import (StdCall, glBitmap,              "glBitmap");
   pragma Import (StdCall, glCallLists,           "glCallLists");
   pragma Import (StdCall, glClientActiveTexture, "glClientActiveTexture");
   pragma Import (StdCall, glColor4f,             "glColor4f");
   pragma Import (StdCall, glColor4fv,            "glColor4fv");
   pragma Import (StdCall, glColor4ub,            "glColor4ub");
   pragma Import (StdCall, glColorPointer,        "glColorPointer");
   pragma Import (StdCall, glCopyPixels,          "glCopyPixels");
   pragma Import (StdCall, glDisableClientState,  "glDisableClientState");
   pragma Import (StdCall, glDrawPixels,          "glDrawPixels");
   pragma Import (StdCall, glEnableClientState,   "glEnableClientState");
   pragma Import (StdCall, glEnd,                 "glEnd");
   pragma Import (StdCall, glEndList,             "glEndList");
   pragma Import (StdCall, glFrustumf,            "glFrustumf");
   pragma Import (StdCall, glGenLists,            "glGenLists");
   pragma Import (StdCall, glGetLightfv,          "glGetLightfv");
   pragma Import (StdCall, glGetMaterialfv,       "glGetMaterialfv");
   pragma Import (StdCall, glGetPointerv,         "glGetPointerv");
   pragma Import (StdCall, glGetPolygonStipple,   "glGetPolygonStipple");
   pragma Import (StdCall, glGetTexEnvfv,         "glGetTexEnvfv");
   pragma Import (StdCall, glGetTexEnviv,         "glGetTexEnviv");
   pragma Import (StdCall, glLightModelfv,        "glLightModelfv");
   pragma Import (StdCall, glLightfv,             "glLightfv");
   pragma Import (StdCall, glLineStipple,         "glLineStipple");
   pragma Import (StdCall, glListBase,            "glListBase");
   pragma Import (StdCall, glLoadIdentity,        "glLoadIdentity");
   pragma Import (StdCall, glLoadMatrixf,         "glLoadMatrixf");
   pragma Import (StdCall, glMaterialf,           "glMaterialf");
   pragma Import (StdCall, glMaterialfv,          "glMaterialfv");
   pragma Import (StdCall, glMatrixMode,          "glMatrixMode");
   pragma Import (StdCall, glMultMatrixf,         "glMultMatrixf");
   pragma Import (StdCall, glMultiTexCoord2f,     "glMultiTexCoord2f");
   pragma Import (StdCall, glMultiTexCoord2fv,    "glMultiTexCoord2fv");
   pragma Import (StdCall, glNewList,             "glNewList");
   pragma Import (StdCall, glNormal3f,            "glNormal3f");
   pragma Import (StdCall, glNormal3fv,           "glNormal3fv");
   pragma Import (StdCall, glNormalPointer,       "glNormalPointer");
   pragma Import (StdCall, glOrthof,              "glOrthof");
   pragma Import (StdCall, glPointSize,           "glPointSize");
   pragma Import (StdCall, glPolygonStipple,      "glPolygonStipple");
   pragma Import (StdCall, glPopMatrix,           "glPopMatrix");
   pragma Import (StdCall, glPushMatrix,          "glPushMatrix");
   pragma Import (StdCall, glRasterPos3f,         "glRasterPos3f");
   pragma Import (StdCall, glRotatef,             "glRotatef");
   pragma Import (StdCall, glScalef,              "glScalef");
   pragma Import (StdCall, glShadeModel,          "glShadeModel");
   pragma Import (StdCall, glTexCoordPointer,     "glTexCoordPointer");
   pragma Import (StdCall, glTexEnvfv,            "glTexEnvfv");
   pragma Import (StdCall, glTexEnvi,             "glTexEnvi");
   pragma Import (StdCall, glTranslatef,          "glTranslatef");
   pragma Import (StdCall, glVertex2f,            "glVertex2f");
   pragma Import (StdCall, glVertex2fv,           "glVertex2fv");
   pragma Import (StdCall, glVertex3f,            "glVertex3f");
   pragma Import (StdCall, glVertex3fv,           "glVertex3fv");
   pragma Import (StdCall, glVertexPointer,       "glVertexPointer");

end GL.safe;

-- TODO:  Bind these missing functions, if needed.
--
--  GLAPI void   APIENTRY glColorSubTableEXT    (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *table);
--  GLAPI void   APIENTRY glColorTableEXT       (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
--  GLAPI void   APIENTRY glGetColorTableEXT    (GLenum target, GLenum format, GLenum type, GLvoid *table);
--  GLAPI void   APIENTRY glGetColorTableParameterivEXT
--                                              (GLenum target, GLenum pname, GLint *params);