opengl: Rid 'Texture' and 'Texture_is' for texture_Sets.
This commit is contained in:
@@ -48,9 +48,42 @@ is
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- procedure enable (for_Model : in openGL.Model.view;
|
||||||
|
-- Uniforms : in texturing.Uniforms;
|
||||||
|
-- texture_Set : in openGL.texture_Set.Item)
|
||||||
|
-- is
|
||||||
|
-- use GL.Binding,
|
||||||
|
-- GL.lean;
|
||||||
|
--
|
||||||
|
-- use type GLint;
|
||||||
|
--
|
||||||
|
-- begin
|
||||||
|
-- if for_Model.texture_Count > 0
|
||||||
|
-- then
|
||||||
|
-- for i in 1 .. openGL.texture_Set.texture_Id (for_Model.texture_Count)
|
||||||
|
-- loop
|
||||||
|
-- Uniforms.Textures (i).tiling_Uniform .Value_is (Vector_2' ((for_Model.Tiling (Which => i).S,
|
||||||
|
-- for_Model.Tiling (Which => i).T)));
|
||||||
|
-- Uniforms.Textures (i).fade_Uniform .Value_is (Real (for_Model.Fade (Which => i)));
|
||||||
|
-- Uniforms.Textures (i).texture_applied_Uniform.Value_is (for_Model.texture_Applied (Which => i));
|
||||||
|
--
|
||||||
|
-- glUniform1i (Uniforms.Textures (i).texture_Uniform.gl_Variable,
|
||||||
|
-- GLint (i) - 1);
|
||||||
|
-- glActiveTexture (all_texture_Units (i));
|
||||||
|
-- glBindTexture (GL_TEXTURE_2D,
|
||||||
|
-- texture_Set.Textures (i).Object.Name);
|
||||||
|
-- end loop;
|
||||||
|
-- end if;
|
||||||
|
--
|
||||||
|
-- Uniforms.Count.Value_is (for_Model.texture_Count);
|
||||||
|
-- end enable;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
procedure enable (for_Model : in openGL.Model.view;
|
procedure enable (for_Model : in openGL.Model.view;
|
||||||
Uniforms : in texturing.Uniforms;
|
Uniforms : in texturing.Uniforms)
|
||||||
texture_Set : in openGL.texture_Set.Item)
|
-- texture_Set : in openGL.texture_Set.Item)
|
||||||
is
|
is
|
||||||
use GL.Binding,
|
use GL.Binding,
|
||||||
GL.lean;
|
GL.lean;
|
||||||
@@ -71,7 +104,7 @@ is
|
|||||||
GLint (i) - 1);
|
GLint (i) - 1);
|
||||||
glActiveTexture (all_texture_Units (i));
|
glActiveTexture (all_texture_Units (i));
|
||||||
glBindTexture (GL_TEXTURE_2D,
|
glBindTexture (GL_TEXTURE_2D,
|
||||||
texture_Set.Textures (i).Object.Name);
|
for_Model.texture_Object (i).Name);
|
||||||
end loop;
|
end loop;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
@@ -134,7 +167,9 @@ is
|
|||||||
Which : in texture_Set.texture_ID := 1)
|
Which : in texture_Set.texture_ID := 1)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
Self.texture_Set.Textures (Which).Fade := Now;
|
-- Self.texture_Set.Textures (Which).Fade := Now;
|
||||||
|
Self.Model.Fade_is (Which => Which,
|
||||||
|
Now => Now);
|
||||||
end Fade_is;
|
end Fade_is;
|
||||||
|
|
||||||
|
|
||||||
@@ -143,7 +178,8 @@ is
|
|||||||
function Fade (Self : in Item; Which : in texture_Set.texture_ID := 1) return texture_Set.fade_Level
|
function Fade (Self : in Item; Which : in texture_Set.texture_ID := 1) return texture_Set.fade_Level
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
return Self.texture_Set.Textures (Which).Fade;
|
-- return Self.texture_Set.Textures (Which).Fade;
|
||||||
|
return Self.Model.Fade (Which => Which);
|
||||||
end Fade;
|
end Fade;
|
||||||
|
|
||||||
|
|
||||||
@@ -153,8 +189,10 @@ is
|
|||||||
Which : in texture_Set.texture_ID := 1)
|
Which : in texture_Set.texture_ID := 1)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
Texture_is (in_Set => Self.texture_Set,
|
-- Texture_is (in_Set => Self.texture_Set,
|
||||||
Which => Which,
|
-- Which => Which,
|
||||||
|
-- Now => Now);
|
||||||
|
Self.Model.texture_Object_is (Which => Which,
|
||||||
Now => Now);
|
Now => Now);
|
||||||
end Texture_is;
|
end Texture_is;
|
||||||
|
|
||||||
@@ -164,8 +202,9 @@ is
|
|||||||
function Texture (Self : in Item; Which : texture_Set.texture_ID := 1) return openGL.Texture.Object
|
function Texture (Self : in Item; Which : texture_Set.texture_ID := 1) return openGL.Texture.Object
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
return openGL.texture_Set.Texture (in_Set => Self.texture_Set,
|
-- return openGL.texture_Set.Texture (in_Set => Self.texture_Set,
|
||||||
Which => Which);
|
-- Which => Which);
|
||||||
|
return Self.Model.texture_Object (Which);
|
||||||
end Texture;
|
end Texture;
|
||||||
|
|
||||||
|
|
||||||
@@ -175,7 +214,8 @@ is
|
|||||||
Which : in texture_Set.texture_ID := 1)
|
Which : in texture_Set.texture_ID := 1)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
Self.texture_Set.Textures (Which).Applied := Now;
|
-- Self.texture_Set.Textures (Which).Applied := Now;
|
||||||
|
Self.Model.texture_Applied_is (Which, Now);
|
||||||
end texture_Applied_is;
|
end texture_Applied_is;
|
||||||
|
|
||||||
|
|
||||||
@@ -184,7 +224,8 @@ is
|
|||||||
function texture_Applied (Self : in Item; Which : in texture_Set.texture_ID := 1) return Boolean
|
function texture_Applied (Self : in Item; Which : in texture_Set.texture_ID := 1) return Boolean
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
return Self.texture_Set.Textures (Which).Applied;
|
-- return Self.texture_Set.Textures (Which).Applied;
|
||||||
|
return Self.Model.texture_Applied (Which);
|
||||||
end texture_Applied;
|
end texture_Applied;
|
||||||
|
|
||||||
|
|
||||||
@@ -194,7 +235,9 @@ is
|
|||||||
Which : in texture_Set.texture_ID := 1)
|
Which : in texture_Set.texture_ID := 1)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
Self.texture_Set.Textures (Which).Tiling := Now;
|
-- Self.texture_Set.Textures (Which).Tiling := Now;
|
||||||
|
Self.Model.Tiling_is (Which => Which,
|
||||||
|
Now => Now);
|
||||||
end Tiling_is;
|
end Tiling_is;
|
||||||
|
|
||||||
|
|
||||||
@@ -203,7 +246,8 @@ is
|
|||||||
function Tiling (Self : in Item; Which : in texture_Set.texture_ID := 1) return texture_Set.Tiling
|
function Tiling (Self : in Item; Which : in texture_Set.texture_ID := 1) return texture_Set.Tiling
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
return Self.texture_Set.Textures (Which).Tiling;
|
-- return Self.texture_Set.Textures (Which).Tiling;
|
||||||
|
return Self.Model.Tiling (Which);
|
||||||
end Tiling;
|
end Tiling;
|
||||||
|
|
||||||
|
|
||||||
@@ -216,9 +260,11 @@ is
|
|||||||
procedure enable_Textures (Self : in out Item)
|
procedure enable_Textures (Self : in out Item)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
|
-- texturing.enable (for_Model => Self.Model.all'Access,
|
||||||
|
-- Uniforms => texture_Uniforms,
|
||||||
|
-- texture_Set => Self.texture_Set);
|
||||||
texturing.enable (for_Model => Self.Model.all'Access,
|
texturing.enable (for_Model => Self.Model.all'Access,
|
||||||
Uniforms => texture_Uniforms,
|
Uniforms => texture_Uniforms);
|
||||||
texture_Set => Self.texture_Set);
|
|
||||||
end enable_Textures;
|
end enable_Textures;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -40,9 +40,12 @@ is
|
|||||||
--- Operations
|
--- Operations
|
||||||
--
|
--
|
||||||
|
|
||||||
|
-- procedure enable (for_Model : in openGL.Model.view;
|
||||||
|
-- Uniforms : in texturing.Uniforms;
|
||||||
|
-- texture_Set : in openGL.texture_Set.Item);
|
||||||
|
|
||||||
procedure enable (for_Model : in openGL.Model.view;
|
procedure enable (for_Model : in openGL.Model.view;
|
||||||
Uniforms : in texturing.Uniforms;
|
Uniforms : in texturing.Uniforms);
|
||||||
texture_Set : in openGL.texture_Set.Item);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -99,7 +102,7 @@ is
|
|||||||
|
|
||||||
type Item is new Geometry.item with
|
type Item is new Geometry.item with
|
||||||
record
|
record
|
||||||
texture_Set : openGL.texture_Set.item;
|
null; --texture_Set : openGL.texture_Set.item;
|
||||||
end record;
|
end record;
|
||||||
|
|
||||||
end Mixin;
|
end Mixin;
|
||||||
|
|||||||
@@ -420,6 +420,9 @@ is
|
|||||||
deallocate (the_Vertices);
|
deallocate (the_Vertices);
|
||||||
destroy (the_Model);
|
destroy (the_Model);
|
||||||
|
|
||||||
|
Self.Geometry.Model_is (Self'unchecked_Access);
|
||||||
|
|
||||||
|
|
||||||
-- Set the geometry texture.
|
-- Set the geometry texture.
|
||||||
--
|
--
|
||||||
if Self.Texture /= null_Asset
|
if Self.Texture /= null_Asset
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ is
|
|||||||
--
|
--
|
||||||
|
|
||||||
overriding
|
overriding
|
||||||
function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class;
|
function to_GL_Geometries (Self : access Item; Textures : access openGL.Texture.name_Map_of_texture'Class;
|
||||||
Fonts : in Font.font_id_Map_of_font) return Geometry.views
|
Fonts : in Font.font_id_Map_of_font) return Geometry.views
|
||||||
is
|
is
|
||||||
pragma unreferenced (Textures, Fonts);
|
pragma unreferenced (Textures, Fonts);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ is
|
|||||||
--
|
--
|
||||||
|
|
||||||
overriding
|
overriding
|
||||||
function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class;
|
function to_GL_Geometries (Self : access Item; Textures : access openGL.Texture.name_Map_of_texture'Class;
|
||||||
Fonts : in Font.font_id_Map_of_font) return Geometry.views;
|
Fonts : in Font.font_id_Map_of_font) return Geometry.views;
|
||||||
|
|
||||||
procedure end_Site_is (Self : in out Item; Now : in Vector_3;
|
procedure end_Site_is (Self : in out Item; Now : in Vector_3;
|
||||||
|
|||||||
@@ -57,10 +57,10 @@ is
|
|||||||
the_Primitive : constant Primitive.view := Primitive.indexed.new_Primitive (triangle_Fan,
|
the_Primitive : constant Primitive.view := Primitive.indexed.new_Primitive (triangle_Fan,
|
||||||
the_Indices).all'Access;
|
the_Indices).all'Access;
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices.all);
|
the_Geometry.Vertices_are (Vertices.all);
|
||||||
the_Geometry.add (the_Primitive);
|
the_Geometry.add (the_Primitive);
|
||||||
the_Geometry.is_Transparent;
|
the_Geometry.is_Transparent;
|
||||||
the_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
|
|
||||||
return the_Geometry;
|
return the_Geometry;
|
||||||
end new_Face;
|
end new_Face;
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ is
|
|||||||
the_Primitive : constant Primitive.view := Primitive.indexed.new_Primitive (triangle_Fan,
|
the_Primitive : constant Primitive.view := Primitive.indexed.new_Primitive (triangle_Fan,
|
||||||
the_Indices).all'Access;
|
the_Indices).all'Access;
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices);
|
the_Geometry.Vertices_are (Vertices);
|
||||||
the_Geometry.add (the_Primitive);
|
the_Geometry.add (the_Primitive);
|
||||||
the_Geometry.is_Transparent;
|
the_Geometry.is_Transparent;
|
||||||
@@ -113,8 +114,6 @@ is
|
|||||||
end if;
|
end if;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
the_Face.Model_is (Self.all'unchecked_Access);
|
|
||||||
|
|
||||||
return [1 => the_Face.all'Access];
|
return [1 => the_Face.all'Access];
|
||||||
end to_GL_Geometries;
|
end to_GL_Geometries;
|
||||||
|
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ is
|
|||||||
(triangle_Fan,
|
(triangle_Fan,
|
||||||
the_Indices).all'Access;
|
the_Indices).all'Access;
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices.all);
|
the_Geometry.Vertices_are (Vertices.all);
|
||||||
the_Geometry.add (the_Primitive);
|
the_Geometry.add (the_Primitive);
|
||||||
the_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
|
|
||||||
return the_Geometry;
|
return the_Geometry;
|
||||||
end new_Face;
|
end new_Face;
|
||||||
|
|||||||
@@ -48,8 +48,9 @@ is
|
|||||||
the_Geometry : constant Geometry.lit_textured.view := Geometry.lit_textured.new_Geometry;
|
the_Geometry : constant Geometry.lit_textured.view := Geometry.lit_textured.new_Geometry;
|
||||||
the_Primitive : constant Primitive.view := Primitive.indexed.new_Primitive
|
the_Primitive : constant Primitive.view := Primitive.indexed.new_Primitive
|
||||||
(triangle_Fan,
|
(triangle_Fan,
|
||||||
the_Indices).all'Access;
|
the_Indices).all'unchecked_Access;
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices);
|
the_Geometry.Vertices_are (Vertices);
|
||||||
the_Geometry.add (the_Primitive);
|
the_Geometry.add (the_Primitive);
|
||||||
|
|
||||||
@@ -80,7 +81,6 @@ is
|
|||||||
then
|
then
|
||||||
front_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
|
front_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
|
||||||
front_Face.is_Transparent (now => front_Face.Texture.is_Transparent);
|
front_Face.is_Transparent (now => front_Face.Texture.is_Transparent);
|
||||||
front_Face.Model_is (Self.all'unchecked_Access);
|
|
||||||
end if;
|
end if;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -100,7 +100,6 @@ is
|
|||||||
then
|
then
|
||||||
rear_Face.Texture_is (Textures.fetch (Self.Faces (Rear).texture_Name));
|
rear_Face.Texture_is (Textures.fetch (Self.Faces (Rear).texture_Name));
|
||||||
rear_Face.is_Transparent (now => rear_Face.Texture.is_Transparent);
|
rear_Face.is_Transparent (now => rear_Face.Texture.is_Transparent);
|
||||||
rear_Face.Model_is (Self.all'unchecked_Access);
|
|
||||||
end if;
|
end if;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -120,7 +119,6 @@ is
|
|||||||
then
|
then
|
||||||
upper_Face.Texture_is (Textures.fetch (Self.Faces (Upper).texture_Name));
|
upper_Face.Texture_is (Textures.fetch (Self.Faces (Upper).texture_Name));
|
||||||
upper_Face.is_Transparent (now => upper_Face.Texture.is_Transparent);
|
upper_Face.is_Transparent (now => upper_Face.Texture.is_Transparent);
|
||||||
upper_Face.Model_is (Self.all'unchecked_Access);
|
|
||||||
end if;
|
end if;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -140,7 +138,6 @@ is
|
|||||||
then
|
then
|
||||||
lower_Face.Texture_is (Textures.fetch (Self.Faces (Lower).texture_Name));
|
lower_Face.Texture_is (Textures.fetch (Self.Faces (Lower).texture_Name));
|
||||||
lower_Face.is_Transparent (now => lower_Face.Texture.is_Transparent);
|
lower_Face.is_Transparent (now => lower_Face.Texture.is_Transparent);
|
||||||
lower_Face.Model_is (Self.all'unchecked_Access);
|
|
||||||
end if;
|
end if;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -160,7 +157,6 @@ is
|
|||||||
then
|
then
|
||||||
left_Face.Texture_is (Textures.fetch (Self.Faces (Left).texture_Name));
|
left_Face.Texture_is (Textures.fetch (Self.Faces (Left).texture_Name));
|
||||||
left_Face.is_Transparent (now => left_Face.Texture.is_Transparent);
|
left_Face.is_Transparent (now => left_Face.Texture.is_Transparent);
|
||||||
left_Face.Model_is (Self.all'unchecked_Access);
|
|
||||||
end if;
|
end if;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -180,7 +176,6 @@ is
|
|||||||
then
|
then
|
||||||
right_Face.Texture_is (Textures.fetch (Self.Faces (Right).texture_Name));
|
right_Face.Texture_is (Textures.fetch (Self.Faces (Right).texture_Name));
|
||||||
right_Face.is_Transparent (now => right_Face.Texture.is_Transparent);
|
right_Face.is_Transparent (now => right_Face.Texture.is_Transparent);
|
||||||
right_Face.Model_is (Self.all'unchecked_Access);
|
|
||||||
end if;
|
end if;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ is
|
|||||||
the_Primitive : constant Primitive.view := Primitive.indexed.new_Primitive (triangle_Fan,
|
the_Primitive : constant Primitive.view := Primitive.indexed.new_Primitive (triangle_Fan,
|
||||||
the_Indices).all'Access;
|
the_Indices).all'Access;
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices);
|
the_Geometry.Vertices_are (Vertices);
|
||||||
the_Geometry.add (the_Primitive);
|
the_Geometry.add (the_Primitive);
|
||||||
|
|
||||||
@@ -86,7 +87,6 @@ is
|
|||||||
then
|
then
|
||||||
front_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
|
front_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
|
||||||
front_Face.is_Transparent (now => front_Face.Texture.is_Transparent);
|
front_Face.is_Transparent (now => front_Face.Texture.is_Transparent);
|
||||||
front_Face.Model_is (Self.all'unchecked_Access);
|
|
||||||
end if;
|
end if;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -106,7 +106,6 @@ is
|
|||||||
then
|
then
|
||||||
rear_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
|
rear_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
|
||||||
rear_Face.is_Transparent (now => rear_Face.Texture.is_Transparent);
|
rear_Face.is_Transparent (now => rear_Face.Texture.is_Transparent);
|
||||||
rear_Face.Model_is (Self.all'unchecked_Access);
|
|
||||||
end if;
|
end if;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -126,7 +125,6 @@ is
|
|||||||
then
|
then
|
||||||
upper_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
|
upper_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
|
||||||
upper_Face.is_Transparent (now => upper_Face.Texture.is_Transparent);
|
upper_Face.is_Transparent (now => upper_Face.Texture.is_Transparent);
|
||||||
upper_Face.Model_is (Self.all'unchecked_Access);
|
|
||||||
end if;
|
end if;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -146,7 +144,6 @@ is
|
|||||||
then
|
then
|
||||||
lower_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
|
lower_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
|
||||||
lower_Face.is_Transparent (now => lower_Face.Texture.is_Transparent);
|
lower_Face.is_Transparent (now => lower_Face.Texture.is_Transparent);
|
||||||
lower_Face.Model_is (Self.all'unchecked_Access);
|
|
||||||
end if;
|
end if;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -166,7 +163,6 @@ is
|
|||||||
then
|
then
|
||||||
left_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
|
left_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
|
||||||
left_Face.is_Transparent (now => left_Face.Texture.is_Transparent);
|
left_Face.is_Transparent (now => left_Face.Texture.is_Transparent);
|
||||||
left_Face.Model_is (Self.all'unchecked_Access);
|
|
||||||
end if;
|
end if;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -186,7 +182,6 @@ is
|
|||||||
then
|
then
|
||||||
right_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
|
right_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
|
||||||
right_Face.is_Transparent (now => right_Face.Texture.is_Transparent);
|
right_Face.is_Transparent (now => right_Face.Texture.is_Transparent);
|
||||||
right_Face.Model_is (Self.all'unchecked_Access);
|
|
||||||
end if;
|
end if;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ is
|
|||||||
begin
|
begin
|
||||||
-- Define capsule shaft,
|
-- Define capsule shaft,
|
||||||
--
|
--
|
||||||
|
the_shaft_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
|
|
||||||
declare
|
declare
|
||||||
vertex_Count : constant Index_t := Index_t (sides_Count * 2 + 2); -- 2 triangles per side plus 2 since we cannot share the first and last edge.
|
vertex_Count : constant Index_t := Index_t (sides_Count * 2 + 2); -- 2 triangles per side plus 2 since we cannot share the first and last edge.
|
||||||
indices_Count : constant long_Index_t := long_Index_t (sides_Count * 2 * 3); -- 2 triangles per side with 3 vertices per triangle.
|
indices_Count : constant long_Index_t := long_Index_t (sides_Count * 2 * 3); -- 2 triangles per side with 3 vertices per triangle.
|
||||||
@@ -197,8 +199,6 @@ is
|
|||||||
begin
|
begin
|
||||||
the_shaft_Geometry.add (Primitive.view (the_Primitive));
|
the_shaft_Geometry.add (Primitive.view (the_Primitive));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
the_shaft_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@@ -234,7 +234,10 @@ is
|
|||||||
longitude_Spacing : constant Real := Degrees_360 / Real (longitude_Count);
|
longitude_Spacing : constant Real := Degrees_360 / Real (longitude_Count);
|
||||||
|
|
||||||
a, b : Real := 0.0; -- Angular 'cursors' used to track lat/long for texture coords.
|
a, b : Real := 0.0; -- Angular 'cursors' used to track lat/long for texture coords.
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
cap_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
|
|
||||||
if not is_Fore
|
if not is_Fore
|
||||||
then
|
then
|
||||||
a := Degrees_360;
|
a := Degrees_360;
|
||||||
@@ -397,8 +400,6 @@ is
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
cap_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
|
|
||||||
return cap_Geometry;
|
return cap_Geometry;
|
||||||
end new_Cap;
|
end new_Cap;
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,8 @@ is
|
|||||||
begin
|
begin
|
||||||
-- Define capsule shaft,
|
-- Define capsule shaft,
|
||||||
--
|
--
|
||||||
|
the_shaft_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
|
|
||||||
declare
|
declare
|
||||||
vertex_Count : constant Index_t := Index_t (sides_Count * 2 + 2); -- 2 triangles per side plus 2 since we cannot share the first and last edge.
|
vertex_Count : constant Index_t := Index_t (sides_Count * 2 + 2); -- 2 triangles per side plus 2 since we cannot share the first and last edge.
|
||||||
indices_Count : constant long_Index_t := long_Index_t (sides_Count * 2 * 3); -- 2 triangles per side with 3 vertices per triangle.
|
indices_Count : constant long_Index_t := long_Index_t (sides_Count * 2 * 3); -- 2 triangles per side with 3 vertices per triangle.
|
||||||
@@ -190,8 +192,6 @@ is
|
|||||||
begin
|
begin
|
||||||
the_shaft_Geometry.add (Primitive.view (the_Primitive));
|
the_shaft_Geometry.add (Primitive.view (the_Primitive));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
the_shaft_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@@ -228,6 +228,8 @@ is
|
|||||||
|
|
||||||
a, b : Real := 0.0; -- Angular 'cursors' used to track lat/long for texture coords.
|
a, b : Real := 0.0; -- Angular 'cursors' used to track lat/long for texture coords.
|
||||||
begin
|
begin
|
||||||
|
cap_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
|
|
||||||
if not is_Fore
|
if not is_Fore
|
||||||
then
|
then
|
||||||
a := Degrees_360;
|
a := Degrees_360;
|
||||||
@@ -388,8 +390,6 @@ is
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
cap_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
|
|
||||||
return cap_Geometry;
|
return cap_Geometry;
|
||||||
end new_Cap;
|
end new_Cap;
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,7 @@ is
|
|||||||
is
|
is
|
||||||
pragma unreferenced (Textures, Fonts);
|
pragma unreferenced (Textures, Fonts);
|
||||||
|
|
||||||
use --Geometry,
|
use Geometry.textured,
|
||||||
Geometry.textured,
|
|
||||||
real_Functions;
|
real_Functions;
|
||||||
|
|
||||||
Length : constant Real := Self.Height;
|
Length : constant Real := Self.Height;
|
||||||
@@ -77,6 +76,8 @@ is
|
|||||||
begin
|
begin
|
||||||
-- Define capsule shaft,
|
-- Define capsule shaft,
|
||||||
--
|
--
|
||||||
|
the_shaft_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
|
|
||||||
declare
|
declare
|
||||||
vertex_Count : constant Index_t := Index_t (sides_Count * 2 + 2); -- 2 triangles per side plus 2 since we cannot share the first and last edge.
|
vertex_Count : constant Index_t := Index_t (sides_Count * 2 + 2); -- 2 triangles per side plus 2 since we cannot share the first and last edge.
|
||||||
indices_Count : constant long_Index_t := long_Index_t (sides_Count * 2 * 3); -- 2 triangles per side with 3 vertices per triangle.
|
indices_Count : constant long_Index_t := long_Index_t (sides_Count * 2 * 3); -- 2 triangles per side with 3 vertices per triangle.
|
||||||
@@ -209,7 +210,10 @@ is
|
|||||||
longitude_Spacing : constant Real := Degrees_360 / Real (longitude_Count);
|
longitude_Spacing : constant Real := Degrees_360 / Real (longitude_Count);
|
||||||
|
|
||||||
a, b : Real := 0.0; -- Angular 'cursors' used to track lat/long for texture coords.
|
a, b : Real := 0.0; -- Angular 'cursors' used to track lat/long for texture coords.
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
cap_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
|
|
||||||
if not is_Fore
|
if not is_Fore
|
||||||
then
|
then
|
||||||
a := Degrees_360;
|
a := Degrees_360;
|
||||||
@@ -371,9 +375,6 @@ is
|
|||||||
cap_2_Geometry := new_Cap (is_Fore => False);
|
cap_2_Geometry := new_Cap (is_Fore => False);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
the_shaft_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
cap_1_Geometry .Model_is (Self.all'unchecked_Access);
|
|
||||||
cap_2_Geometry .Model_is (Self.all'unchecked_Access);
|
|
||||||
|
|
||||||
return [1 => the_shaft_Geometry.all'Access,
|
return [1 => the_shaft_Geometry.all'Access,
|
||||||
2 => cap_1_Geometry.all'Access,
|
2 => cap_1_Geometry.all'Access,
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ is
|
|||||||
|
|
||||||
Id : texture_Set.texture_Id;
|
Id : texture_Set.texture_Id;
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices);
|
the_Geometry.Vertices_are (Vertices);
|
||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
|
|
||||||
@@ -90,8 +91,8 @@ is
|
|||||||
|
|
||||||
Id := texture_Id (i);
|
Id := texture_Id (i);
|
||||||
|
|
||||||
the_Geometry.Fade_is (which => Id,
|
-- the_Geometry.Fade_is (which => Id,
|
||||||
now => Self.texture_Details.Fades (Id));
|
-- now => Self.texture_Details.Fades (Id));
|
||||||
|
|
||||||
the_Geometry.Texture_is (which => Id,
|
the_Geometry.Texture_is (which => Id,
|
||||||
now => Textures.fetch (Self.texture_Details.Textures (i)));
|
now => Textures.fetch (Self.texture_Details.Textures (i)));
|
||||||
@@ -99,7 +100,6 @@ is
|
|||||||
end loop;
|
end loop;
|
||||||
|
|
||||||
the_Geometry.is_Transparent (True); -- TODO: Do transparency properly.
|
the_Geometry.is_Transparent (True); -- TODO: Do transparency properly.
|
||||||
the_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
|
|
||||||
return the_Geometry;
|
return the_Geometry;
|
||||||
end new_Geometry;
|
end new_Geometry;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ is
|
|||||||
the_Primitive : constant Primitive.indexed.view
|
the_Primitive : constant Primitive.indexed.view
|
||||||
:= Primitive.indexed.new_Primitive (triangle_Fan, the_Indices);
|
:= Primitive.indexed.new_Primitive (triangle_Fan, the_Indices);
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices);
|
the_Geometry.Vertices_are (Vertices);
|
||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,9 @@ is
|
|||||||
:= Primitive.indexed.new_Primitive (triangle_Fan, the_Indices);
|
:= Primitive.indexed.new_Primitive (triangle_Fan, the_Indices);
|
||||||
|
|
||||||
Id : texture_Set.texture_Id;
|
Id : texture_Set.texture_Id;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices);
|
the_Geometry.Vertices_are (Vertices);
|
||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
|
|
||||||
@@ -66,8 +68,8 @@ is
|
|||||||
loop
|
loop
|
||||||
Id := texture_Id (i);
|
Id := texture_Id (i);
|
||||||
|
|
||||||
the_Geometry.Fade_is (Which => Id,
|
-- the_Geometry.Fade_is (Which => Id,
|
||||||
Now => Self.texture_Details.Fades (Id));
|
-- Now => Self.texture_Details.Fades (Id));
|
||||||
|
|
||||||
the_Geometry.Texture_is (Which => Id,
|
the_Geometry.Texture_is (Which => Id,
|
||||||
Now => Textures.fetch (Self.texture_Details.Textures (i)));
|
Now => Textures.fetch (Self.texture_Details.Textures (i)));
|
||||||
@@ -75,7 +77,6 @@ is
|
|||||||
end loop;
|
end loop;
|
||||||
|
|
||||||
the_Geometry.is_Transparent (True); -- TODO: Do transparency properly.
|
the_Geometry.is_Transparent (True); -- TODO: Do transparency properly.
|
||||||
the_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
|
|
||||||
return the_Geometry;
|
return the_Geometry;
|
||||||
end new_Face;
|
end new_Face;
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ is
|
|||||||
:= Primitive.indexed.new_Primitive (triangle_Fan,
|
:= Primitive.indexed.new_Primitive (triangle_Fan,
|
||||||
the_Indices);
|
the_Indices);
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices.all);
|
the_Geometry.Vertices_are (Vertices.all);
|
||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
|
|
||||||
@@ -90,6 +91,7 @@ is
|
|||||||
the_Primitive : constant Primitive.view
|
the_Primitive : constant Primitive.view
|
||||||
:= Primitive.indexed.new_Primitive (triangle_Strip, the_Indices).all'Access;
|
:= Primitive.indexed.new_Primitive (triangle_Strip, the_Indices).all'Access;
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices.all);
|
the_Geometry.Vertices_are (Vertices.all);
|
||||||
the_Geometry.add (the_Primitive);
|
the_Geometry.add (the_Primitive);
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ is
|
|||||||
:= Primitive.indexed.new_Primitive (triangle_Fan,
|
:= Primitive.indexed.new_Primitive (triangle_Fan,
|
||||||
the_Indices);
|
the_Indices);
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices.all);
|
the_Geometry.Vertices_are (Vertices.all);
|
||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
|
|
||||||
@@ -95,6 +96,7 @@ is
|
|||||||
the_Primitive : constant Primitive.view
|
the_Primitive : constant Primitive.view
|
||||||
:= Primitive.indexed.new_Primitive (triangle_Strip, the_Indices).all'Access;
|
:= Primitive.indexed.new_Primitive (triangle_Strip, the_Indices).all'Access;
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices.all);
|
the_Geometry.Vertices_are (Vertices.all);
|
||||||
the_Geometry.add (the_Primitive);
|
the_Geometry.add (the_Primitive);
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ is
|
|||||||
the_Indices).all'Access;
|
the_Indices).all'Access;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices);
|
the_Geometry.Vertices_are (Vertices);
|
||||||
the_Geometry.add (the_Primitive);
|
the_Geometry.add (the_Primitive);
|
||||||
|
|
||||||
@@ -99,6 +100,7 @@ is
|
|||||||
:= Primitive.indexed.new_Primitive (triangle_Strip,
|
:= Primitive.indexed.new_Primitive (triangle_Strip,
|
||||||
the_Indices);
|
the_Indices);
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices);
|
the_Geometry.Vertices_are (Vertices);
|
||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ is
|
|||||||
:= Primitive.indexed.new_Primitive (triangle_Fan,
|
:= Primitive.indexed.new_Primitive (triangle_Fan,
|
||||||
the_Indices);
|
the_Indices);
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices.all);
|
the_Geometry.Vertices_are (Vertices.all);
|
||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
|
|
||||||
@@ -91,6 +92,7 @@ is
|
|||||||
the_Primitive : constant Primitive.view
|
the_Primitive : constant Primitive.view
|
||||||
:= Primitive.indexed.new_Primitive (triangle_Strip, the_Indices).all'Access;
|
:= Primitive.indexed.new_Primitive (triangle_Strip, the_Indices).all'Access;
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices.all);
|
the_Geometry.Vertices_are (Vertices.all);
|
||||||
the_Geometry.add (the_Primitive);
|
the_Geometry.add (the_Primitive);
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ is
|
|||||||
the_Indices).all'Access;
|
the_Indices).all'Access;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices);
|
the_Geometry.Vertices_are (Vertices);
|
||||||
the_Geometry.add (the_Primitive);
|
the_Geometry.add (the_Primitive);
|
||||||
|
|
||||||
@@ -95,6 +96,7 @@ is
|
|||||||
:= Primitive.indexed.new_Primitive (triangle_Strip,
|
:= Primitive.indexed.new_Primitive (triangle_Strip,
|
||||||
the_Indices);
|
the_Indices);
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices);
|
the_Geometry.Vertices_are (Vertices);
|
||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ is
|
|||||||
Id : texture_Set.texture_Id;
|
Id : texture_Set.texture_Id;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.Vertices_are (Vertices);
|
the_Geometry.Vertices_are (Vertices);
|
||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
|
|
||||||
@@ -77,8 +78,8 @@ is
|
|||||||
loop
|
loop
|
||||||
Id := texture_Id (i);
|
Id := texture_Id (i);
|
||||||
|
|
||||||
the_Geometry.Fade_is (Which => Id,
|
-- the_Geometry.Fade_is (Which => Id,
|
||||||
Now => Self.texture_Details.Fades (Id));
|
-- Now => Self.texture_Details.Fades (Id));
|
||||||
|
|
||||||
the_Geometry.Texture_is (Which => Id,
|
the_Geometry.Texture_is (Which => Id,
|
||||||
Now => Textures.fetch (Self.texture_Details.Textures (i)));
|
Now => Textures.fetch (Self.texture_Details.Textures (i)));
|
||||||
@@ -86,7 +87,6 @@ is
|
|||||||
end loop;
|
end loop;
|
||||||
|
|
||||||
the_Geometry.is_Transparent (True); -- TODO: Do transparency properly.
|
the_Geometry.is_Transparent (True); -- TODO: Do transparency properly.
|
||||||
the_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
|
|
||||||
return the_Geometry;
|
return the_Geometry;
|
||||||
end new_Geometry;
|
end new_Geometry;
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ is
|
|||||||
the_Geometry : constant Geometry_view := Geometry.lit_colored_textured.new_Geometry (texture_is_Alpha => False);
|
the_Geometry : constant Geometry_view := Geometry.lit_colored_textured.new_Geometry (texture_is_Alpha => False);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
|
|
||||||
set_Sites:
|
set_Sites:
|
||||||
declare
|
declare
|
||||||
use linear_Algebra,
|
use linear_Algebra,
|
||||||
@@ -201,7 +203,6 @@ is
|
|||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
the_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
|
|
||||||
return [1 => Geometry.view (the_Geometry)];
|
return [1 => Geometry.view (the_Geometry)];
|
||||||
end to_GL_Geometries;
|
end to_GL_Geometries;
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ is
|
|||||||
the_Geometry : constant Geometry.lit_textured.view := Geometry.lit_textured.new_Geometry;
|
the_Geometry : constant Geometry.lit_textured.view := Geometry.lit_textured.new_Geometry;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
|
|
||||||
set_Sites:
|
set_Sites:
|
||||||
declare
|
declare
|
||||||
use linear_Algebra,
|
use linear_Algebra,
|
||||||
@@ -188,7 +190,6 @@ is
|
|||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
the_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
|
|
||||||
return [1 => Geometry.view (the_Geometry)];
|
return [1 => Geometry.view (the_Geometry)];
|
||||||
end to_GL_Geometries;
|
end to_GL_Geometries;
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ is
|
|||||||
the_Geometry : constant Geometry.textured.view := Geometry.textured.new_Geometry;
|
the_Geometry : constant Geometry.textured.view := Geometry.textured.new_Geometry;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
|
|
||||||
set_Sites:
|
set_Sites:
|
||||||
declare
|
declare
|
||||||
use linear_Algebra_3d;
|
use linear_Algebra_3d;
|
||||||
@@ -199,7 +201,6 @@ is
|
|||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
the_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
|
|
||||||
return [1 => Geometry.view (the_Geometry)];
|
return [1 => Geometry.view (the_Geometry)];
|
||||||
end to_GL_Geometries;
|
end to_GL_Geometries;
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ is
|
|||||||
the_Geometry : constant Geometry.lit_textured.view := Geometry.lit_textured.new_Geometry;
|
the_Geometry : constant Geometry.lit_textured.view := Geometry.lit_textured.new_Geometry;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
|
|
||||||
set_Sites:
|
set_Sites:
|
||||||
declare
|
declare
|
||||||
vert_Id : Index_t := 0;
|
vert_Id : Index_t := 0;
|
||||||
@@ -228,8 +230,6 @@ is
|
|||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
the_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
|
|
||||||
return [1 => Geometry.view (the_Geometry)];
|
return [1 => Geometry.view (the_Geometry)];
|
||||||
end to_GL_Geometries;
|
end to_GL_Geometries;
|
||||||
|
|
||||||
|
|||||||
@@ -284,59 +284,16 @@ is
|
|||||||
the_Primitive := Primitive.indexed .new_Primitive (Triangles, the_Indices);
|
the_Primitive := Primitive.indexed .new_Primitive (Triangles, the_Indices);
|
||||||
the_Geometry := Geometry.lit_colored_textured.new_Geometry (texture_is_Alpha => True);
|
the_Geometry := Geometry.lit_colored_textured.new_Geometry (texture_is_Alpha => True);
|
||||||
|
|
||||||
|
the_Geometry.Model_is (Self.all'unchecked_Access);
|
||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
the_Geometry.Vertices_are (the_Vertices);
|
the_Geometry.Vertices_are (the_Vertices);
|
||||||
the_Geometry.Texture_is (Texture.Forge.to_Texture (Self.Font.gl_Texture));
|
the_Geometry.Texture_is (Texture.Forge.to_Texture (Self.Font.gl_Texture));
|
||||||
the_Geometry.Model_is (Self.all'unchecked_Access);
|
|
||||||
the_Geometry.is_Transparent;
|
the_Geometry.is_Transparent;
|
||||||
|
|
||||||
-- the_Geometry.texture_Details_is (openGL.texture_Set.to_Details ([1 => to_Asset ("assets/textures/Face1.bmp")]));
|
|
||||||
|
|
||||||
return [1 => Geometry.view (the_Geometry)];
|
return [1 => Geometry.view (the_Geometry)];
|
||||||
end;
|
end;
|
||||||
end to_GL_Geometries;
|
end to_GL_Geometries;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
------------
|
|
||||||
-- Texturing
|
|
||||||
--
|
|
||||||
|
|
||||||
-- overriding
|
|
||||||
-- procedure Fade_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
|
||||||
-- Now : in texture_Set.fade_Level)
|
|
||||||
-- is
|
|
||||||
-- begin
|
|
||||||
-- null;
|
|
||||||
-- end Fade_is;
|
|
||||||
--
|
|
||||||
--
|
|
||||||
--
|
|
||||||
-- overriding
|
|
||||||
-- function Fade (Self : in Item; Which : in texture_Set.texture_Id) return texture_Set.fade_Level
|
|
||||||
-- is
|
|
||||||
-- begin
|
|
||||||
-- return 0.0;
|
|
||||||
-- end Fade;
|
|
||||||
--
|
|
||||||
--
|
|
||||||
--
|
|
||||||
-- procedure Texture_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
|
||||||
-- Now : in openGL.asset_Name)
|
|
||||||
-- is
|
|
||||||
-- begin
|
|
||||||
-- null;
|
|
||||||
-- end Texture_is;
|
|
||||||
--
|
|
||||||
--
|
|
||||||
--
|
|
||||||
--
|
|
||||||
-- overriding
|
|
||||||
-- function texture_Count (Self : in Item) return Natural
|
|
||||||
-- is
|
|
||||||
-- begin
|
|
||||||
-- return 1;
|
|
||||||
-- end texture_Count;
|
|
||||||
|
|
||||||
|
|
||||||
end openGL.Model.Text.lit_colored;
|
end openGL.Model.Text.lit_colored;
|
||||||
|
|||||||
@@ -8,6 +8,26 @@ is
|
|||||||
package body Mixin
|
package body Mixin
|
||||||
is
|
is
|
||||||
|
|
||||||
|
overriding
|
||||||
|
procedure texture_Object_is (Self : in out textured_Item; Which : in texture_Set.texture_Id;
|
||||||
|
Now : in openGL.texture.Object)
|
||||||
|
is
|
||||||
|
begin
|
||||||
|
Self.texture_Details.Objects (Integer (Which)) := Now;
|
||||||
|
end texture_Object_is;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
overriding
|
||||||
|
function texture_Object (Self : in textured_Item; Which : in texture_Set.texture_Id) return openGL.texture.Object
|
||||||
|
is
|
||||||
|
begin
|
||||||
|
return Self.texture_Details.Objects (Integer (Which));
|
||||||
|
end texture_Object;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
overriding
|
overriding
|
||||||
procedure Fade_is (Self : in out textured_Item; Which : in texture_Set.texture_Id;
|
procedure Fade_is (Self : in out textured_Item; Which : in texture_Set.texture_Id;
|
||||||
Now : in texture_Set.fade_Level)
|
Now : in texture_Set.fade_Level)
|
||||||
|
|||||||
@@ -18,6 +18,13 @@ is
|
|||||||
is
|
is
|
||||||
type textured_Item is abstract new Item with private;
|
type textured_Item is abstract new Item with private;
|
||||||
|
|
||||||
|
overriding
|
||||||
|
procedure texture_Object_is (Self : in out textured_Item; Which : in texture_Set.texture_Id;
|
||||||
|
Now : in openGL.texture.Object);
|
||||||
|
|
||||||
|
overriding
|
||||||
|
function texture_Object (Self : in textured_Item; Which : in texture_Set.texture_Id) return openGL.texture.Object;
|
||||||
|
|
||||||
|
|
||||||
overriding
|
overriding
|
||||||
function Fade (Self : in textured_Item; Which : in texture_Set.texture_Id) return texture_Set.fade_Level;
|
function Fade (Self : in textured_Item; Which : in texture_Set.texture_Id) return texture_Set.fade_Level;
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ is
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
procedure create_GL_Geometries (Self : in out Item'Class; Textures : access Texture.name_Map_of_texture'Class;
|
procedure create_GL_Geometries (Self : in out Item'Class; Textures : access openGL.Texture.name_Map_of_texture'Class;
|
||||||
Fonts : in Font.font_id_Map_of_font)
|
Fonts : in Font.font_id_Map_of_font)
|
||||||
is
|
is
|
||||||
all_Geometries : constant Geometry.views := Self.to_GL_Geometries (Textures, Fonts);
|
all_Geometries : constant Geometry.views := Self.to_GL_Geometries (Textures, Fonts);
|
||||||
@@ -222,6 +222,24 @@ is
|
|||||||
use ada.Tags;
|
use ada.Tags;
|
||||||
|
|
||||||
|
|
||||||
|
function texture_Object (Self : in Item; Which : in texture_Set.texture_Id) return openGL.texture.Object
|
||||||
|
is
|
||||||
|
begin
|
||||||
|
raise program_Error with External_Tag (Model.item'Class (Self)'Tag) & " Model does not support texturing.";
|
||||||
|
return openGL.Texture.null_Object;
|
||||||
|
end texture_Object;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
procedure texture_Object_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
||||||
|
Now : in openGL.texture.Object)
|
||||||
|
is
|
||||||
|
begin
|
||||||
|
raise program_Error with External_Tag (Model.item'Class (Self)'Tag) & " Model does not support texturing.";
|
||||||
|
end texture_Object_is;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
procedure Fade_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
procedure Fade_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
||||||
Now : in texture_Set.fade_Level)
|
Now : in texture_Set.fade_Level)
|
||||||
is
|
is
|
||||||
|
|||||||
@@ -74,6 +74,10 @@ is
|
|||||||
-- Texturing
|
-- Texturing
|
||||||
--
|
--
|
||||||
|
|
||||||
|
function texture_Object (Self : in Item; Which : in texture_Set.texture_Id) return texture.Object;
|
||||||
|
procedure texture_Object_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
||||||
|
Now : in texture.Object);
|
||||||
|
|
||||||
function Fade (Self : in Item; Which : in texture_Set.texture_Id) return texture_Set.fade_Level;
|
function Fade (Self : in Item; Which : in texture_Set.texture_Id) return texture_Set.fade_Level;
|
||||||
procedure Fade_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
procedure Fade_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
||||||
Now : in texture_Set.fade_Level);
|
Now : in texture_Set.fade_Level);
|
||||||
|
|||||||
@@ -49,10 +49,10 @@ is
|
|||||||
|
|
||||||
type fadeable_Texture is
|
type fadeable_Texture is
|
||||||
record
|
record
|
||||||
Fade : fade_Level := 0.0;
|
-- Fade : fade_Level := 0.0;
|
||||||
Object : openGL.Texture.Object := openGL.Texture.null_Object;
|
Object : openGL.Texture.Object := openGL.Texture.null_Object;
|
||||||
Applied : Boolean := True; -- Whether this texture is painted on or not.
|
-- Applied : Boolean := True; -- Whether this texture is painted on or not.
|
||||||
Tiling : texture_Set.Tiling := (1.0, 1.0);
|
-- Tiling : texture_Set.Tiling := (1.0, 1.0);
|
||||||
end record;
|
end record;
|
||||||
|
|
||||||
type fadeable_Textures is array (texture_Id range 1 .. max_Textures) of fadeable_Texture;
|
type fadeable_Textures is array (texture_Id range 1 .. max_Textures) of fadeable_Texture;
|
||||||
@@ -101,11 +101,12 @@ is
|
|||||||
type Details is
|
type Details is
|
||||||
record
|
record
|
||||||
Fades : fade_Levels (texture_Id) := [others => 0.0];
|
Fades : fade_Levels (texture_Id) := [others => 0.0];
|
||||||
Textures : asset_Names (1 .. Positive (texture_Id'Last)) := [others => null_Asset]; -- The textures to be applied to the visual.
|
Textures : asset_Names (1 .. Positive (texture_Id'Last)) := [others => null_Asset];
|
||||||
|
Objects : texture.Objects (1 .. Positive (texture_Id'Last)) := [others => texture.null_Object];
|
||||||
texture_Count : Natural := 0;
|
texture_Count : Natural := 0;
|
||||||
texture_Tilings : Tilings := [others => (S => 1.0,
|
texture_Tilings : Tilings := [others => (S => 1.0,
|
||||||
T => 1.0)];
|
T => 1.0)];
|
||||||
texture_Applies : texture_Apply_array := [1 => True, others => False];
|
texture_Applies : texture_Apply_array := [1 => True, others => False]; -- The textures to be applied to the visual.
|
||||||
Animation : Animation_view;
|
Animation : Animation_view;
|
||||||
end record;
|
end record;
|
||||||
|
|
||||||
@@ -126,12 +127,12 @@ is
|
|||||||
Textures : fadeable_Textures;
|
Textures : fadeable_Textures;
|
||||||
Count : Natural := 0;
|
Count : Natural := 0;
|
||||||
is_Transparent : Boolean := False; -- Any of the textures contains lucid colors.
|
is_Transparent : Boolean := False; -- Any of the textures contains lucid colors.
|
||||||
initialised : Boolean := False;
|
-- initialised : Boolean := False;
|
||||||
end record;
|
end record;
|
||||||
|
|
||||||
|
|
||||||
procedure Texture_is (in_Set : in out Item; Which : texture_ID := 1; Now : in openGL.Texture.Object);
|
-- procedure Texture_is (in_Set : in out Item; Which : texture_ID := 1; Now : in openGL.Texture.Object);
|
||||||
function Texture (in_Set : in Item; Which : texture_ID := 1) return openGL.Texture.Object;
|
-- function Texture (in_Set : in Item; Which : texture_ID := 1) return openGL.Texture.Object;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user