opengl.geometry: Use the 'openGL.Variable.uniform.sampler2D' type for textures.

This commit is contained in:
Rod Kay
2023-05-05 01:06:18 +10:00
parent 6a8da0bd4b
commit b9064c43c8
2 changed files with 37 additions and 23 deletions

View File

@@ -2,12 +2,15 @@ with
openGL.Primitive,
openGL.Buffer,
openGL.Program,
openGL.Texture;
openGL.Texture,
openGL.Variable.uniform;
private
with
ada.Strings.unbounded;
package openGL.Geometry
--
-- Provides a base class for openGL geometry.
@@ -62,9 +65,10 @@ is
type fadeable_Texture is
record
Fade : fade_Level := 0.0;
Object : openGL.Texture.Object := openGL.Texture.null_Object;
uniform_Location : GL.GLint := 0;
Fade : fade_Level := 0.0;
Object : openGL.Texture.Object := openGL.Texture.null_Object;
textures_Uniform : openGL.Variable.uniform.sampler2D;
fade_Uniform : openGL.Variable.uniform.float;
end record;
type fadeable_Textures is array (texture_Id range 1 .. max_Textures) of fadeable_Texture;
@@ -74,12 +78,14 @@ is
Textures : fadeable_Textures;
Count : Natural := 0;
is_Transparent : Boolean := False; -- Any of the textures contains lucid colors.
Initialised : Boolean := False;
initialised : Boolean := False;
end record;
procedure enable (the_Textures : in out texture_Set;
Program : in openGL.Program.view);
procedure Texture_is (in_Set : in out texture_Set; Which : texture_ID; Now : in openGL.Texture.Object);
function Texture (in_Set : in texture_Set; Which : texture_ID) return openGL.Texture.Object;