opengl: Rename 'openGL.texturing' to 'openGL.texture_Set'.
This commit is contained in:
@@ -18,7 +18,7 @@ with
|
|||||||
|
|
||||||
package body openGL.Geometry.lit_colored_textured
|
package body openGL.Geometry.lit_colored_textured
|
||||||
is
|
is
|
||||||
use openGL.texturing,
|
use openGL.texture_Set,
|
||||||
GL.lean,
|
GL.lean,
|
||||||
GL.Pointers,
|
GL.Pointers,
|
||||||
Interfaces,
|
Interfaces,
|
||||||
@@ -281,14 +281,14 @@ is
|
|||||||
--- Texturing
|
--- Texturing
|
||||||
--
|
--
|
||||||
|
|
||||||
procedure Fade_is (Self : in out Item; Which : texturing.texture_ID; Now : in texturing.fade_Level)
|
procedure Fade_is (Self : in out Item; Which : texture_Set.texture_ID; Now : in texture_Set.fade_Level)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
Self.Textures.Textures (Which).Fade := Now;
|
Self.Textures.Textures (Which).Fade := Now;
|
||||||
end Fade_is;
|
end Fade_is;
|
||||||
|
|
||||||
|
|
||||||
function Fade (Self : in Item; Which : texturing.texture_ID) return texturing.fade_Level
|
function Fade (Self : in Item; Which : texture_Set.texture_ID) return texture_Set.fade_Level
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
return Self.Textures.Textures (Which).Fade;
|
return Self.Textures.Textures (Which).Fade;
|
||||||
@@ -311,7 +311,7 @@ is
|
|||||||
function Texture (Self : in Item; Which : texture_ID) return openGL.Texture.Object
|
function Texture (Self : in Item; Which : texture_ID) return openGL.Texture.Object
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
return openGL.texturing.Texture (in_Set => Self.Textures,
|
return openGL.texture_Set.Texture (in_Set => Self.Textures,
|
||||||
which => Which);
|
which => Which);
|
||||||
end Texture;
|
end Texture;
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ is
|
|||||||
function Texture (Self : in Item) return openGL.Texture.Object
|
function Texture (Self : in Item) return openGL.Texture.Object
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
return openGL.texturing.Texture (in_Set => Self.Textures,
|
return openGL.texture_Set.Texture (in_Set => Self.Textures,
|
||||||
which => 1);
|
which => 1);
|
||||||
end Texture;
|
end Texture;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
with
|
with
|
||||||
openGL.texturing;
|
openGL.texture_Set;
|
||||||
|
|
||||||
|
|
||||||
package openGL.Geometry.lit_colored_textured
|
package openGL.Geometry.lit_colored_textured
|
||||||
@@ -42,12 +42,12 @@ is
|
|||||||
--- Texturing.
|
--- Texturing.
|
||||||
--
|
--
|
||||||
|
|
||||||
procedure Fade_is (Self : in out Item; Which : texturing.texture_ID; Now : in texturing.fade_Level);
|
procedure Fade_is (Self : in out Item; Which : texture_Set.texture_ID; Now : in texture_Set.fade_Level);
|
||||||
function Fade (Self : in Item; Which : texturing.texture_ID) return texturing.fade_Level;
|
function Fade (Self : in Item; Which : texture_Set.texture_ID) return texture_Set.fade_Level;
|
||||||
|
|
||||||
|
|
||||||
procedure Texture_is (Self : in out Item; Which : texturing.texture_ID; Now : in openGL.Texture.Object);
|
procedure Texture_is (Self : in out Item; Which : texture_Set.texture_ID; Now : in openGL.Texture.Object);
|
||||||
function Texture (Self : in Item; Which : texturing.texture_ID) return openGL.Texture.Object;
|
function Texture (Self : in Item; Which : texture_Set.texture_ID) return openGL.Texture.Object;
|
||||||
|
|
||||||
overriding
|
overriding
|
||||||
procedure Texture_is (Self : in out Item; Now : in openGL.Texture.Object);
|
procedure Texture_is (Self : in out Item; Now : in openGL.Texture.Object);
|
||||||
@@ -61,7 +61,7 @@ private
|
|||||||
|
|
||||||
type Item is new Geometry.item with
|
type Item is new Geometry.item with
|
||||||
record
|
record
|
||||||
Textures : texturing.texture_Set;
|
Textures : texture_Set.texture_Set;
|
||||||
end record;
|
end record;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
with
|
with
|
||||||
|
-- openGL.Geometry.texturing,
|
||||||
openGL.Buffer.general,
|
openGL.Buffer.general,
|
||||||
openGL.Model,
|
openGL.Model,
|
||||||
openGL.Shader,
|
openGL.Shader,
|
||||||
@@ -25,7 +26,7 @@ package body openGL.Geometry.lit_textured
|
|||||||
is
|
is
|
||||||
use GL.lean,
|
use GL.lean,
|
||||||
GL.Pointers,
|
GL.Pointers,
|
||||||
openGL.texturing,
|
openGL.texture_Set,
|
||||||
Interfaces;
|
Interfaces;
|
||||||
|
|
||||||
-----------
|
-----------
|
||||||
@@ -57,13 +58,15 @@ is
|
|||||||
--- Uniforms
|
--- Uniforms
|
||||||
--
|
--
|
||||||
|
|
||||||
type texture_Uniforms is
|
type texture_fade_Uniform_pair is
|
||||||
record
|
record
|
||||||
texture_Uniform : openGL.Variable.uniform.sampler2D;
|
texture_Uniform : openGL.Variable.uniform.sampler2D;
|
||||||
fade_Uniform : openGL.Variable.uniform.float;
|
fade_Uniform : openGL.Variable.uniform.float;
|
||||||
end record;
|
end record;
|
||||||
|
|
||||||
the_Textures : array (texture_Id range 1 .. max_Textures) of texture_Uniforms;
|
type texture_fade_Uniform_pairs is array (texture_Id range 1 .. max_Textures) of texture_fade_Uniform_pair;
|
||||||
|
|
||||||
|
the_Textures : texture_fade_Uniform_pairs;
|
||||||
the_texture_count_Uniform : openGL.Variable.uniform.int;
|
the_texture_count_Uniform : openGL.Variable.uniform.int;
|
||||||
|
|
||||||
|
|
||||||
@@ -305,7 +308,7 @@ is
|
|||||||
--- Texturing
|
--- Texturing
|
||||||
--
|
--
|
||||||
|
|
||||||
procedure Fade_is (Self : in out Item; Which : texture_ID; Now : in texturing.fade_Level)
|
procedure Fade_is (Self : in out Item; Which : texture_ID; Now : in texture_Set.fade_Level)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
Self.texture_Set.Textures (which).Fade := Now;
|
Self.texture_Set.Textures (which).Fade := Now;
|
||||||
@@ -313,7 +316,7 @@ is
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function Fade (Self : in Item; Which : texturing.texture_ID) return texturing.fade_Level
|
function Fade (Self : in Item; Which : texture_Set.texture_ID) return texture_Set.fade_Level
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
return Self.texture_Set.Textures (which).Fade;
|
return Self.texture_Set.Textures (which).Fade;
|
||||||
@@ -334,8 +337,8 @@ is
|
|||||||
function Texture (Self : in Item; Which : texture_ID) return openGL.Texture.Object
|
function Texture (Self : in Item; Which : texture_ID) return openGL.Texture.Object
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
return openGL.texturing.Texture (in_Set => Self.texture_Set,
|
return openGL.texture_Set.Texture (in_Set => Self.texture_Set,
|
||||||
Which => Which);
|
Which => Which);
|
||||||
end Texture;
|
end Texture;
|
||||||
|
|
||||||
|
|
||||||
@@ -354,8 +357,8 @@ is
|
|||||||
function Texture (Self : in Item) return openGL.Texture.Object
|
function Texture (Self : in Item) return openGL.Texture.Object
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
return texturing.Texture (in_Set => Self.texture_Set,
|
return texture_Set.Texture (in_Set => Self.texture_Set,
|
||||||
Which => 1);
|
Which => 1);
|
||||||
end Texture;
|
end Texture;
|
||||||
|
|
||||||
|
|
||||||
@@ -402,23 +405,53 @@ is
|
|||||||
GL_TEXTURE31);
|
GL_TEXTURE31);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
procedure enable_Texturing (for_Model : in openGL.Model.view;
|
||||||
|
texturing_Uniforms : in texture_fade_Uniform_pairs;
|
||||||
|
texture_Set : in openGL.texture_Set.texture_Set)
|
||||||
|
is
|
||||||
|
begin
|
||||||
|
for i in 1 .. texture_Id (for_Model.texture_Count)
|
||||||
|
loop
|
||||||
|
texturing_Uniforms (i).fade_Uniform.Value_is (Real (for_Model.Fade (i)));
|
||||||
|
|
||||||
|
glUniform1i (texturing_Uniforms (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;
|
||||||
|
|
||||||
|
the_texture_count_Uniform.Value_is (for_Model.texture_Count);
|
||||||
|
end enable_Texturing;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
overriding
|
overriding
|
||||||
procedure enable_Textures (Self : in out Item)
|
procedure enable_Textures (Self : in out Item)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
for i in 1 .. texture_Id (Self.Model.texture_Count)
|
enable_Texturing (for_Model => Self.Model.all'Access,
|
||||||
loop
|
texturing_Uniforms => the_Textures,
|
||||||
the_Textures (i).fade_Uniform.Value_is (Real (Self.Model.Fade (i)));
|
texture_Set => Self.texture_Set);
|
||||||
|
--
|
||||||
glUniform1i (the_Textures (i).texture_Uniform.gl_Variable,
|
-- for i in 1 .. texture_Id (Self.Model.texture_Count)
|
||||||
GLint (i) - 1);
|
-- loop
|
||||||
glActiveTexture (all_texture_Units (i));
|
-- the_Textures (i).fade_Uniform.Value_is (Real (Self.Model.Fade (i)));
|
||||||
glBindTexture (GL_TEXTURE_2D,
|
--
|
||||||
Self.texture_Set.Textures (i).Object.Name);
|
-- glUniform1i (the_Textures (i).texture_Uniform.gl_Variable,
|
||||||
end loop;
|
-- GLint (i) - 1);
|
||||||
|
-- glActiveTexture (all_texture_Units (i));
|
||||||
the_texture_count_Uniform.Value_is (Self.texture_Set.Count);
|
-- glBindTexture (GL_TEXTURE_2D,
|
||||||
|
-- Self.texture_Set.Textures (i).Object.Name);
|
||||||
|
-- end loop;
|
||||||
|
--
|
||||||
|
-- the_texture_count_Uniform.Value_is (Self.texture_Set.Count);
|
||||||
end enable_Textures;
|
end enable_Textures;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end openGL.Geometry.lit_textured;
|
end openGL.Geometry.lit_textured;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
with
|
with
|
||||||
openGL.texturing;
|
openGL.texture_Set;
|
||||||
|
|
||||||
|
|
||||||
package openGL.Geometry.lit_textured
|
package openGL.Geometry.lit_textured
|
||||||
@@ -45,12 +45,12 @@ is
|
|||||||
--- Texturing.
|
--- Texturing.
|
||||||
--
|
--
|
||||||
|
|
||||||
procedure Fade_is (Self : in out Item; Which : texturing.texture_ID; Now : in texturing.fade_Level);
|
procedure Fade_is (Self : in out Item; Which : texture_Set.texture_ID; Now : in texture_Set.fade_Level);
|
||||||
function Fade (Self : in Item; Which : texturing.texture_ID) return texturing.fade_Level;
|
function Fade (Self : in Item; Which : texture_Set.texture_ID) return texture_Set.fade_Level;
|
||||||
|
|
||||||
|
|
||||||
procedure Texture_is (Self : in out Item; Which : texturing.texture_ID; Now : in openGL.Texture.Object);
|
procedure Texture_is (Self : in out Item; Which : texture_Set.texture_ID; Now : in openGL.Texture.Object);
|
||||||
function Texture (Self : in Item; Which : texturing.texture_ID) return openGL.Texture.Object;
|
function Texture (Self : in Item; Which : texture_Set.texture_ID) return openGL.Texture.Object;
|
||||||
|
|
||||||
overriding
|
overriding
|
||||||
procedure Texture_is (Self : in out Item; Now : in openGL.Texture.Object);
|
procedure Texture_is (Self : in out Item; Now : in openGL.Texture.Object);
|
||||||
@@ -64,7 +64,7 @@ private
|
|||||||
|
|
||||||
type Item is new Geometry.item with
|
type Item is new Geometry.item with
|
||||||
record
|
record
|
||||||
texture_Set : texturing.texture_Set;
|
texture_Set : openGL.texture_Set.texture_Set;
|
||||||
end record;
|
end record;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ is
|
|||||||
use GL.lean,
|
use GL.lean,
|
||||||
GL.Pointers,
|
GL.Pointers,
|
||||||
|
|
||||||
openGL.texturing,
|
openGL.texture_Set,
|
||||||
|
|
||||||
Interfaces,
|
Interfaces,
|
||||||
System;
|
System;
|
||||||
@@ -169,7 +169,7 @@ is
|
|||||||
--- Texturing
|
--- Texturing
|
||||||
--
|
--
|
||||||
|
|
||||||
procedure Fade_is (Self : in out Item; Which : texturing.texture_ID; Now : in texturing.fade_Level)
|
procedure Fade_is (Self : in out Item; Which : texture_Set.texture_ID; Now : in texture_Set.fade_Level)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
Self.Textures.Textures (Which).Fade := Now;
|
Self.Textures.Textures (Which).Fade := Now;
|
||||||
@@ -177,7 +177,7 @@ is
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function Fade (Self : in Item; Which : texturing.texture_ID) return texturing.fade_Level
|
function Fade (Self : in Item; Which : texture_Set.texture_ID) return texture_Set.fade_Level
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
return Self.Textures.Textures (Which).Fade;
|
return Self.Textures.Textures (Which).Fade;
|
||||||
@@ -198,7 +198,7 @@ is
|
|||||||
function Texture (Self : in Item; Which : texture_ID) return openGL.Texture.Object
|
function Texture (Self : in Item; Which : texture_ID) return openGL.Texture.Object
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
return openGL.texturing.Texture (in_Set => Self.Textures,
|
return openGL.texture_Set.Texture (in_Set => Self.Textures,
|
||||||
Which => Which);
|
Which => Which);
|
||||||
end Texture;
|
end Texture;
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ is
|
|||||||
function Texture (Self : in Item) return openGL.Texture.Object
|
function Texture (Self : in Item) return openGL.Texture.Object
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
return openGL.texturing.Texture (in_Set => Self.Textures,
|
return openGL.texture_Set.Texture (in_Set => Self.Textures,
|
||||||
which => 1);
|
which => 1);
|
||||||
end Texture;
|
end Texture;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
with
|
with
|
||||||
openGL.texturing;
|
openGL.texture_Set;
|
||||||
|
|
||||||
|
|
||||||
package openGL.Geometry.textured
|
package openGL.Geometry.textured
|
||||||
@@ -42,12 +42,12 @@ is
|
|||||||
--- Texturing.
|
--- Texturing.
|
||||||
--
|
--
|
||||||
|
|
||||||
procedure Fade_is (Self : in out Item; Which : texturing.texture_ID; Now : in texturing.fade_Level);
|
procedure Fade_is (Self : in out Item; Which : texture_Set.texture_ID; Now : in texture_Set.fade_Level);
|
||||||
function Fade (Self : in Item; Which : texturing.texture_ID) return texturing.fade_Level;
|
function Fade (Self : in Item; Which : texture_Set.texture_ID) return texture_Set.fade_Level;
|
||||||
|
|
||||||
|
|
||||||
procedure Texture_is (Self : in out Item; Which : texturing.texture_ID; Now : in openGL.Texture.Object);
|
procedure Texture_is (Self : in out Item; Which : texture_Set.texture_ID; Now : in openGL.Texture.Object);
|
||||||
function Texture (Self : in Item; Which : texturing.texture_ID) return openGL.Texture.Object;
|
function Texture (Self : in Item; Which : texture_Set.texture_ID) return openGL.Texture.Object;
|
||||||
|
|
||||||
overriding
|
overriding
|
||||||
procedure Texture_is (Self : in out Item; Now : in openGL.Texture.Object);
|
procedure Texture_is (Self : in out Item; Now : in openGL.Texture.Object);
|
||||||
@@ -61,7 +61,7 @@ private
|
|||||||
|
|
||||||
type Item is new Geometry.item with
|
type Item is new Geometry.item with
|
||||||
record
|
record
|
||||||
Textures : texturing.texture_Set;
|
Textures : texture_Set.texture_Set;
|
||||||
end record;
|
end record;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ with
|
|||||||
openGL.Buffer,
|
openGL.Buffer,
|
||||||
openGL.Program,
|
openGL.Program,
|
||||||
openGL.Texture,
|
openGL.Texture,
|
||||||
openGL.texturing;
|
openGL.texture_Set;
|
||||||
|
|
||||||
limited
|
limited
|
||||||
with
|
with
|
||||||
@@ -103,7 +103,7 @@ is
|
|||||||
private
|
private
|
||||||
use ada.Strings.unbounded;
|
use ada.Strings.unbounded;
|
||||||
|
|
||||||
type Textures is array (texturing.texture_Id) of openGL.Texture.Object;
|
type Textures is array (texture_Set.texture_Id) of openGL.Texture.Object;
|
||||||
|
|
||||||
|
|
||||||
type Item is abstract tagged limited
|
type Item is abstract tagged limited
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ is
|
|||||||
--
|
--
|
||||||
|
|
||||||
overriding
|
overriding
|
||||||
procedure Fade_is (Self : in out Item; Which : in texturing.texture_Id;
|
procedure Fade_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
||||||
Now : in texturing.fade_Level)
|
Now : in texture_Set.fade_Level)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
Self.Face.Fades (which) := Now;
|
Self.Face.Fades (which) := Now;
|
||||||
@@ -43,7 +43,7 @@ is
|
|||||||
|
|
||||||
|
|
||||||
overriding
|
overriding
|
||||||
function Fade (Self : in Item; Which : in texturing.texture_Id) return texturing.fade_Level
|
function Fade (Self : in Item; Which : in texture_Set.texture_Id) return texture_Set.fade_Level
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
return Self.Face.Fades (which);
|
return Self.Face.Fades (which);
|
||||||
@@ -51,7 +51,7 @@ is
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
procedure Texture_is (Self : in out Item; Which : in texturing.texture_Id;
|
procedure Texture_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
||||||
Now : in openGL.asset_Name)
|
Now : in openGL.asset_Name)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
@@ -88,7 +88,7 @@ is
|
|||||||
function new_Face (Vertices : in geometry.lit_textured.Vertex_array) return Geometry.lit_textured.view
|
function new_Face (Vertices : in geometry.lit_textured.Vertex_array) return Geometry.lit_textured.view
|
||||||
is
|
is
|
||||||
use Primitive,
|
use Primitive,
|
||||||
texturing;
|
texture_Set;
|
||||||
|
|
||||||
the_Geometry : constant Geometry.lit_textured.view
|
the_Geometry : constant Geometry.lit_textured.view
|
||||||
:= Geometry.lit_textured.new_Geometry;
|
:= Geometry.lit_textured.new_Geometry;
|
||||||
@@ -96,7 +96,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);
|
||||||
|
|
||||||
Id : texturing.texture_Id;
|
Id : texture_Set.texture_Id;
|
||||||
begin
|
begin
|
||||||
the_Geometry.Vertices_are (Vertices);
|
the_Geometry.Vertices_are (Vertices);
|
||||||
the_Geometry.add (Primitive.view (the_Primitive));
|
the_Geometry.add (Primitive.view (the_Primitive));
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
with
|
with
|
||||||
openGL.texturing,
|
openGL.texture_Set,
|
||||||
openGL.Texture;
|
openGL.Texture;
|
||||||
|
|
||||||
|
|
||||||
@@ -14,8 +14,8 @@ is
|
|||||||
|
|
||||||
type Face is
|
type Face is
|
||||||
record
|
record
|
||||||
Fades : texturing.fade_Levels (texturing.texture_Id) := [others => 0.0];
|
Fades : texture_Set.fade_Levels (texture_Set.texture_Id) := [others => 0.0];
|
||||||
Textures : openGL.asset_Names (1 .. Positive (texturing.texture_Id'Last)) := [others => null_Asset]; -- The textures to be applied to the hex.
|
Textures : openGL.asset_Names (1 .. Positive (texture_Set.texture_Id'Last)) := [others => null_Asset]; -- The textures to be applied to the hex.
|
||||||
texture_Count : Natural := 0;
|
texture_Count : Natural := 0;
|
||||||
end record;
|
end record;
|
||||||
|
|
||||||
@@ -41,13 +41,13 @@ is
|
|||||||
--
|
--
|
||||||
|
|
||||||
overriding
|
overriding
|
||||||
function Fade (Self : in Item; Which : in texturing.texture_Id) return texturing.fade_Level;
|
function Fade (Self : in Item; Which : in texture_Set.texture_Id) return texture_Set.fade_Level;
|
||||||
|
|
||||||
overriding
|
overriding
|
||||||
procedure Fade_is (Self : in out Item; Which : in texturing.texture_Id;
|
procedure Fade_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
||||||
Now : in texturing.fade_Level);
|
Now : in texture_Set.fade_Level);
|
||||||
|
|
||||||
procedure Texture_is (Self : in out Item; Which : in texturing.texture_Id;
|
procedure Texture_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
||||||
Now : in asset_Name);
|
Now : in asset_Name);
|
||||||
|
|
||||||
overriding
|
overriding
|
||||||
|
|||||||
@@ -218,8 +218,8 @@ is
|
|||||||
-- Texturing
|
-- Texturing
|
||||||
--
|
--
|
||||||
|
|
||||||
procedure Fade_is (Self : in out Item; which : in texturing.texture_Id;
|
procedure Fade_is (Self : in out Item; which : in texture_Set.texture_Id;
|
||||||
now : in texturing.fade_Level)
|
now : in texture_Set.fade_Level)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
raise program_Error with "Model does not support texturing.";
|
raise program_Error with "Model does not support texturing.";
|
||||||
@@ -227,7 +227,7 @@ is
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function Fade (Self : in Item; which : in texturing.texture_Id) return texturing.fade_Level
|
function Fade (Self : in Item; which : in texture_Set.texture_Id) return texture_Set.fade_Level
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
raise program_Error with "Model does not support texturing.";
|
raise program_Error with "Model does not support texturing.";
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ with
|
|||||||
openGL.Font,
|
openGL.Font,
|
||||||
openGL.Texture,
|
openGL.Texture,
|
||||||
openGL.Geometry,
|
openGL.Geometry,
|
||||||
openGL.texturing;
|
openGL.texture_Set;
|
||||||
|
|
||||||
|
|
||||||
package openGL.Model
|
package openGL.Model
|
||||||
@@ -74,9 +74,9 @@ is
|
|||||||
-- Texturing
|
-- Texturing
|
||||||
--
|
--
|
||||||
|
|
||||||
function Fade (Self : in Item; Which : in texturing.texture_Id) return texturing.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 texturing.texture_Id;
|
procedure Fade_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
||||||
Now : in texturing.fade_Level);
|
Now : in texture_Set.fade_Level);
|
||||||
|
|
||||||
function texture_Count (Self : in Item) return Natural;
|
function texture_Count (Self : in Item) return Natural;
|
||||||
|
|
||||||
|
|||||||
@@ -9,16 +9,16 @@ with
|
|||||||
with ada.Text_IO; use ada.Text_IO;
|
with ada.Text_IO; use ada.Text_IO;
|
||||||
|
|
||||||
|
|
||||||
package body openGL.texturing
|
package body openGL.texture_Set
|
||||||
is
|
is
|
||||||
|
|
||||||
procedure Texture_is (in_Set : in out texture_Set; Which : texture_ID; Now : in openGL.Texture.Object)
|
procedure Texture_is (in_Set : in out texture_Set; Which : texture_ID; Now : in openGL.Texture.Object)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
in_Set.Textures (Which) := (0.0,
|
in_Set.Textures (Which) := (0.0,
|
||||||
Now,
|
Now); --,
|
||||||
texture_Uniform => <>,
|
-- texture_Uniform => <>,
|
||||||
fade_Uniform => <>);
|
-- fade_Uniform => <>);
|
||||||
|
|
||||||
in_Set.is_Transparent := in_Set.is_Transparent
|
in_Set.is_Transparent := in_Set.is_Transparent
|
||||||
or Now .is_Transparent;
|
or Now .is_Transparent;
|
||||||
@@ -87,11 +87,11 @@ is
|
|||||||
begin
|
begin
|
||||||
null;
|
null;
|
||||||
|
|
||||||
declare
|
-- declare
|
||||||
uniform_Name : aliased constant String :="Textures[" & Trim (Natural'Image (i - 1), Left) & "]";
|
-- uniform_Name : aliased constant String :="Textures[" & Trim (Natural'Image (i - 1), Left) & "]";
|
||||||
begin
|
-- begin
|
||||||
the_Textures.Textures (Id).texture_Uniform := Program.uniform_Variable (Named => uniform_Name);
|
-- the_Textures.Textures (Id).texture_Uniform := Program.uniform_Variable (Named => uniform_Name);
|
||||||
end;
|
-- end;
|
||||||
|
|
||||||
-- declare
|
-- declare
|
||||||
-- uniform_Name : constant String := "Fade[" & Trim (Natural'Image (i - 1), Left) & "]";
|
-- uniform_Name : constant String := "Fade[" & Trim (Natural'Image (i - 1), Left) & "]";
|
||||||
@@ -150,11 +150,11 @@ is
|
|||||||
Id : constant texture_Id := texture_Id (i);
|
Id : constant texture_Id := texture_Id (i);
|
||||||
begin
|
begin
|
||||||
null;
|
null;
|
||||||
glUniform1i (the_Textures.Textures (Id).texture_Uniform.gl_Variable,
|
-- glUniform1i (the_Textures.Textures (Id).texture_Uniform.gl_Variable,
|
||||||
GLint (i) - 1);
|
-- GLint (i) - 1);
|
||||||
glActiveTexture (all_texture_Units (Id));
|
-- glActiveTexture (all_texture_Units (Id));
|
||||||
glBindTexture (GL_TEXTURE_2D,
|
-- glBindTexture (GL_TEXTURE_2D,
|
||||||
the_Textures.Textures (Id).Object.Name);
|
-- the_Textures.Textures (Id).Object.Name);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@@ -183,4 +183,4 @@ is
|
|||||||
end enable;
|
end enable;
|
||||||
|
|
||||||
|
|
||||||
end openGL.texturing;
|
end openGL.texture_Set;
|
||||||
@@ -4,7 +4,7 @@ with
|
|||||||
openGL.Variable.uniform;
|
openGL.Variable.uniform;
|
||||||
|
|
||||||
|
|
||||||
package openGL.texturing
|
package openGL.texture_Set
|
||||||
--
|
--
|
||||||
-- Facilitates texturing of geometries.
|
-- Facilitates texturing of geometries.
|
||||||
--
|
--
|
||||||
@@ -25,8 +25,8 @@ 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;
|
||||||
texture_Uniform : openGL.Variable.uniform.sampler2D;
|
-- texture_Uniform : openGL.Variable.uniform.sampler2D;
|
||||||
fade_Uniform : openGL.Variable.uniform.float;
|
-- fade_Uniform : openGL.Variable.uniform.float;
|
||||||
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;
|
||||||
@@ -51,4 +51,4 @@ is
|
|||||||
function Texture (in_Set : in texture_Set) return openGL.Texture.Object;
|
function Texture (in_Set : in texture_Set) return openGL.Texture.Object;
|
||||||
|
|
||||||
|
|
||||||
end openGL.texturing;
|
end openGL.texture_Set;
|
||||||
Reference in New Issue
Block a user