lace_opengl_0.1.0_672a6415/source/lean/buffer/opengl-buffer-general.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
generic
   type base_Object   is new openGL.Buffer.Object with private;

   type Index         is range <>;
   type Element       is private;
   type Element_Array is array (Index range <>) of Element;

package openGL.Buffer.general
--
--  A generic for producing various types of openGL vertex buffer objects.
--
is
   type Object is new base_Object with private;
   type View   is access all Object'Class;


   ---------
   --  Forge
   --

   package Forge
   is
      function to_Buffer (From  : access constant Element_Array;
                          Usage : in              Buffer.Usage) return Object;

      function to_Buffer (From  : in              Element_Array;
                          Usage : in              Buffer.Usage) return  Object;
   end Forge;


   --------------
   --  Operations
   --

   procedure set (Self : in out Object;   Position : in              Positive     := 1;
                                          To       : in              Element_Array);

   procedure set (Self : in out Object;   Position : in              Positive     := 1;
                                          To       : access constant Element_Array);



private

   type Object is new base_Object with
      record
         Usage : Buffer.Usage;
      end record;

   default_Terminator : Element;       -- No 'Interfaces.C.Pointers' subprogram is called which uses the default terminator, so
                                       -- a default 'Element' should suffice.

end openGL.Buffer.general;