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
|
||||
is
|
||||
use openGL.texturing,
|
||||
use openGL.texture_Set,
|
||||
GL.lean,
|
||||
GL.Pointers,
|
||||
Interfaces,
|
||||
@@ -281,14 +281,14 @@ is
|
||||
--- 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
|
||||
begin
|
||||
Self.Textures.Textures (Which).Fade := Now;
|
||||
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
|
||||
begin
|
||||
return Self.Textures.Textures (Which).Fade;
|
||||
@@ -311,7 +311,7 @@ is
|
||||
function Texture (Self : in Item; Which : texture_ID) return openGL.Texture.Object
|
||||
is
|
||||
begin
|
||||
return openGL.texturing.Texture (in_Set => Self.Textures,
|
||||
return openGL.texture_Set.Texture (in_Set => Self.Textures,
|
||||
which => Which);
|
||||
end Texture;
|
||||
|
||||
@@ -330,7 +330,7 @@ is
|
||||
function Texture (Self : in Item) return openGL.Texture.Object
|
||||
is
|
||||
begin
|
||||
return openGL.texturing.Texture (in_Set => Self.Textures,
|
||||
return openGL.texture_Set.Texture (in_Set => Self.Textures,
|
||||
which => 1);
|
||||
end Texture;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
with
|
||||
openGL.texturing;
|
||||
openGL.texture_Set;
|
||||
|
||||
|
||||
package openGL.Geometry.lit_colored_textured
|
||||
@@ -42,12 +42,12 @@ is
|
||||
--- Texturing.
|
||||
--
|
||||
|
||||
procedure Fade_is (Self : in out Item; Which : texturing.texture_ID; Now : in texturing.fade_Level);
|
||||
function Fade (Self : in Item; Which : texturing.texture_ID) return 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 : 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);
|
||||
function Texture (Self : in Item; Which : texturing.texture_ID) return 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 : texture_Set.texture_ID) return openGL.Texture.Object;
|
||||
|
||||
overriding
|
||||
procedure Texture_is (Self : in out Item; Now : in openGL.Texture.Object);
|
||||
@@ -61,7 +61,7 @@ private
|
||||
|
||||
type Item is new Geometry.item with
|
||||
record
|
||||
Textures : texturing.texture_Set;
|
||||
Textures : texture_Set.texture_Set;
|
||||
end record;
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
with
|
||||
-- openGL.Geometry.texturing,
|
||||
openGL.Buffer.general,
|
||||
openGL.Model,
|
||||
openGL.Shader,
|
||||
@@ -25,7 +26,7 @@ package body openGL.Geometry.lit_textured
|
||||
is
|
||||
use GL.lean,
|
||||
GL.Pointers,
|
||||
openGL.texturing,
|
||||
openGL.texture_Set,
|
||||
Interfaces;
|
||||
|
||||
-----------
|
||||
@@ -57,13 +58,15 @@ is
|
||||
--- Uniforms
|
||||
--
|
||||
|
||||
type texture_Uniforms is
|
||||
type texture_fade_Uniform_pair is
|
||||
record
|
||||
texture_Uniform : openGL.Variable.uniform.sampler2D;
|
||||
fade_Uniform : openGL.Variable.uniform.float;
|
||||
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;
|
||||
|
||||
|
||||
@@ -305,7 +308,7 @@ is
|
||||
--- 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
|
||||
begin
|
||||
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
|
||||
begin
|
||||
return Self.texture_Set.Textures (which).Fade;
|
||||
@@ -334,8 +337,8 @@ is
|
||||
function Texture (Self : in Item; Which : texture_ID) return openGL.Texture.Object
|
||||
is
|
||||
begin
|
||||
return openGL.texturing.Texture (in_Set => Self.texture_Set,
|
||||
Which => Which);
|
||||
return openGL.texture_Set.Texture (in_Set => Self.texture_Set,
|
||||
Which => Which);
|
||||
end Texture;
|
||||
|
||||
|
||||
@@ -354,8 +357,8 @@ is
|
||||
function Texture (Self : in Item) return openGL.Texture.Object
|
||||
is
|
||||
begin
|
||||
return texturing.Texture (in_Set => Self.texture_Set,
|
||||
Which => 1);
|
||||
return texture_Set.Texture (in_Set => Self.texture_Set,
|
||||
Which => 1);
|
||||
end Texture;
|
||||
|
||||
|
||||
@@ -402,23 +405,53 @@ is
|
||||
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
|
||||
procedure enable_Textures (Self : in out Item)
|
||||
is
|
||||
begin
|
||||
for i in 1 .. texture_Id (Self.Model.texture_Count)
|
||||
loop
|
||||
the_Textures (i).fade_Uniform.Value_is (Real (Self.Model.Fade (i)));
|
||||
|
||||
glUniform1i (the_Textures (i).texture_Uniform.gl_Variable,
|
||||
GLint (i) - 1);
|
||||
glActiveTexture (all_texture_Units (i));
|
||||
glBindTexture (GL_TEXTURE_2D,
|
||||
Self.texture_Set.Textures (i).Object.Name);
|
||||
end loop;
|
||||
|
||||
the_texture_count_Uniform.Value_is (Self.texture_Set.Count);
|
||||
enable_Texturing (for_Model => Self.Model.all'Access,
|
||||
texturing_Uniforms => the_Textures,
|
||||
texture_Set => Self.texture_Set);
|
||||
--
|
||||
-- for i in 1 .. texture_Id (Self.Model.texture_Count)
|
||||
-- loop
|
||||
-- the_Textures (i).fade_Uniform.Value_is (Real (Self.Model.Fade (i)));
|
||||
--
|
||||
-- glUniform1i (the_Textures (i).texture_Uniform.gl_Variable,
|
||||
-- GLint (i) - 1);
|
||||
-- glActiveTexture (all_texture_Units (i));
|
||||
-- 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 openGL.Geometry.lit_textured;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
with
|
||||
openGL.texturing;
|
||||
openGL.texture_Set;
|
||||
|
||||
|
||||
package openGL.Geometry.lit_textured
|
||||
@@ -45,12 +45,12 @@ is
|
||||
--- Texturing.
|
||||
--
|
||||
|
||||
procedure Fade_is (Self : in out Item; Which : texturing.texture_ID; Now : in texturing.fade_Level);
|
||||
function Fade (Self : in Item; Which : texturing.texture_ID) return 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 : 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);
|
||||
function Texture (Self : in Item; Which : texturing.texture_ID) return 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 : texture_Set.texture_ID) return openGL.Texture.Object;
|
||||
|
||||
overriding
|
||||
procedure Texture_is (Self : in out Item; Now : in openGL.Texture.Object);
|
||||
@@ -64,7 +64,7 @@ private
|
||||
|
||||
type Item is new Geometry.item with
|
||||
record
|
||||
texture_Set : texturing.texture_Set;
|
||||
texture_Set : openGL.texture_Set.texture_Set;
|
||||
end record;
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ is
|
||||
use GL.lean,
|
||||
GL.Pointers,
|
||||
|
||||
openGL.texturing,
|
||||
openGL.texture_Set,
|
||||
|
||||
Interfaces,
|
||||
System;
|
||||
@@ -169,7 +169,7 @@ is
|
||||
--- 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
|
||||
begin
|
||||
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
|
||||
begin
|
||||
return Self.Textures.Textures (Which).Fade;
|
||||
@@ -198,7 +198,7 @@ is
|
||||
function Texture (Self : in Item; Which : texture_ID) return openGL.Texture.Object
|
||||
is
|
||||
begin
|
||||
return openGL.texturing.Texture (in_Set => Self.Textures,
|
||||
return openGL.texture_Set.Texture (in_Set => Self.Textures,
|
||||
Which => Which);
|
||||
end Texture;
|
||||
|
||||
@@ -218,7 +218,7 @@ is
|
||||
function Texture (Self : in Item) return openGL.Texture.Object
|
||||
is
|
||||
begin
|
||||
return openGL.texturing.Texture (in_Set => Self.Textures,
|
||||
return openGL.texture_Set.Texture (in_Set => Self.Textures,
|
||||
which => 1);
|
||||
end Texture;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
with
|
||||
openGL.texturing;
|
||||
openGL.texture_Set;
|
||||
|
||||
|
||||
package openGL.Geometry.textured
|
||||
@@ -42,12 +42,12 @@ is
|
||||
--- Texturing.
|
||||
--
|
||||
|
||||
procedure Fade_is (Self : in out Item; Which : texturing.texture_ID; Now : in texturing.fade_Level);
|
||||
function Fade (Self : in Item; Which : texturing.texture_ID) return 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 : 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);
|
||||
function Texture (Self : in Item; Which : texturing.texture_ID) return 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 : texture_Set.texture_ID) return openGL.Texture.Object;
|
||||
|
||||
overriding
|
||||
procedure Texture_is (Self : in out Item; Now : in openGL.Texture.Object);
|
||||
@@ -61,7 +61,7 @@ private
|
||||
|
||||
type Item is new Geometry.item with
|
||||
record
|
||||
Textures : texturing.texture_Set;
|
||||
Textures : texture_Set.texture_Set;
|
||||
end record;
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ with
|
||||
openGL.Buffer,
|
||||
openGL.Program,
|
||||
openGL.Texture,
|
||||
openGL.texturing;
|
||||
openGL.texture_Set;
|
||||
|
||||
limited
|
||||
with
|
||||
@@ -103,7 +103,7 @@ is
|
||||
private
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user