From 8a2a562a8b18fbad71c77259bc45dd25174aa900 Mon Sep 17 00:00:00 2001 From: Rod Kay Date: Sat, 4 Oct 2025 15:32:21 +1000 Subject: [PATCH] opengl.texture_set: Initial work on renaming 'Details' to 'Item'. --- .../opengl/source/lean/opengl-texture_set.adb | 63 +++++++++++++++++++ .../opengl/source/lean/opengl-texture_set.ads | 61 +++++++++++++++++- 2 files changed, 121 insertions(+), 3 deletions(-) diff --git a/3-mid/opengl/source/lean/opengl-texture_set.adb b/3-mid/opengl/source/lean/opengl-texture_set.adb index 911b71e..f9e091e 100644 --- a/3-mid/opengl/source/lean/opengl-texture_set.adb +++ b/3-mid/opengl/source/lean/opengl-texture_set.adb @@ -70,6 +70,69 @@ is + -- function to_Set (texture_Assets : in asset_Names; + -- Animation : in Animation_view := null) return Item + -- is + -- Result : Item (Count => texture_Assets'Length); + -- + -- begin + -- for i in 1 .. Result.Count + -- loop + -- Result.Details (i).Object := texture.null_Object; + -- Result.Details (i).Texture := texture_Assets (Integer (i)); + -- Result.Details (i).Fade := 0.0; + -- Result.Details (i).texture_Tiling := (S => 1.0, T => 1.0); + -- + -- if i = 1 + -- then + -- Result.Details (i).texture_Apply := True; + -- else + -- Result.Details (i).texture_Apply := False; + -- end if; + -- end loop; + -- + -- Result.Animation := Animation; + -- + -- return Result; + -- end to_Set; + + + + -------------- + --- Attributes + -- + + -- function get_Details (Self : in Item) return Detail_array + -- is + -- begin + -- return Self.Details; + -- end get_Details; + -- + -- + -- + -- procedure Details_are (Self : in out Item; Now : in Detail_array) + -- is + -- begin + -- Self.Details := Now; + -- end Details_are; + -- + -- + -- + -- function get_Animation (Self : in Item) return Animation_view + -- is + -- begin + -- return Self.Animation; + -- end get_Animation; + -- + -- + -- + -- procedure Animation_is (Self : in out Item; Now : in Animation_view) + -- is + -- begin + -- Self.Animation := Now; + -- end Animation_is; + + ----------- --- Streams diff --git a/3-mid/opengl/source/lean/opengl-texture_set.ads b/3-mid/opengl/source/lean/opengl-texture_set.ads index a3fbbb0..9b5d843 100644 --- a/3-mid/opengl/source/lean/opengl-texture_set.ads +++ b/3-mid/opengl/source/lean/opengl-texture_set.ads @@ -15,16 +15,28 @@ package openGL.texture_Set -- is + max_Textures : constant := 16; -- 32; + + + type detail_Count is range 0 .. max_Textures; + + + -- type Item (Count : detail_Count := 1) is private; + -- + -- null_Set : constant Item; + + + + --------------- --- Texture Ids -- - max_Textures : constant := 16; -- 32; - type texture_Id is range 1 .. max_Textures; type texture_Ids is array (Positive range <>) of texture_Id; + ---------- --- Tiling -- @@ -88,6 +100,20 @@ is texture_Applies : in out texture_Apply_array); + + type Detail is + record + Object : texture.Object; + Texture : asset_Name; + Fade : fade_Level; + texture_Tiling : Tiling; + texture_Apply : Boolean; -- If the textures is to be applied to the visual. + end record; + + type Detail_array is array (detail_Count range <>) of Detail; + + + ----------- --- Details -- @@ -105,15 +131,43 @@ is end record; + + --------- + --- Forge + -- + function to_Details (texture_Assets : in asset_Names; Animation : in Animation_view := null) return Details; no_Details : constant Details; + -- function to_Set (texture_Assets : in asset_Names; + -- Animation : in Animation_view := null) return Item; + + + -------------- + --- Attributes + -- + + -- function get_Details (Self : in Item) return Detail_array; + -- procedure Details_are (Self : in out Item; Now : in Detail_array); + -- + -- function get_Animation (Self : in Item) return Animation_view; + -- procedure Animation_is (Self : in out Item; Now : in Animation_view); + + private + -- type Item (Count : detail_Count := 1) is + -- record + -- Details : Detail_array (1 .. Count); + -- Animation : Animation_view; + -- end record; + + + ----------- --- Streams -- @@ -129,6 +183,7 @@ private no_Details : constant Details := (others => <>); - + -- null_Set : constant Item := (Count => 0, + -- others => <>); end openGL.texture_Set;