Add initial prototype.
This commit is contained in:
40
3-mid/opengl/source/platform/glx/opengl-context.adb
Normal file
40
3-mid/opengl/source/platform/glx/opengl-context.adb
Normal file
@@ -0,0 +1,40 @@
|
||||
with
|
||||
glx.Pointers;
|
||||
|
||||
package body openGL.Context -- TODO: Finish this package.
|
||||
is
|
||||
|
||||
procedure define (Self : in out Item; Profile : in openGL.surface_Profile.item'Class)
|
||||
|
||||
is
|
||||
pragma Unreferenced (Profile);
|
||||
use GlX,
|
||||
glx.Pointers;
|
||||
begin
|
||||
if Self.glx_Context = null
|
||||
then
|
||||
raise Program_Error with "No openGL context";
|
||||
end if;
|
||||
end define;
|
||||
|
||||
|
||||
|
||||
procedure make_Current (Self : in Item; read_Surface : in Surface.item;
|
||||
write_Surface : in Surface.item)
|
||||
is
|
||||
pragma Unreferenced (write_Surface);
|
||||
Success : glx.Bool with Unreferenced;
|
||||
begin
|
||||
null;
|
||||
end make_Current;
|
||||
|
||||
|
||||
|
||||
function glx_Context_debug (Self : in Item'Class) return glx.Context.item
|
||||
is
|
||||
begin
|
||||
return Self.glx_Context;
|
||||
end glx_Context_debug;
|
||||
|
||||
|
||||
end openGL.Context;
|
||||
31
3-mid/opengl/source/platform/glx/opengl-context.ads
Normal file
31
3-mid/opengl/source/platform/glx/opengl-context.ads
Normal file
@@ -0,0 +1,31 @@
|
||||
with
|
||||
openGL.surface_Profile,
|
||||
openGL.Surface,
|
||||
glx.Context;
|
||||
|
||||
package openGL.Context
|
||||
--
|
||||
-- Models an openGL (GLX) context.
|
||||
--
|
||||
is
|
||||
type Item is tagged private;
|
||||
type View is access all Item'Class;
|
||||
|
||||
|
||||
procedure define (Self : in out Item; Profile : in surface_Profile.item'Class);
|
||||
|
||||
procedure make_Current (Self : in Item; read_Surface : in Surface.item;
|
||||
write_Surface : in Surface.item);
|
||||
|
||||
function glx_Context_debug (Self : in Item'Class) return glx.Context.item; -- For debugging.
|
||||
|
||||
|
||||
|
||||
private
|
||||
|
||||
type Item is tagged
|
||||
record
|
||||
glx_Context : aliased glx.Context.item;
|
||||
end record;
|
||||
|
||||
end openGL.Context;
|
||||
18
3-mid/opengl/source/platform/glx/opengl-screen.ads
Normal file
18
3-mid/opengl/source/platform/glx/opengl-screen.ads
Normal file
@@ -0,0 +1,18 @@
|
||||
package openGL.Screen
|
||||
--
|
||||
-- Models an openGL screen.
|
||||
--
|
||||
is
|
||||
|
||||
type Item is tagged limited private;
|
||||
|
||||
|
||||
|
||||
private
|
||||
|
||||
type Item is tagged limited
|
||||
record
|
||||
null;
|
||||
end record;
|
||||
|
||||
end openGL.Screen;
|
||||
45
3-mid/opengl/source/platform/glx/opengl-surface.adb
Normal file
45
3-mid/opengl/source/platform/glx/opengl-surface.adb
Normal file
@@ -0,0 +1,45 @@
|
||||
with
|
||||
openGL.Context,
|
||||
interfaces.C;
|
||||
|
||||
package body openGL.Surface -- TODO: Finish this package.
|
||||
is
|
||||
use Glx,
|
||||
Interfaces;
|
||||
|
||||
visual_Attributes : array (Positive range <>) of aliased C.int := (GLX_X_RENDERABLE, 1,
|
||||
GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
|
||||
GLX_RENDER_TYPE, GLX_RGBA_BIT,
|
||||
GLX_X_VISUAL_TYPE, GLX_TRUE_COLOR,
|
||||
GLX_RED_SIZE, 8,
|
||||
GLX_GREEN_SIZE, 8,
|
||||
GLX_BLUE_SIZE, 8,
|
||||
GLX_ALPHA_SIZE, 8,
|
||||
GLX_DEPTH_SIZE, 24,
|
||||
GLX_STENCIL_SIZE, 8,
|
||||
GLX_DOUBLEBUFFER, 1,
|
||||
0);
|
||||
|
||||
|
||||
procedure define (Self : in out Item; Profile : in surface_Profile.item'Class;
|
||||
Window_Id : in Natural)
|
||||
is
|
||||
pragma Unreferenced (Window_Id);
|
||||
-- the_Profile : constant surface_Profile.item'Class := Profile;
|
||||
begin
|
||||
null;
|
||||
end define;
|
||||
|
||||
|
||||
|
||||
-- Operations
|
||||
--
|
||||
|
||||
procedure swap_Buffers (Self : in Item)
|
||||
is
|
||||
begin
|
||||
null;
|
||||
end swap_Buffers;
|
||||
|
||||
|
||||
end openGL.Surface;
|
||||
41
3-mid/opengl/source/platform/glx/opengl-surface.ads
Normal file
41
3-mid/opengl/source/platform/glx/opengl-surface.ads
Normal file
@@ -0,0 +1,41 @@
|
||||
with
|
||||
openGL.surface_Profile;
|
||||
|
||||
private
|
||||
with
|
||||
Glx;
|
||||
|
||||
limited private
|
||||
with
|
||||
openGL.Context;
|
||||
|
||||
package openGL.Surface
|
||||
--
|
||||
-- Models an openGL surface.
|
||||
--
|
||||
is
|
||||
type Item is tagged private;
|
||||
type Items is array (Positive range <>) of aliased Item;
|
||||
|
||||
type View is access all Item'Class;
|
||||
type Views is array (Positive range <>) of View;
|
||||
|
||||
|
||||
procedure define (Self : in out Item; Profile : in surface_Profile.item'Class;
|
||||
Window_Id : in Natural);
|
||||
|
||||
-- Operations
|
||||
--
|
||||
procedure swap_Buffers (Self : in Item);
|
||||
|
||||
|
||||
|
||||
private
|
||||
|
||||
type Item is tagged
|
||||
record
|
||||
glx_Surface : glx.Drawable;
|
||||
Context : access openGL.Context.item'Class;
|
||||
end record;
|
||||
|
||||
end openGL.Surface;
|
||||
105
3-mid/opengl/source/platform/glx/opengl-surface_profile.adb
Normal file
105
3-mid/opengl/source/platform/glx/opengl-surface_profile.adb
Normal file
@@ -0,0 +1,105 @@
|
||||
with
|
||||
interfaces.C,
|
||||
ada.unchecked_Conversion;
|
||||
|
||||
package body openGL.surface_Profile -- TODO: Finish this package.
|
||||
is
|
||||
use Interfaces,
|
||||
GLX;
|
||||
|
||||
visual_Attributes : array (Positive range <>) of aliased C.int := (GLX_X_RENDERABLE, 1,
|
||||
GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
|
||||
GLX_RENDER_TYPE, GLX_RGBA_BIT,
|
||||
GLX_X_VISUAL_TYPE, GLX_TRUE_COLOR,
|
||||
GLX_RED_SIZE, 8,
|
||||
GLX_GREEN_SIZE, 8,
|
||||
GLX_BLUE_SIZE, 8,
|
||||
GLX_ALPHA_SIZE, 8,
|
||||
GLX_DEPTH_SIZE, 24,
|
||||
GLX_STENCIL_SIZE, 8,
|
||||
GLX_DOUBLEBUFFER, 1,
|
||||
-- GLX_SAMPLE_BUFFERS , 1,
|
||||
-- GLX_SAMPLES , 4,
|
||||
0);
|
||||
|
||||
|
||||
procedure define (Self : in out Item; Screen : access openGL.Screen.item'Class;
|
||||
Desired : in Qualities := default_Qualities)
|
||||
is
|
||||
pragma Unreferenced (Desired);
|
||||
|
||||
-- num_fb_configs : aliased C.int := 0;
|
||||
-- visual_Id : aliased C.int;
|
||||
Unused : C.int with Unreferenced;
|
||||
begin
|
||||
null;
|
||||
end define;
|
||||
|
||||
|
||||
|
||||
function get_Visual (Self : in Item) return access glx.XVisualInfo
|
||||
is
|
||||
begin
|
||||
return Self.Visual;
|
||||
end get_Visual;
|
||||
|
||||
|
||||
|
||||
function fetch_All return surface_Profile.items
|
||||
is
|
||||
begin
|
||||
raise Program_Error with "TBD";
|
||||
return (1 .. 0 => <>);
|
||||
end fetch_All;
|
||||
|
||||
|
||||
|
||||
function Quality (Self : in Item) return Qualities
|
||||
is
|
||||
pragma Unreferenced (Self);
|
||||
begin
|
||||
raise Program_Error with "TBD";
|
||||
return (others => <>);
|
||||
end Quality;
|
||||
|
||||
|
||||
|
||||
function value_Image (Value : in Natural) return String
|
||||
is
|
||||
begin
|
||||
if Value = Irrelevant then
|
||||
return "Irrelevant";
|
||||
else
|
||||
return Natural'Image (Value);
|
||||
end if;
|
||||
end value_Image;
|
||||
|
||||
|
||||
|
||||
function Image (Self : in color_Buffer) return String
|
||||
is
|
||||
begin
|
||||
return "("
|
||||
& "Bits_red =>" & value_Image (Self.Bits_red)
|
||||
& ", Bits_green =>" & value_Image (Self.Bits_green)
|
||||
& ", Bits_blue =>" & value_Image (Self.Bits_blue)
|
||||
& ", Bits_luminence =>" & value_Image (Self.Bits_luminence)
|
||||
& ", Bits_alpha =>" & value_Image (Self.Bits_alpha)
|
||||
& ", Bits_alpha_mask =>" & value_Image (Self.Bits_alpha_mask)
|
||||
& ")";
|
||||
end Image;
|
||||
|
||||
|
||||
|
||||
function Image (Self : in Qualities) return String
|
||||
is
|
||||
begin
|
||||
return "("
|
||||
& Image (Self.color_Buffer)
|
||||
& ", depth_buffer_Bits =>" & value_Image (Self. depth_buffer_Bits)
|
||||
& ", stencil_buffer_Bits => " & value_Image (Self.stencil_buffer_Bits)
|
||||
& ")";
|
||||
end Image;
|
||||
|
||||
|
||||
end openGL.surface_Profile;
|
||||
90
3-mid/opengl/source/platform/glx/opengl-surface_profile.ads
Normal file
90
3-mid/opengl/source/platform/glx/opengl-surface_profile.ads
Normal file
@@ -0,0 +1,90 @@
|
||||
with
|
||||
openGL.Screen,
|
||||
GLX;
|
||||
|
||||
package openGL.surface_Profile
|
||||
--
|
||||
-- Models an openGL surface profile.
|
||||
--
|
||||
is
|
||||
type Item is tagged private;
|
||||
type View is access all Item'Class;
|
||||
|
||||
type Items is array (Positive range <>) of Item;
|
||||
type Views is array (Positive range <>) of View;
|
||||
|
||||
|
||||
-------------------
|
||||
-- Surface Quality
|
||||
--
|
||||
|
||||
Irrelevant : constant Natural := Natural'Last;
|
||||
|
||||
type color_Buffer is
|
||||
record
|
||||
Bits_red : Natural := Irrelevant;
|
||||
Bits_green : Natural := Irrelevant;
|
||||
Bits_blue : Natural := Irrelevant;
|
||||
|
||||
Bits_luminence : Natural := Irrelevant;
|
||||
|
||||
Bits_alpha : Natural := Irrelevant;
|
||||
Bits_alpha_mask : Natural := Irrelevant;
|
||||
end record;
|
||||
|
||||
function Image (Self : in color_Buffer) return String;
|
||||
|
||||
|
||||
type Qualities is
|
||||
record
|
||||
color_Buffer : surface_Profile.color_Buffer;
|
||||
depth_buffer_Bits : Natural := Irrelevant;
|
||||
stencil_buffer_Bits : Natural := Irrelevant;
|
||||
end record;
|
||||
|
||||
default_Qualities : constant Qualities;
|
||||
|
||||
function Image (Self : in Qualities) return String;
|
||||
|
||||
|
||||
---------
|
||||
-- Forge
|
||||
--
|
||||
|
||||
desired_Qualitites_unavailable : exception;
|
||||
|
||||
procedure define (Self : in out Item; Screen : access openGL.Screen.item'Class;
|
||||
Desired : in Qualities := default_Qualities);
|
||||
|
||||
function fetch_All return surface_Profile.items;
|
||||
|
||||
|
||||
--------------
|
||||
-- Attributes
|
||||
--
|
||||
|
||||
function Quality (Self : in Item) return Qualities;
|
||||
function get_Visual (Self : in Item) return access glx.XVisualInfo;
|
||||
|
||||
|
||||
|
||||
private
|
||||
|
||||
type Item is tagged
|
||||
record
|
||||
glx_Config : glx.FBConfig;
|
||||
Visual : access glx.XVisualInfo;
|
||||
end record;
|
||||
|
||||
|
||||
default_Qualities : constant Qualities := (color_Buffer => (Bits_red => 8,
|
||||
Bits_green => 8,
|
||||
Bits_blue => 8,
|
||||
|
||||
Bits_luminence => Irrelevant,
|
||||
|
||||
Bits_alpha => Irrelevant,
|
||||
Bits_alpha_mask => Irrelevant),
|
||||
depth_buffer_Bits => 24,
|
||||
stencil_buffer_Bits => Irrelevant);
|
||||
end openGL.surface_Profile;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
29
3-mid/opengl/source/platform/glx/private/thin/glx-event.ads
Normal file
29
3-mid/opengl/source/platform/glx/private/thin/glx-event.ads
Normal 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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
253
3-mid/opengl/source/platform/glx/private/thin/glx.ads
Normal file
253
3-mid/opengl/source/platform/glx/private/thin/glx.ads
Normal 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;
|
||||
18
3-mid/opengl/source/platform/glx/private/thin/glx_wrap.c
Normal file
18
3-mid/opengl/source/platform/glx/private/thin/glx_wrap.c
Normal 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
|
||||
Reference in New Issue
Block a user