opengl: Cosmetics.

This commit is contained in:
Rod Kay
2025-10-22 14:11:39 +11:00
parent 3e11a52f5d
commit 50821bb787
60 changed files with 304 additions and 520 deletions

View File

@@ -4,6 +4,7 @@ with
GL.Pointers;
package body openGL.Buffer.general
is
--------------------------
@@ -53,6 +54,7 @@ is
From'Size / 8,
+From (From'First)'Address,
to_GL_Enum (Usage));
Errors.log;
end return;
end to_Buffer;
@@ -78,6 +80,7 @@ is
Offset => GLintptr ((Position - 1) * Vertex_Size_in_bits / 8),
Size => new_Vertices'Size / 8,
Data => +new_Vertices (new_Vertices'First)'Address);
Errors.log;
else
Self.destroy;
@@ -89,9 +92,8 @@ is
To'Size / 8,
+To (To'First)'Address,
to_GL_Enum (Self.Usage));
Errors.log;
end if;
Errors.log;
end set;

View File

@@ -5,6 +5,7 @@ generic
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.

View File

@@ -1,6 +1,7 @@
with
openGL.Buffer.general;
package openGL.Buffer.indices is new openGL.Buffer.general (base_Object => Buffer.element_array_Object,
Index => long_Index_t,
Element => Index_t,

View File

@@ -1,6 +1,7 @@
with
openGL.Buffer.general;
package openGL.Buffer.long_indices is new openGL.Buffer.general (base_Object => Buffer.element_array_Object,
Index => long_Index_t,
Element => long_Index_t,

View File

@@ -1,6 +1,7 @@
with
openGL.Buffer.general;
package openGL.Buffer.normals is new openGL.Buffer.general (base_Object => Buffer.array_Object,
Index => Index_t,
Element => Normal,

View File

@@ -1,6 +1,7 @@
with
openGL.Buffer.general;
package openGL.Buffer.short_indices is new openGL.Buffer.general (base_Object => Buffer.element_array_Object,
Index => long_Index_t,
Element => short_Index_t,

View File

@@ -1,6 +1,7 @@
with
openGL.Buffer.general;
package openGL.Buffer.texture_coords is new openGL.Buffer.general (base_Object => Buffer.array_Object,
Index => Index_t,
Element => Coordinate_2D,

View File

@@ -1,6 +1,7 @@
with
openGL.Buffer.general;
package openGL.Buffer.vertex is new openGL.Buffer.general (base_Object => Buffer.array_Object,
Index => Index_t,
Element => Site,

View File

@@ -3,6 +3,7 @@ with
openGL.Tasks,
ada.unchecked_Deallocation;
package body openGL.Buffer
is
use type a_Name;
@@ -17,7 +18,7 @@ is
Name : aliased a_Name;
begin
Tasks.check;
glGenBuffers (1, Name'unchecked_Access);
glGenBuffers (1, Name'unchecked_Access); Errors.log;
return Name;
end new_vbo_Name;
@@ -28,8 +29,9 @@ is
Name : aliased a_Name := vbo_Name;
begin
Tasks.check;
glDeleteBuffers (1, Name'unchecked_Access);
glDeleteBuffers (1, Name'unchecked_Access); Errors.log;
end free;
pragma Unreferenced (free);

View File

@@ -3,6 +3,7 @@ with
GL.lean,
ada.unchecked_Conversion;
package openGL.Buffer
--
-- Models a buffer object.
@@ -11,7 +12,7 @@ is
--------------
--- Core Types
--
subtype a_Name is GL.GLuint; -- An openGL vertex buffer 'Name', which is a natural integer.
subtype a_Name is GL.GLuint; -- An openGL vertex buffer 'Name'.
type a_Kind is (array_Buffer, element_array_Buffer);
type Usage is (stream_Draw, static_Draw, dynamic_Draw);
@@ -121,4 +122,5 @@ private
--
procedure verify_Name (Self : in out Object'Class);
end openGL.Buffer;