diff --git a/src/dlangui/graphics/glsupport.d b/src/dlangui/graphics/glsupport.d index 41552487..a4252b45 100644 --- a/src/dlangui/graphics/glsupport.d +++ b/src/dlangui/graphics/glsupport.d @@ -118,7 +118,7 @@ string glerrorToString(in GLenum err) pure nothrow { } -class GLProgram : dlangui.graphics.scene.effect.GraphicsEffect { +class GLProgram : dlangui.graphics.scene.mesh.GraphicsEffect { @property abstract string vertexSource(); @property abstract string fragmentSource(); protected GLuint program; diff --git a/src/dlangui/graphics/scene/effect.d b/src/dlangui/graphics/scene/effect.d index 1b03491c..806f07b2 100644 --- a/src/dlangui/graphics/scene/effect.d +++ b/src/dlangui/graphics/scene/effect.d @@ -9,22 +9,6 @@ import dlangui.graphics.glsupport; import dlangui.graphics.gldrawbuf; import dlangui.graphics.scene.mesh; -/// Base class for graphics effect / program - e.g. for OpenGL shader program -abstract class GraphicsEffect : RefCountedObject { - /// get location for vertex attribute - int getVertexElementLocation(VertexElementType type); - - void setUniform(string uniformName, mat4 matrix); - - void setUniform(string uniformName, vec2 vec); - - void setUniform(string uniformName, vec3 vec); - - void setUniform(string uniformName, vec4 vec); - - void draw(Mesh mesh); -} - /// Reference counted Effect object alias EffectRef = Ref!Effect; diff --git a/src/dlangui/graphics/scene/mesh.d b/src/dlangui/graphics/scene/mesh.d index 75200bc3..7f2adf41 100644 --- a/src/dlangui/graphics/scene/mesh.d +++ b/src/dlangui/graphics/scene/mesh.d @@ -8,6 +8,23 @@ import dlangui.graphics.scene.effect; /// Reference counted Mesh object alias MeshRef = Ref!Mesh; +/// Base class for graphics effect / program - e.g. for OpenGL shader program +abstract class GraphicsEffect : RefCountedObject { + /// get location for vertex attribute + int getVertexElementLocation(VertexElementType type); + + void setUniform(string uniformName, mat4 matrix); + + void setUniform(string uniformName, vec2 vec); + + void setUniform(string uniformName, vec3 vec); + + void setUniform(string uniformName, vec4 vec); + + void draw(Mesh mesh); +} + + /// vertex element type enum VertexElementType : ubyte { POSITION = 1,