Add initial prototype.

This commit is contained in:
Rod Kay
2022-07-31 17:34:54 +10:00
commit 54a53b2ac0
1421 changed files with 358874 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
package body openGL.Surface.privvy
is
function to_GLX (Self : in Surface.item'Class) return glx.Drawable
is
begin
return Self.glx_Surface;
end to_GLX;
end openGL.Surface.privvy;

View File

@@ -0,0 +1,9 @@
with
GLX;
package openGL.Surface.privvy
is
function to_GLX (Self : in Surface.item'Class) return glx.Drawable;
end openGL.Surface.privvy;

View File

@@ -0,0 +1,10 @@
package body openGL.surface_Profile.privvy
is
function to_GLX (Self : in Item'Class) return glx.FBConfig
is
begin
return Self.glx_Config;
end to_GLX;
end openGL.surface_Profile.privvy;

View File

@@ -0,0 +1,6 @@
package openGL.surface_Profile.privvy
is
function to_GLX (Self : in Item'Class) return glx.FBConfig;
end openGL.surface_Profile.privvy;

View File

@@ -0,0 +1,34 @@
with
glx.Pointers,
interfaces.C;
package glx.Binding
is
function getCurrentContext return access ContextRec;
function getCurrentDrawable return Drawable;
procedure waitGL;
procedure waitX;
procedure useXFont (Font : in GLX.Font;
First : in C.int;
Count : in C.int;
List : in C.int);
function getCurrentReadDrawable return Drawable;
function get_visualid (Self : in Pointers.XVisualInfo_Pointer) return VisualID;
private
pragma Import (C, getCurrentContext, "glXGetCurrentContext");
pragma Import (C, getCurrentDrawable, "glXGetCurrentDrawable");
pragma Import (C, waitGL, "glXWaitGL");
pragma Import (C, waitX, "glXWaitX");
pragma Import (C, useXFont, "glXUseXFont");
pragma Import (C, getCurrentReadDrawable, "glXGetCurrentReadDrawable");
pragma Import (C, get_visualid, "Ada_get_visualid");
end glx.Binding;

View File

@@ -0,0 +1,32 @@
package glx.BufferSwapComplete
is
type Item is
record
the_Type : aliased C.int;
Serial : aliased C.unsigned_long;
send_Event : aliased Bool;
Display : System.Address;
Drawable : aliased glx.Drawable;
Event_type : aliased C.int;
UST : aliased Integer_64;
MSC : aliased Integer_64;
SBC : aliased Integer_64;
end record;
type Items is array (C.size_t range <>) of aliased BufferSwapComplete.item;
type Pointer is access all BufferSwapComplete.item;
type Pointers is array (C.size_t range <>) of aliased BufferSwapComplete.Pointer;
type Pointer_Pointer is access all BufferSwapComplete.Pointer;
function Construct return BufferSwapComplete.item;
private
pragma Import (C, Construct, "Ada_new_GLXBufferSwapComplete");
end glx.BufferSwapComplete;

View File

@@ -0,0 +1,14 @@
with
glx.Pointers;
package glx.Context
is
subtype Item is Pointers.ContextRec_Pointer;
type Pointer is access all Item;
type Pointer_Pointer is access all Pointer;
type Items is array (C.size_t range <>) of aliased Item;
type Pointers is array (C.size_t range <>) of aliased Pointer;
end glx.Context;

View File

@@ -0,0 +1,29 @@
with
glx.BufferSwapComplete,
glx.PbufferClobberEvent;
package glx.Event
is
type long_Array is array (C.size_t range <>) of aliased C.Long;
type Kind is (pBufferClobber,
BufferSwapComplete,
Pad);
type Item (Kind : Event.Kind := Event.Kind'First) is
record
case Kind is
when pBufferClobber => pBufferClobber : aliased glx.PBufferClobberEvent.item;
when BufferSwapComplete => BufferSwapComplete : aliased glx.BufferSwapComplete .item;
when Pad => Pad : aliased long_Array (0 .. 23);
end case;
end record
with unchecked_Union;
type Pointer is access all Item;
type Pointer_Pointer is access all Pointer;
type Items is array (C.size_t range <>) of aliased Item;
type Pointers is array (C.size_t range <>) of aliased Pointer;
end glx.Event;

View File

@@ -0,0 +1,26 @@
package glx.PbufferClobberEvent
is
type Item is
record
Event_Type : aliased C.int;
Draw_Type : aliased C.int;
Serial : aliased C.unsigned_long;
Send_Event : aliased glx.Bool;
Display : System.Address;
Drawable : aliased glx.Drawable;
Buffer_Mask : aliased C.unsigned;
aux_Buffer : aliased C.unsigned;
X : aliased C.int;
Y : aliased C.int;
Width : aliased C.int;
Height : aliased C.int;
Count : aliased C.int;
end record;
type Pointer is access all Item;
type Pointer_Pointer is access all Pointer;
type Items is array (C.size_t range <>) of aliased Item;
type Pointers is array (C.size_t range <>) of aliased Pointer;
end glx.PbufferClobberEvent;

View File

@@ -0,0 +1,24 @@
with
glx.Pointers;
package GLX.Pointer_Pointers
is
use glx.Pointers;
type VisualID_Pointer_Pointer is access all VisualID_Pointer;
type XVisualInfo_Pointer_Pointer is access all XVisualInfo_Pointer;
type Pixmap_Pointer_Pointer is access all Pixmap_Pointer;
type Font_Pointer_Pointer is access all Font_Pointer;
type Window_Pointer_Pointer is access all Window_Pointer;
type Bool_Pointer_Pointer is access all Bool_Pointer;
type ContextRec_Pointer_Pointer is access all ContextRec_Pointer;
type XID_Pointer_Pointer is access all XID_Pointer;
type GLXPixmap_Pointer_Pointer is access all GLXPixmap_Pointer;
type Drawable_Pointer_Pointer is access all Drawable_Pointer;
type FBConfig_Pointer_Pointer is access all FBConfig_Pointer;
type FBConfigID_Pointer_Pointer is access all FBConfigID_Pointer;
type ContextID_Pointer_Pointer is access all ContextID_Pointer;
type GLXWindow_Pointer_Pointer is access all Window_Pointer;
type PBuffer_Pointer_Pointer is access all PBuffer_Pointer;
end GLX.Pointer_Pointers;

View File

@@ -0,0 +1,78 @@
package GLX.Pointers
is
-- VisualID_Pointer
--
type VisualID_Pointer is access all VisualID;
type VisualID_Pointers is array (C.size_t range <>) of aliased VisualID_Pointer;
-- XVisualInfo_Pointer
--
type XVisualInfo_Pointer is access all XVisualInfo;
type XVisualInfo_Pointers is array (C.size_t range <>) of aliased XVisualInfo_Pointer;
-- Pixmap_Pointer
--
type Pixmap_Pointer is access all Pixmap;
type Pixmap_Pointers is array (C.size_t range <>) of aliased Pixmap_Pointer;
-- Font_Pointer
--
type Font_Pointer is access all Font;
type Font_Pointers is array (C.size_t range <>) of aliased Font_Pointer;
-- Window_Pointer
--
type Window_Pointer is access all Window;
type Window_Pointers is array (C.size_t range <>) of aliased Window_Pointer;
-- Bool_Pointer
--
type Bool_Pointer is access all Bool;
type Bool_Pointers is array (C.size_t range <>) of aliased Bool_Pointer;
-- ContextRec_Pointer
--
type ContextRec_Pointer is access all ContextRec;
type ContextRec_Pointers is array (C.size_t range <>) of aliased ContextRec_Pointer;
-- XID_Pointer
--
type XID_Pointer is access all XID;
type XID_Pointers is array (C.size_t range <>) of aliased XID_Pointer;
-- GLXPixmap_Pointer
--
type GLXPixmap_Pointer is access all GLXPixmap;
type GLXPixmap_Pointers is array (C.size_t range <>) of aliased GLXPixmap_Pointer;
-- Drawable_Pointer
--
type Drawable_Pointer is access all Drawable;
type Drawable_Pointers is array (C.size_t range <>) of aliased Drawable_Pointer;
-- FBConfig_Pointer
--
type FBConfig_Pointer is access all FBConfig;
type FBConfig_Pointers is array (C.size_t range <>) of aliased FBConfig_Pointer;
-- GLXFBConfigID_Pointer
--
type FBConfigID_Pointer is access all FBConfigID;
type FBConfigID_Pointers is array (C.size_t range <>) of aliased FBConfigID_Pointer;
-- GLXContextID_Pointer
--
type ContextID_Pointer is access all ContextID;
type ContextID_Pointers is array (C.size_t range <>) of aliased ContextID_Pointer;
-- GLXWindow_Pointer
--
type GLXWindow_Pointer is access all GLXWindow;
type GLXWindow_Pointers is array (C.size_t range <>) of aliased GLXWindow_Pointer;
-- PBuffer_Pointer
--
type PBuffer_Pointer is access all PBuffer;
type PBuffer_Pointers is array (C.size_t range <>) of aliased PBuffer_Pointer;
end GLX.Pointers;

View File

@@ -0,0 +1,253 @@
with
Interfaces.C,
System;
package GLX
is
use Interfaces;
---------
-- Types
--
-- XEventQueueOwner
--
type XEventQueueOwner is (nil);
for XEventQueueOwner use (nil => 0);
pragma Convention (C, XEventQueueOwner);
type XEventQueueOwner_Pointer is access all XEventQueueOwner;
type XEventQueueOwner_array is array (C.size_t range <>) of aliased XEventQueueOwner;
type XEventQueueOwner_Pointers is array (C.size_t range <>) of aliased XEventQueueOwner_Pointer;
-- XEventQueueOwner_Pointer_Pointer
--
type XEventQueueOwner_Pointer_Pointer is access all glx.XEventQueueOwner_Pointer;
-- VisualID
--
subtype VisualID is C.unsigned_long;
type VisualID_array is array (C.size_t range <>) of aliased VisualID;
-- XVisualInfo
--
subtype XVisualInfo is system.Address;
type XVisualInfo_array is array (C.size_t range <>) of aliased XVisualInfo;
-- Pixmap
--
subtype Pixmap is system.Address;
type Pixmap_array is array (C.size_t range <>) of aliased Pixmap;
-- Font
--
subtype Font is system.Address;
type Font_array is array (C.size_t range <>) of aliased Font;
-- Window
--
subtype Window is system.Address;
type Window_array is array (C.size_t range <>) of aliased Window;
-- Bool
--
subtype Bool is C.int;
type Bool_array is array (C.size_t range <>) of aliased Bool;
-- ContextRec
--
subtype ContextRec is system.Address;
type ContextRec_array is array (C.size_t range <>) of aliased ContextRec;
-- XID
--
subtype XID is system.Address;
type XID_array is array (C.size_t range <>) of aliased XID;
-- GLXPixmap
--
subtype GLXPixmap is XID;
type GLXPixmap_array is array (C.size_t range <>) of aliased glxPixmap;
-- GLXDrawable
--
subtype Drawable is glx.XID;
type Drawable_array is array (C.size_t range <>) of aliased Drawable;
-- FBConfig
--
subtype FBConfig is system.Address;
type FBConfig_array is array (C.size_t range <>) of aliased FBConfig;
-- FBConfigID
--
subtype FBConfigID is XID;
type FBConfigID_array is array (C.size_t range <>) of aliased FBConfigID;
-- ContextID
--
subtype ContextID is XID;
type ContextID_array is array (C.size_t range <>) of aliased ContextID;
-- Window
--
subtype GLXWindow is XID;
type GLXWindow_array is array (C.size_t range <>) of aliased GLXWindow;
-- GLXPbuffer
--
subtype PBuffer is XID;
type PBuffer_array is array (C.size_t range <>) of aliased PBuffer;
-------------
-- Constants
--
GLX_VERSION_1_1 : constant := 1;
GLX_VERSION_1_2 : constant := 1;
GLX_VERSION_1_3 : constant := 1;
GLX_VERSION_1_4 : constant := 1;
GLX_USE_GL : constant := 1;
GLX_BUFFER_SIZE : constant := 2;
GLX_LEVEL : constant := 3;
GLX_RGBA : constant := 4;
GLX_DOUBLEBUFFER : constant := 5;
GLX_STEREO : constant := 6;
GLX_AUX_BUFFERS : constant := 7;
GLX_RED_SIZE : constant := 8;
GLX_GREEN_SIZE : constant := 9;
GLX_BLUE_SIZE : constant := 10;
GLX_ALPHA_SIZE : constant := 11;
GLX_DEPTH_SIZE : constant := 12;
GLX_STENCIL_SIZE : constant := 13;
GLX_ACCUM_RED_SIZE : constant := 14;
GLX_ACCUM_GREEN_SIZE : constant := 15;
GLX_ACCUM_BLUE_SIZE : constant := 16;
GLX_ACCUM_ALPHA_SIZE : constant := 17;
GLX_BAD_SCREEN : constant := 1;
GLX_BAD_ATTRIBUTE : constant := 2;
GLX_NO_EXTENSION : constant := 3;
GLX_BAD_VISUAL : constant := 4;
GLX_BAD_CONTEXT : constant := 5;
GLX_BAD_VALUE : constant := 6;
GLX_BAD_ENUM : constant := 7;
GLX_VENDOR : constant := 1;
GLX_VERSION : constant := 2;
GLX_EXTENSIONS : constant := 3;
GLX_CONFIG_CAVEAT : constant := 16#20#;
GLX_DONT_CARE : constant := 16#ffffffff#;
GLX_X_VISUAL_TYPE : constant := 16#22#;
GLX_TRANSPARENT_TYPE : constant := 16#23#;
GLX_TRANSPARENT_INDEX_VALUE : constant := 16#24#;
GLX_TRANSPARENT_RED_VALUE : constant := 16#25#;
GLX_TRANSPARENT_GREEN_VALUE : constant := 16#26#;
GLX_TRANSPARENT_BLUE_VALUE : constant := 16#27#;
GLX_TRANSPARENT_ALPHA_VALUE : constant := 16#28#;
GLX_WINDOW_BIT : constant := 16#1#;
GLX_PIXMAP_BIT : constant := 16#2#;
GLX_PBUFFER_BIT : constant := 16#4#;
GLX_AUX_BUFFERS_BIT : constant := 16#10#;
GLX_FRONT_LEFT_BUFFER_BIT : constant := 16#1#;
GLX_FRONT_RIGHT_BUFFER_BIT : constant := 16#2#;
GLX_BACK_LEFT_BUFFER_BIT : constant := 16#4#;
GLX_BACK_RIGHT_BUFFER_BIT : constant := 16#8#;
GLX_DEPTH_BUFFER_BIT : constant := 16#20#;
GLX_STENCIL_BUFFER_BIT : constant := 16#40#;
GLX_ACCUM_BUFFER_BIT : constant := 16#80#;
GLX_NONE : constant := 16#8000#;
GLX_SLOW_CONFIG : constant := 16#8001#;
GLX_TRUE_COLOR : constant := 16#8002#;
GLX_DIRECT_COLOR : constant := 16#8003#;
GLX_PSEUDO_COLOR : constant := 16#8004#;
GLX_STATIC_COLOR : constant := 16#8005#;
GLX_GRAY_SCALE : constant := 16#8006#;
GLX_STATIC_GRAY : constant := 16#8007#;
GLX_TRANSPARENT_RGB : constant := 16#8008#;
GLX_TRANSPARENT_INDEX : constant := 16#8009#;
GLX_VISUAL_ID : constant := 16#800b#;
GLX_SCREEN : constant := 16#800c#;
GLX_NON_CONFORMANT_CONFIG : constant := 16#800d#;
GLX_DRAWABLE_TYPE : constant := 16#8010#;
GLX_RENDER_TYPE : constant := 16#8011#;
GLX_X_RENDERABLE : constant := 16#8012#;
GLX_FBCONFIG_ID : constant := 16#8013#;
GLX_RGBA_TYPE : constant := 16#8014#;
GLX_COLOR_INDEX_TYPE : constant := 16#8015#;
GLX_MAX_PBUFFER_WIDTH : constant := 16#8016#;
GLX_MAX_PBUFFER_HEIGHT : constant := 16#8017#;
GLX_MAX_PBUFFER_PIXELS : constant := 16#8018#;
GLX_PRESERVED_CONTENTS : constant := 16#801b#;
GLX_LARGEST_PBUFFER : constant := 16#801c#;
GLX_WIDTH : constant := 16#801d#;
GLX_HEIGHT : constant := 16#801e#;
GLX_EVENT_MASK : constant := 16#801f#;
GLX_DAMAGED : constant := 16#8020#;
GLX_SAVED : constant := 16#8021#;
GLX_WINDOW : constant := 16#8022#;
GLX_PBUFFER : constant := 16#8023#;
GLX_PBUFFER_HEIGHT : constant := 16#8040#;
GLX_PBUFFER_WIDTH : constant := 16#8041#;
GLX_RGBA_BIT : constant := 16#1#;
GLX_COLOR_INDEX_BIT : constant := 16#2#;
GLX_PBUFFER_CLOBBER_MASK : constant := 16#8000000#;
GLX_SAMPLE_BUFFERS : constant := 16#186a0#;
GLX_SAMPLES : constant := 16#186a1#;
GLX_PbufferClobber : constant := 0;
GLX_BufferSwapComplete : constant := 1;
a_a_GLX_NUMBER_EVENTS : constant := 17;
GLX_ARB_render_texture : constant := 1;
GLX_EXT_texture_from_pixmap : constant := 1;
GLX_BIND_TO_TEXTURE_RGB_EXT : constant := 16#20d0#;
GLX_BIND_TO_TEXTURE_RGBA_EXT : constant := 16#20d1#;
GLX_BIND_TO_MIPMAP_TEXTURE_EXT : constant := 16#20d2#;
GLX_BIND_TO_TEXTURE_TARGETS_EXT : constant := 16#20d3#;
GLX_Y_INVERTED_EXT : constant := 16#20d4#;
GLX_TEXTURE_FORMAT_EXT : constant := 16#20d5#;
GLX_TEXTURE_TARGET_EXT : constant := 16#20d6#;
GLX_MIPMAP_TEXTURE_EXT : constant := 16#20d7#;
GLX_TEXTURE_FORMAT_NONE_EXT : constant := 16#20d8#;
GLX_TEXTURE_FORMAT_RGB_EXT : constant := 16#20d9#;
GLX_TEXTURE_FORMAT_RGBA_EXT : constant := 16#20da#;
GLX_TEXTURE_1D_BIT_EXT : constant := 16#1#;
GLX_TEXTURE_2D_BIT_EXT : constant := 16#2#;
GLX_TEXTURE_RECTANGLE_BIT_EXT : constant := 16#4#;
GLX_TEXTURE_1D_EXT : constant := 16#20db#;
GLX_TEXTURE_2D_EXT : constant := 16#20dc#;
GLX_TEXTURE_RECTANGLE_EXT : constant := 16#20dd#;
GLX_FRONT_LEFT_EXT : constant := 16#20de#;
GLX_FRONT_RIGHT_EXT : constant := 16#20df#;
GLX_BACK_LEFT_EXT : constant := 16#20e0#;
GLX_BACK_RIGHT_EXT : constant := 16#20e1#;
GLX_FRONT_EXT : constant := 16#20de#;
GLX_BACK_EXT : constant := 16#20e0#;
GLX_AUX0_EXT : constant := 16#20e2#;
GLX_AUX1_EXT : constant := 16#20e3#;
GLX_AUX2_EXT : constant := 16#20e4#;
GLX_AUX3_EXT : constant := 16#20e5#;
GLX_AUX4_EXT : constant := 16#20e6#;
GLX_AUX5_EXT : constant := 16#20e7#;
GLX_AUX6_EXT : constant := 16#20e8#;
GLX_AUX7_EXT : constant := 16#20e9#;
GLX_AUX8_EXT : constant := 16#20ea#;
GLX_AUX9_EXT : constant := 16#20eb#;
end GLX;

View File

@@ -0,0 +1,18 @@
#ifdef __cplusplus
extern "C"
{
#endif
#include "GL/glx.h"
VisualID
get_visualid (XVisualInfo* Self)
{
return Self->visualid;
}
#ifdef __cplusplus
}
#endif