openglada_0.9.0_4deb7eff/src/interface/gl-immediate.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
--  part of OpenGLAda, (c) 2017 Felix Krause
--  released under the terms of the MIT license, see the file "COPYING"

with Ada.Finalization;

with GL.Types.Colors;

-- This package provides functions to directly insert vertices, colors, normals
-- etc. into the pipeline. Note that these functions have been deprecated with
-- OpenGL 3, you should use VBOs instead.
package GL.Immediate is
   pragma Preelaborate;

   use GL.Types;
   use GL.Types.Doubles;

   type Input_Token (<>) is new Ada.Finalization.Limited_Controlled with private;

   overriding procedure Finalize (Token : in out Input_Token);

   function Start (Mode : Connection_Mode) return Input_Token;

   procedure Add_Vertex (Token : Input_Token; Vertex : Vector2);
   procedure Add_Vertex (Token : Input_Token; Vertex : Vector3);
   procedure Add_Vertex (Token : Input_Token; Vertex : Vector4);

   procedure Set_Color (Value : Colors.Color);
   function Current_Color return Colors.Color;

   procedure Set_Secondary_Color (Value : Colors.Color);
   function Current_Secondary_Color return Colors.Color;

   procedure Set_Fog_Distance (Value : Double);
   function Current_Fog_Distance return Double;

   procedure Set_Normal (Value : Vector3);
   function Current_Normal return Vector3;

   procedure Set_Texture_Coordinates (Value : Vector2);
   procedure Set_Texture_Coordinates (Value : Vector3);
   procedure Set_Texture_Coordinates (Value : Vector4);
   function Current_Texture_Coordinates return Vector4;


private
   type Input_Token (Mode : Connection_Mode) is
     new Ada.Finalization.Limited_Controlled with record
      Finalized : Boolean := True;
   end record;
end GL.Immediate;