opengl: Fix simple warnings and cosmetics.

This commit is contained in:
Rod Kay
2025-09-20 12:31:05 +10:00
parent b679ac4bf5
commit f8cdf27998
46 changed files with 83 additions and 949 deletions

View File

@@ -1,30 +1,22 @@
with
openGL.Geometry.texturing,
openGL.Buffer.general,
openGL.Model,
openGL.Shader,
openGL.Program.lit,
openGL.Attribute,
openGL.Texture,
openGL.Palette,
openGL.Tasks,
openGL.Errors,
GL.lean,
GL.Pointers,
ada.Strings.fixed,
Interfaces.C.Strings,
System.storage_Elements;
-- with ada.Text_IO; use ada.Text_IO;
package body openGL.Geometry.lit_textured
is
use GL.lean,
GL.Pointers,
openGL.texture_Set,
Interfaces;
-----------
@@ -34,8 +26,7 @@ is
vertex_Shader : aliased Shader.item;
fragment_Shader : aliased Shader.item;
the_Program : openGL.Program.lit.view;
white_Texture : openGL.Texture.Object;
the_Program : openGL.Program.lit.view;
Name_1 : constant String := "Site";
Name_2 : constant String := "Normal";
@@ -52,8 +43,6 @@ is
Attribute_3_Name_ptr : aliased constant C.strings.chars_ptr := C.strings.to_chars_ptr (Attribute_3_Name'Access);
Attribute_4_Name_ptr : aliased constant C.strings.chars_ptr := C.strings.to_chars_ptr (Attribute_4_Name'Access);
-- texture_Uniforms : texturing.Uniforms;
---------
@@ -62,8 +51,7 @@ is
procedure create_Program
is
use Palette,
Attribute.Forge,
use Attribute.Forge,
System.storage_Elements;
use type system.Address;
@@ -75,11 +63,7 @@ is
Attribute_3 : Attribute.view;
Attribute_4 : Attribute.view;
white_Image : constant Image := [1 .. 2 => [1 .. 2 => +White]];
begin
white_Texture := openGL.Texture.Forge.to_Texture (white_Image);
vertex_Shader .define (Shader.Vertex, "assets/opengl/shader/lit_textured.vert");
fragment_Shader.define (Shader.Fragment, (asset_Names' (1 => to_Asset ("assets/opengl/shader/version.header"),
2 => to_Asset ("assets/opengl/shader/texturing-frag.snippet"),
@@ -150,27 +134,6 @@ is
name => +Attribute_4_Name_ptr);
Errors.log;
--- Set up the texturing uniforms.
--
-- for Id in texture_Id'Range
-- loop
-- declare
-- use ada.Strings,
-- ada.Strings.fixed;
--
-- i : constant Positive := Positive (Id);
-- texture_uniform_Name : constant String := "Textures[" & trim (Natural'Image (i - 1), Left) & "]";
-- fade_uniform_Name : constant String := "Fade[" & trim (Natural'Image (i - 1), Left) & "]";
-- begin
-- texture_Uniforms.Textures (Id).texture_Uniform := the_Program.uniform_Variable (named => texture_uniform_Name);
-- texture_Uniforms.Textures (Id). fade_Uniform := the_Program.uniform_Variable (named => fade_uniform_Name);
-- end;
-- end loop;
--
-- texture_Uniforms.Count := the_Program.uniform_Variable ("texture_Count");
textured_Geometry.create_Uniforms (for_Program => the_Program.all'Access);
end create_Program;
@@ -291,75 +254,4 @@ is
end Indices_are;
--- Texturing
--
-- procedure Fade_is (Self : in out Item; Which : texture_ID; Now : in texture_Set.fade_Level)
-- is
-- begin
-- Self.texture_Set.Textures (which).Fade := Now;
-- end Fade_is;
--
--
--
-- function Fade (Self : in Item; Which : texture_Set.texture_ID) return texture_Set.fade_Level
-- is
-- begin
-- return Self.texture_Set.Textures (which).Fade;
-- end Fade;
--
--
--
-- procedure Texture_is (Self : in out Item; Which : texture_ID; Now : in openGL.Texture.Object)
-- is
-- begin
-- Texture_is (in_Set => Self.texture_Set,
-- Which => Which,
-- Now => Now);
-- end Texture_is;
--
--
--
-- function Texture (Self : in Item; Which : texture_ID) return openGL.Texture.Object
-- is
-- begin
-- return openGL.texture_Set.Texture (in_Set => Self.texture_Set,
-- Which => Which);
-- end Texture;
--
--
--
-- overriding
-- procedure Texture_is (Self : in out Item; Now : in openGL.Texture.Object)
-- is
-- begin
-- Texture_is (in_Set => Self.texture_Set,
-- Now => Now);
-- end Texture_is;
--
--
--
-- overriding
-- function Texture (Self : in Item) return openGL.Texture.Object
-- is
-- begin
-- return texture_Set.Texture (in_Set => Self.texture_Set,
-- Which => 1);
-- end Texture;
-- overriding
-- procedure enable_Textures (Self : in out Item)
-- is
-- begin
-- texturing.enable (for_Model => Self.Model.all'Access,
-- Uniforms => texture_Uniforms,
-- texture_Set => Self.texture_Set);
-- end enable_Textures;
end openGL.Geometry.lit_textured;