with Interfaces.C.Pointers;
generic
type base_Object is new GL.Buffer.Object with private;
type Index is mod <>;
type Element is private;
type Element_Array is array (Index range <>) of aliased Element;
package GL.Buffer.general is
pragma Elaborate_Body;
type General_Object is new base_Object with private;
function To_Buffer (From : access Element_Array; Usage : VBO_Usage) return General_Object;
procedure Set (Self : in out General_Object;
Set_Position : Positive := 1;
To : Element_Array);
function Get (Self : access General_Object) return Element_Array;
type memory_Map is abstract tagged private;
procedure Release (Self : memory_Map);
Corrupt_Buffer : exception;
type read_only_Map is new memory_Map with private;
function Map (Self : access General_Object) return read_only_Map'Class;
function Get (Self : read_only_Map; Get_Position : Index) return Element;
function Get (Self : read_only_Map; Get_Position : Index; Count : Positive) return Element_Array;
type write_only_Map is new memory_Map with private;
function Map (Self : access General_Object) return write_only_Map'Class;
procedure Set (Self : write_only_Map; Set_Position : Index; To : access Element);
procedure Set (Self : write_only_Map; Set_Position : Index; To : Element);
type read_write_Map is new memory_Map with private;
function Map (Self : access General_Object) return read_write_Map'Class;
function Get (Self : read_write_Map; Get_Position : Index) return Element;
function Get (Self : read_write_Map; Get_Position : Index; Count : Positive) return Element_Array;
procedure Set (Self : read_write_Map; Set_Position : Index; To : access Element);
procedure Set (Self : read_write_Map; Set_Position : Index; To : Element);
private
type General_Object is new base_Object with null record;
default_Terminator : Element;
pragma Warnings (Off, """default_Terminator"" may be referenced before it has a value");
package Element_Pointers is new interfaces.C.Pointers (Index, Element, Element_Array, default_Terminator);
pragma Warnings (On, """default_Terminator"" may be referenced before it has a value");
type memory_Map is abstract tagged
record
vbo_Target : GL.VBO_Target;
Data : Element_Pointers.Pointer;
Last : Index;
end record;
type read_only_Map is new memory_Map with null record;
type write_only_Map is new memory_Map with null record;
type read_write_Map is new memory_Map with null record;
end GL.Buffer.general;