diff --git a/3-mid/opengl/source/lean/shader/opengl-program.adb b/3-mid/opengl/source/lean/shader/opengl-program.adb index 0e663ef..6999b62 100644 --- a/3-mid/opengl/source/lean/shader/opengl-program.adb +++ b/3-mid/opengl/source/lean/shader/opengl-program.adb @@ -265,6 +265,15 @@ is end uniform_Variable; + function uniform_Variable (Self : access Item'Class; Named : in String) return Variable.uniform.sampler2D + is + the_Variable : Variable.uniform.sampler2D; + begin + the_Variable.define (Self, Named); + return the_Variable; + end uniform_Variable; + + -------------- -- Operations -- diff --git a/3-mid/opengl/source/lean/shader/opengl-program.ads b/3-mid/opengl/source/lean/shader/opengl-program.ads index 73e7c43..ac01127 100644 --- a/3-mid/opengl/source/lean/shader/opengl-program.ads +++ b/3-mid/opengl/source/lean/shader/opengl-program.ads @@ -65,6 +65,7 @@ is function uniform_Variable (Self : access Item'Class; Named : in String) return Variable.uniform.vec4; function uniform_Variable (Self : access Item'Class; Named : in String) return Variable.uniform.mat3; function uniform_Variable (Self : access Item'Class; Named : in String) return Variable.uniform.mat4; + function uniform_Variable (Self : access Item'Class; Named : in String) return Variable.uniform.sampler2D; function Attribute (Self : access Item'Class; Named : in String) return Attribute.view; function attribute_Location (Self : access Item'Class; Named : in String) return gl.GLuint; diff --git a/3-mid/opengl/source/lean/shader/opengl-variable-uniform.ads b/3-mid/opengl/source/lean/shader/opengl-variable-uniform.ads index f5ab95b..c471f9a 100644 --- a/3-mid/opengl/source/lean/shader/opengl-variable-uniform.ads +++ b/3-mid/opengl/source/lean/shader/opengl-variable-uniform.ads @@ -25,13 +25,15 @@ is -- Actuals -- - type bool is new Variable.uniform.item with private; - type int is new Variable.uniform.item with private; - type float is new Variable.uniform.item with private; - type vec3 is new Variable.uniform.item with private; - type vec4 is new Variable.uniform.item with private; - type mat3 is new Variable.uniform.item with private; - type mat4 is new Variable.uniform.item with private; + type bool is new Variable.uniform.item with private; + type int is new Variable.uniform.item with private; + type float is new Variable.uniform.item with private; + type vec3 is new Variable.uniform.item with private; + type vec4 is new Variable.uniform.item with private; + type mat3 is new Variable.uniform.item with private; + type mat4 is new Variable.uniform.item with private; + type sampler2D is new Variable.uniform.item with private; + procedure Value_is (Self : in bool; Now : in Boolean); procedure Value_is (Self : in int; Now : in Integer); @@ -45,16 +47,22 @@ is private - type Item is abstract new openGL.Variable.item with null record; + type Item is abstract new openGL.Variable.item with null record; - type bool is new Variable.uniform.item with null record; - type int is new Variable.uniform.item with null record; - type float is new Variable.uniform.item with null record; + type bool is new Variable.uniform.item with null record; + type int is new Variable.uniform.item with null record; + type float is new Variable.uniform.item with null record; - type vec3 is new Variable.uniform.item with null record; - type vec4 is new Variable.uniform.item with null record; + type vec3 is new Variable.uniform.item with null record; + type vec4 is new Variable.uniform.item with null record; - type mat3 is new Variable.uniform.item with null record; - type mat4 is new Variable.uniform.item with null record; + type mat3 is new Variable.uniform.item with null record; + type mat4 is new Variable.uniform.item with null record; + + type sampler2D is new Variable.uniform.item with null record; + + + + null_Uniform : constant gl.GLint := gl.GLint'Last; -- TODO: Use 'GL.GL_MAX_UNIFORM_LOCATIONS', when GL bindings is updated. end openGL.Variable.uniform;