opengl: Work on multi-texturing.
This commit is contained in:
@@ -5,6 +5,7 @@ with
|
||||
openGL.Attribute,
|
||||
openGL.Texture,
|
||||
openGL.Palette,
|
||||
openGL.Model,
|
||||
openGL.Tasks,
|
||||
openGL.Errors,
|
||||
|
||||
@@ -312,6 +313,10 @@ is
|
||||
is
|
||||
use openGL.Geometry.texturing;
|
||||
begin
|
||||
Self.Textures.Textures (1).Fade := Self.Model.Fade_1;
|
||||
Self.Textures.Textures (2).Fade := Self.Model.Fade_2;
|
||||
|
||||
|
||||
enable (Self.Textures, Self.Program);
|
||||
end enable_Texture;
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ with
|
||||
|
||||
ada.Strings.fixed;
|
||||
|
||||
with ada.Text_IO; use ada.Text_IO;
|
||||
|
||||
|
||||
package body openGL.Geometry.texturing
|
||||
is
|
||||
@@ -156,6 +158,8 @@ is
|
||||
uniform_Name : constant String := "Fade[" & Trim (Natural'Image (i - 1), Left) & "]";
|
||||
Uniform : constant openGL.Variable.uniform.float := Program.uniform_Variable (uniform_Name);
|
||||
begin
|
||||
-- put_Line ("Fade:" & the_Textures.Textures (texture_Id (i)).Fade'Image);
|
||||
|
||||
Uniform.Value_is (Real (the_Textures.Textures (texture_Id (i)).Fade));
|
||||
end;
|
||||
end loop;
|
||||
|
||||
@@ -50,6 +50,15 @@ is
|
||||
-- Attributes
|
||||
--
|
||||
|
||||
procedure Model_is (Self : in out Item; Now : in Model_view)
|
||||
is
|
||||
begin
|
||||
Self.Model := Now;
|
||||
end Model_is;
|
||||
|
||||
|
||||
|
||||
|
||||
function Label (Self : in Item'Class) return String
|
||||
is
|
||||
begin
|
||||
|
||||
@@ -4,6 +4,9 @@ with
|
||||
openGL.Program,
|
||||
openGL.Texture;
|
||||
|
||||
limited
|
||||
with
|
||||
openGL.Model;
|
||||
|
||||
private
|
||||
with
|
||||
@@ -38,6 +41,11 @@ is
|
||||
-- Attributes
|
||||
--
|
||||
|
||||
type Model_view is access all openGL.Model.item'Class;
|
||||
|
||||
procedure Model_is (Self : in out Item; Now : in Model_view);
|
||||
|
||||
|
||||
procedure Label_is (Self : in out Item'Class; Now : in String);
|
||||
function Label (Self : in Item'Class) return String;
|
||||
|
||||
@@ -90,16 +98,16 @@ is
|
||||
Sites : in openGL.Sites) return access Normals;
|
||||
|
||||
|
||||
|
||||
private
|
||||
use ada.Strings.unbounded;
|
||||
|
||||
type Textures is array (texture_Id) of openGL.Texture.Object;
|
||||
|
||||
|
||||
|
||||
|
||||
type Item is abstract tagged limited
|
||||
record
|
||||
Model : Model_view;
|
||||
Label : unbounded_String;
|
||||
Program : openGL.Program.view;
|
||||
Vertices : Buffer.view;
|
||||
|
||||
Reference in New Issue
Block a user