From 2f7f059e2cfb7cdbc7e3d13fccf0d7223e74e4c2 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 27 Oct 2010 18:09:26 +0100 Subject: [PATCH 1/4] Added framebuffer sample --- sample/05-core-framebuffer.cpp | 430 +++++++++++++++++++++++++++++++++ sample/CMakeLists.txt | 5 +- sample/data/framebuffer.frag | 9 + sample/data/framebuffer.vert | 8 + 4 files changed, 450 insertions(+), 2 deletions(-) create mode 100644 sample/05-core-framebuffer.cpp create mode 100644 sample/data/framebuffer.frag create mode 100644 sample/data/framebuffer.vert diff --git a/sample/05-core-framebuffer.cpp b/sample/05-core-framebuffer.cpp new file mode 100644 index 00000000..14c6e42e --- /dev/null +++ b/sample/05-core-framebuffer.cpp @@ -0,0 +1,430 @@ +//********************************** +// Kueken sample 05 +// 18/10/2010 +//********************************** +// Christophe Riccio +// christophe@g-truc.net +//********************************** +// G-Truc Creation +// www.g-truc.net +//********************************** + +#include +#include + +namespace +{ + const char* SAMPLE_NAME = "Kueken sample 05"; + const char* VERT_SHADER_SOURCE0 = "./data/texture.vert"; + const char* FRAG_SHADER_SOURCE0 = "./data/texture.frag"; + const char* VERT_SHADER_SOURCE1 = "./data/framebuffer.vert"; + const char* FRAG_SHADER_SOURCE1 = "./data/framebuffer.frag"; + const char* TEXTURE_DIFFUSE = "./data/küken256dxt5.dds"; + int const SAMPLE_FRAMEBUFFER_X(640); + int const SAMPLE_FRAMEBUFFER_Y(480); + int const SAMPLE_OFFSCREEN_X(256); + int const SAMPLE_OFFSCREEN_Y(256); + int const SAMPLE_MAJOR_VERSION(4); + int const SAMPLE_MINOR_VERSION(0); + + glf::window Window(glm::ivec2(SAMPLE_FRAMEBUFFER_X, SAMPLE_FRAMEBUFFER_Y)); + + GLsizei const VertexCount(4); + GLsizeiptr const VertexSize = VertexCount * sizeof(glf::vertex_v2fv2f); + glf::vertex_v2fv2f const VertexData[VertexCount] = + { + glf::vertex_v2fv2f(glm::vec2(-1.0f,-1.0f), glm::vec2(0.0f, 1.0f)), + glf::vertex_v2fv2f(glm::vec2( 1.0f,-1.0f), glm::vec2(1.0f, 1.0f)), + glf::vertex_v2fv2f(glm::vec2( 1.0f, 1.0f), glm::vec2(1.0f, 0.0f)), + glf::vertex_v2fv2f(glm::vec2(-1.0f, 1.0f), glm::vec2(0.0f, 0.0f)) + }; + + GLsizei const ElementCount(6); + GLsizeiptr const ElementSize = ElementCount * sizeof(GLuint); + GLuint const ElementData[ElementCount] = + { + 0, 1, 2, + 2, 3, 0 + }; + + std::unique_ptr Renderer(nullptr); + + kueken::blend::name Blend(kueken::blend::name::null()); + kueken::clear::name Clear(kueken::clear::name::null()); + kueken::draw::name Draw(kueken::draw::name::null()); + + kueken::sampler::name SamplerOutput(kueken::sampler::name::null()); + kueken::sampler::name SamplerOffscreen(kueken::sampler::name::null()); + + kueken::test::name Test(kueken::test::name::null()); + kueken::layout::name Layout(kueken::layout::name::null()); + + kueken::buffer::name ArrayBuffer(kueken::buffer::name::null()); + kueken::buffer::name ElementBuffer(kueken::buffer::name::null()); + kueken::buffer::name UniformBuffer(kueken::buffer::name::null()); + + kueken::program::name ProgramOffscreen(kueken::program::name::null()); + kueken::rasterizer::name RasterizerOffscreen(kueken::rasterizer::name::null()); + kueken::framebuffer::name FramebufferOffscreen(kueken::framebuffer::name::null()); + + kueken::program::name ProgramOutput(kueken::program::name::null()); + kueken::rasterizer::name RasterizerOutput(kueken::rasterizer::name::null()); + kueken::framebuffer::name FramebufferOutput(kueken::framebuffer::name::null()); + + kueken::texture::name TextureColorbuffer(kueken::texture::name::null()); + kueken::texture::name TextureDiffuse(kueken::texture::name::null()); + + kueken::program::semantic const SEMANTIC_UNIF_DIFFUSE(0); + kueken::program::semantic const SEMANTIC_UNIF_MVP(1); + kueken::program::semantic const SEMANTIC_ATTR_POSITION(kueken::layout::POSITION); + kueken::program::semantic const SEMANTIC_ATTR_TEXCOORD(kueken::layout::TEXCOORD); + kueken::program::semantic const SEMANTIC_FRAG_COLOR(0); +} + +void display() +{ + Renderer->bind(kueken::test::TEST, Test); + Renderer->bind(kueken::blend::BLEND, Blend); + + { + glm::mat4 Projection = glm::perspective(45.0f, float(Window.Size.x) / float(Window.Size.y), 0.1f, 100.0f); + glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Window.TranlationCurrent.y)); + glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Window.RotationCurrent.y, glm::vec3(1.f, 0.f, 0.f)); + glm::mat4 View = glm::rotate(ViewRotateX, Window.RotationCurrent.x, glm::vec3(0.f, 1.f, 0.f)); + glm::mat4 Model = glm::mat4(1.0f); + glm::mat4 MVP = Projection * View * Model; + + kueken::program::object & Object = Renderer->map(ProgramOffscreen); + Object.setSampler(SEMANTIC_UNIF_DIFFUSE, 0); + Object.setUniform(SEMANTIC_UNIF_MVP, MVP); + Renderer->unmap(ProgramOffscreen); + + Renderer->bind(kueken::rasterizer::RASTERIZER, RasterizerOutput); + Renderer->bind(kueken::framebuffer::EXEC, FramebufferOffscreen); + Renderer->exec(Clear); + + Renderer->bind(0, kueken::program::UNIFIED, ProgramOffscreen); + Renderer->bind(0, kueken::sampler::SAMPLER, SamplerOffscreen); + Renderer->bind(0, kueken::texture::TEXTURE2D, TextureDiffuse); + + Renderer->bind(0, kueken::buffer::ELEMENT, ElementBuffer); + Renderer->bind(1, kueken::buffer::ARRAY, ArrayBuffer); + Renderer->bind(0, kueken::layout::VERTEX, Layout); + + Renderer->exec(Draw); + } + + { + glm::mat4 Projection = glm::perspective(45.0f, float(Window.Size.x) / float(Window.Size.y), 0.1f, 100.0f); + glm::mat4 MVP = glm::mat4(1.0f); + + kueken::program::object & Object = Renderer->map(ProgramOutput); + Object.setSampler(SEMANTIC_UNIF_DIFFUSE, 0); + Object.setUniform(SEMANTIC_UNIF_MVP, MVP); + Renderer->unmap(ProgramOutput); + + Renderer->bind(kueken::rasterizer::RASTERIZER, RasterizerOutput); + Renderer->bind(kueken::framebuffer::EXEC, FramebufferOutput); + Renderer->exec(Clear); + + Renderer->bind(0, kueken::program::UNIFIED, ProgramOutput); + Renderer->bind(0, kueken::sampler::SAMPLER, SamplerOutput); + Renderer->bind(0, kueken::texture::RECT, TextureColorbuffer); + + Renderer->bind(0, kueken::buffer::ELEMENT, ElementBuffer); + Renderer->bind(1, kueken::buffer::ARRAY, ArrayBuffer); + Renderer->bind(0, kueken::layout::VERTEX, Layout); + + Renderer->exec(Draw); + } + + glf::swapBuffers(); + glf::checkError("Render"); +} + +bool initBlend() +{ + { + kueken::blend::creator Creator(*Renderer); + Creator.setBlend( + kueken::blend::SLOT0, false); + Creator.setSource( + kueken::blend::SRC_ALPHA, + kueken::blend::SRC_ALPHA); + Creator.setDestination( + kueken::blend::ONE_MINUS_SRC_ALPHA, + kueken::blend::ONE_MINUS_SRC_ALPHA); + Creator.setColorMask( + kueken::blend::SLOT0, + glm::bvec4(true, true, true, true)); + Blend = Renderer->create(Creator); + } + + return glf::checkError("initBlend"); +} + +bool initClear() +{ + kueken::clear::creator Creator(*Renderer); + Creator.setColor(glm::vec4(1.0f, 0.5f, 0.0f, 1.0f)); + Creator.setDepth(1.0f); + Clear = Renderer->create(Creator); + + return glf::checkError("initClear"); +} + +bool initDraw() +{ + kueken::draw::creator Creator(*Renderer); + Creator.setPrimitive(kueken::draw::TRIANGLES); + Creator.setElementFormat(kueken::draw::UINT32); + Creator.setFirst(0); + Creator.setCount(ElementCount); + Creator.setInstances(1); + Creator.setBaseVertex(0); + Creator.setInstances(1); + Draw = Renderer->create(Creator); + + return glf::checkError("initDraw"); +} + +bool initTexture2D() +{ + { + kueken::texture::creator Creator(*Renderer); + Creator.setTarget(kueken::texture::RECT); + Creator.setFormat(kueken::texture::RGBA8); + Creator.setImage(0, glm::uvec3(Window.Size, glm::uint(1)), 0); + TextureColorbuffer = Renderer->create(Creator); + } + + { + gli::texture2D Texture = gli::load(TEXTURE_DIFFUSE); + + kueken::texture::creator Creator(*Renderer); + Creator.setFormat(kueken::texture::RGBA_DXT5); + Creator.setTarget(kueken::texture::TEXTURE2D); + Creator.setLevel(2, 10); + for(kueken::texture::level Level = 0; Level < Texture.levels(); ++Level) + { + Creator.setImage( + Level, + glm::uvec3(Texture[Level].dimensions(), 1), + Texture[Level].data()); + } + TextureDiffuse = Renderer->create(Creator); + } + + + return glf::checkError("initTexture2D"); +} + +bool initTest() +{ + kueken::test::creator Creator(*Renderer); + Creator.setDepthEnable(true); + Creator.setDepthFunc(kueken::test::LEQUAL); + Test = Renderer->create(Creator); + + return glf::checkError("initTest"); +} + +bool initRasterizer() +{ + { + kueken::rasterizer::creator Creator(*Renderer); + Creator.setScissor(true, glm::ivec4(0, 0, SAMPLE_OFFSCREEN_X, SAMPLE_OFFSCREEN_Y)); + Creator.setViewport(glm::ivec4(0, 0, SAMPLE_OFFSCREEN_X, SAMPLE_OFFSCREEN_Y)); + RasterizerOffscreen = Renderer->create(Creator); + } + + { + kueken::rasterizer::creator Creator(*Renderer); + Creator.setScissor(true, glm::ivec4(0, 0, SAMPLE_FRAMEBUFFER_X, SAMPLE_FRAMEBUFFER_Y)); + Creator.setViewport(glm::ivec4(0, 0, SAMPLE_FRAMEBUFFER_X, SAMPLE_FRAMEBUFFER_Y)); + RasterizerOutput = Renderer->create(Creator); + } + + return glf::checkError("initRasterizer"); +} + +bool initSampler() +{ + { + kueken::sampler::creator Creator(*Renderer); + Creator.setFilter(kueken::sampler::TRILINEAR); + Creator.setWrap(kueken::sampler::CLAMP_TO_EDGE, kueken::sampler::CLAMP_TO_EDGE, kueken::sampler::CLAMP_TO_EDGE); + Creator.setAnisotropy(16.f); + SamplerOffscreen = Renderer->create(Creator); + } + + { + kueken::sampler::creator Creator(*Renderer); + Creator.setFilter(kueken::sampler::NEAREST); + Creator.setWrap(kueken::sampler::CLAMP_TO_EDGE, kueken::sampler::CLAMP_TO_EDGE, kueken::sampler::CLAMP_TO_EDGE); + Creator.setAnisotropy(1.f); + SamplerOutput = Renderer->create(Creator); + } + + return glf::checkError("initSampler"); +} + +bool initProgram() +{ + { + kueken::program::creator Creator(*Renderer); + Creator.setVersion(kueken::program::CORE_400); + Creator.addSource( + kueken::program::VERTEX, + kueken::program::FILE, + VERT_SHADER_SOURCE0); + Creator.addSource( + kueken::program::FRAGMENT, + kueken::program::FILE, + FRAG_SHADER_SOURCE0); + Creator.addVariable(SEMANTIC_UNIF_DIFFUSE, "Diffuse"); + Creator.addVariable(SEMANTIC_UNIF_MVP, "MVP"); + Creator.addSemantic(SEMANTIC_ATTR_POSITION, "ATTR_POSITION"); + Creator.addSemantic(SEMANTIC_ATTR_TEXCOORD, "ATTR_TEXCOORD"); + Creator.addSemantic(SEMANTIC_FRAG_COLOR, "FRAG_COLOR"); + Creator.build(); + ProgramOffscreen = Renderer->create(Creator); + } + + { + kueken::program::creator Creator(*Renderer); + Creator.setVersion(kueken::program::CORE_400); + Creator.addSource( + kueken::program::VERTEX, + kueken::program::FILE, + VERT_SHADER_SOURCE1); + Creator.addSource( + kueken::program::FRAGMENT, + kueken::program::FILE, + FRAG_SHADER_SOURCE1); + Creator.addVariable(SEMANTIC_UNIF_DIFFUSE, "Diffuse"); + Creator.addVariable(SEMANTIC_UNIF_MVP, "MVP"); + Creator.addSemantic(SEMANTIC_ATTR_POSITION, "ATTR_POSITION"); + Creator.addSemantic(SEMANTIC_FRAG_COLOR, "FRAG_COLOR"); + Creator.build(); + ProgramOutput = Renderer->create(Creator); + } + + return glf::checkError("initProgram"); +} + +bool initLayout() +{ + kueken::layout::creator Creator(*Renderer); + Creator.setVertexArray( + 0, + kueken::layout::POSITION, + kueken::layout::F32VEC2, + sizeof(glf::vertex_v2fv2f), + 0, + 0); + Creator.setVertexArray( + 0, + kueken::layout::TEXCOORD, + kueken::layout::F32VEC2, + sizeof(glf::vertex_v2fv2f), + sizeof(glm::vec2), + 0); + Layout = Renderer->create(Creator); + + return glf::checkError("initLayout"); +} + +bool initArrayBuffer() +{ + { + kueken::buffer::creator Creator(*Renderer); + Creator.setSize(VertexSize); + Creator.setData(VertexData); + Creator.setUsage(kueken::buffer::STATIC_DRAW); + ArrayBuffer = Renderer->create(Creator); + } + + { + kueken::buffer::creator Creator(*Renderer); + Creator.setSize(ElementSize); + Creator.setData(ElementData); + Creator.setUsage(kueken::buffer::STATIC_DRAW); + ElementBuffer = Renderer->create(Creator); + } + + return glf::checkError("initArrayBuffer"); +} + +bool initFramebuffer() +{ + { + kueken::framebuffer::creator Creator(*Renderer); + Creator.setTexture(kueken::framebuffer::COLOR0, TextureColorbuffer, 0); + FramebufferOffscreen = Renderer->create(Creator); + } + + { + kueken::framebuffer::creator Creator(*Renderer); + FramebufferOutput = Renderer->create(Creator); + } + + return glf::checkError("initRendertarget"); +} + +bool begin() +{ + // Check the OpenGL version + GLint MajorVersion = 0; + GLint MinorVersion = 0; + glGetIntegerv(GL_MAJOR_VERSION, &MajorVersion); + glGetIntegerv(GL_MINOR_VERSION, &MinorVersion); + bool Validated = glf::version(MajorVersion, MinorVersion) >= glf::version(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); + + Renderer.reset(new kueken::renderer); + + if(Validated) + Validated = initBlend(); + if(Validated) + Validated = initClear(); + if(Validated) + Validated = initRasterizer(); + if(Validated) + Validated = initTexture2D(); + if(Validated) + Validated = initFramebuffer(); + if(Validated) + Validated = initProgram(); + if(Validated) + Validated = initArrayBuffer(); + if(Validated) + Validated = initSampler(); + if(Validated) + Validated = initLayout(); + if(Validated) + Validated = initTest(); + if(Validated) + Validated = initDraw(); + + Validated = Validated || glf::checkError("Begin"); + return Validated; +} + +bool end() +{ + Renderer.reset(); + + return glf::checkError("End"); +} + +int main(int argc, char* argv[]) +{ + if(glf::run( + argc, argv, + glm::ivec2(::SAMPLE_FRAMEBUFFER_X, ::SAMPLE_FRAMEBUFFER_Y), + ::SAMPLE_MAJOR_VERSION, + ::SAMPLE_MINOR_VERSION)) + return 0; + return 1; +} + diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index b4278365..e24f1e6c 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -26,5 +26,6 @@ set(GL_SHADER_GTC texture-buffer.vert texture-buffer.frag) glCreateSampleGTC(03-core-texturebuffer) -set(GL_SHADER_GTC multisampling.vert multisampling.frag) -glCreateSampleGTC(05-core-multisample) +set(GL_SHADER_GTC texture.vert texture.frag framebuffer.vert framebuffer.frag) +glCreateSampleGTC(05-core-framebuffer) +#glCreateSampleGTC(05-core-multisample) diff --git a/sample/data/framebuffer.frag b/sample/data/framebuffer.frag new file mode 100644 index 00000000..14850dab --- /dev/null +++ b/sample/data/framebuffer.frag @@ -0,0 +1,9 @@ +uniform sampler2DRect Diffuse; + +//layout(origin_upper_left) in vec4 gl_FragCoord; +layout(location = FRAG_COLOR, index = 0) out vec4 Color; + +void main() +{ + Color = texture(Diffuse, gl_FragCoord.xy); +} diff --git a/sample/data/framebuffer.vert b/sample/data/framebuffer.vert new file mode 100644 index 00000000..549807df --- /dev/null +++ b/sample/data/framebuffer.vert @@ -0,0 +1,8 @@ +uniform mat4 MVP; + +layout(location = ATTR_POSITION) in vec2 Position; + +void main() +{ + gl_Position = MVP * vec4(Position, 0.0, 1.0); +} From 84ad736d6c6847c408c049a27c30d5871097f5e4 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 27 Oct 2010 18:16:00 +0100 Subject: [PATCH 2/4] Added assert for early error checks --- source/core/program.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/core/program.cpp b/source/core/program.cpp index 6f39fa38..5fa68734 100644 --- a/source/core/program.cpp +++ b/source/core/program.cpp @@ -400,6 +400,7 @@ namespace detail if(Shader[Stage] == 0) continue; Success = Success && checkShader(Shader[Stage], Source[Stage].c_str()); + assert(Success); } for(std::size_t Stage = 0; Stage < Shader.size(); ++Stage) @@ -430,6 +431,7 @@ namespace detail glLinkProgram(this->Name); Success = checkProgram(this->Name); + assert(Success); } // Load variables @@ -464,6 +466,8 @@ namespace detail this->SubroutineLocation[TargetIndex].resize(Creator.SubroutineSemanticsMax[TargetIndex] + 1, 0); } } + + assert(Success); } object::~object() From 502d4ed33ea2f2493d129d47c98aa6e73a323101 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 27 Oct 2010 19:04:59 +0100 Subject: [PATCH 3/4] Draft for the new info API --- include/core/renderbuffer.hpp | 5 +++++ include/core/renderer.hpp | 9 +++++++++ include/core/texture.hpp | 9 +++++++++ 3 files changed, 23 insertions(+) diff --git a/include/core/renderbuffer.hpp b/include/core/renderbuffer.hpp index 5b23e1ee..2f6a0484 100644 --- a/include/core/renderbuffer.hpp +++ b/include/core/renderbuffer.hpp @@ -11,6 +11,11 @@ namespace kueken namespace kueken{ namespace renderbuffer { + struct info + { + // GL_MAX_RENDERBUFFER_SIZE // ??? + }; + enum format { DEPTH24, diff --git a/include/core/renderer.hpp b/include/core/renderer.hpp index 30979836..17da5f1e 100644 --- a/include/core/renderer.hpp +++ b/include/core/renderer.hpp @@ -115,6 +115,15 @@ namespace kueken texture::object & map(texture::name const & Name); void unmap(texture::name const & Name); + template + void info() const{assert(0);} + + template <> + texture::info info() const + { + return texture::info(); + } + //query::name create(query::creator const & Creator); //void free(query::name& Name); //void begin(query::name const & Name); diff --git a/include/core/texture.hpp b/include/core/texture.hpp index c93992a9..deaa6635 100644 --- a/include/core/texture.hpp +++ b/include/core/texture.hpp @@ -281,6 +281,15 @@ namespace detail typedef std::size_t slot; typedef std::size_t level; + struct info + { + //GL_MAX_RECTANGLE_TEXTURE_SIZE // 1024 + //GL_MAX_TEXTURE_IMAGE_UNITS // 16 + //GL_MAX_TEXTURE_BUFFER_SIZE // 65536 + //GL_MAX_TEXTURE_LOD_BIAS // 2.0 + //GL_MAX_TEXTURE_SIZE // 1024 + }; + enum type { IMAGE, From 527ee8bdbb7da560433e2cd62e2e454e021371bf Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 27 Oct 2010 19:09:46 +0100 Subject: [PATCH 4/4] Clean up and fixed build --- sample/01-core-basic.cpp | 17 +++-------------- sample/05-core-multisample.cpp | 16 ++++++++-------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/sample/01-core-basic.cpp b/sample/01-core-basic.cpp index 74174033..aad3e994 100644 --- a/sample/01-core-basic.cpp +++ b/sample/01-core-basic.cpp @@ -152,9 +152,9 @@ bool initTexture2D() } Texture = Renderer->create(Creator); - kueken::texture::object & Object = Renderer->map(Texture); - Object.generateMipmaps(); - Renderer->unmap(Texture); + //kueken::texture::object & Object = Renderer->map(Texture); + //Object.generateMipmaps(); + //Renderer->unmap(Texture); } { @@ -310,17 +310,6 @@ void display() Renderer->bind(0, kueken::texture::TEXTURE2D, Texture); Renderer->bind(0, kueken::sampler::SAMPLER, Sampler); - glSamplerParameteri(1, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); - glSamplerParameteri(1, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glSamplerParameteri(1, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glSamplerParameteri(1, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glSamplerParameteri(1, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); - glSamplerParameterfv(1, GL_TEXTURE_BORDER_COLOR, &glm::vec4(0.0f)[0]); - glSamplerParameterf(1, GL_TEXTURE_MIN_LOD, -1000.f); - glSamplerParameterf(1, GL_TEXTURE_MAX_LOD, 1000.f); - glSamplerParameterf(1, GL_TEXTURE_LOD_BIAS, 0.0f); - glSamplerParameteri(1, GL_TEXTURE_COMPARE_MODE, GL_NONE); - glSamplerParameteri(1, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); Renderer->bind(0, kueken::buffer::ELEMENT, ElementBuffer); Renderer->bind(1, kueken::buffer::ARRAY, ArrayBuffer); diff --git a/sample/05-core-multisample.cpp b/sample/05-core-multisample.cpp index 327c5c8b..b4dde7be 100644 --- a/sample/05-core-multisample.cpp +++ b/sample/05-core-multisample.cpp @@ -80,12 +80,12 @@ namespace void display() { Renderer->bind(0, kueken::program::UNIFIED, Program); - Renderer->bind(Test); - Renderer->bind(Blend); + Renderer->bind(kueken::test::TEST, Test); + Renderer->bind(kueken::blend::BLEND, Blend); { - Renderer->bind(RasterizerMultisample); - Renderer->bind(RendertargetMultisample, kueken::framebuffer::EXEC); + Renderer->bind(kueken::rasterizer::RASTERIZER, RasterizerMultisample); + Renderer->bind(kueken::framebuffer::EXEC, RendertargetMultisample); Renderer->exec(Clear); glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.0f); @@ -111,8 +111,8 @@ void display() Renderer->bind(0, kueken::texture::TEXTURE2D, TextureDiffuse); Renderer->exec(DrawMesh); - Renderer->bind(RendertargetMultisample, kueken::framebuffer::READ); - Renderer->bind(RendertargetResolver, kueken::framebuffer::DRAW); + Renderer->bind(kueken::framebuffer::READ, RendertargetMultisample); + Renderer->bind(kueken::framebuffer::DRAW, RendertargetResolver); Renderer->exec(Blit); } @@ -127,8 +127,8 @@ void display() Object.setUniform(SEMANTIC_UNIF_MVP, MVP); Renderer->unmap(Program); - Renderer->bind(RasterizerSplash); - Renderer->bind(RendertargetFramebuffer, kueken::framebuffer::EXEC); + Renderer->bind(kueken::rasterizer::RASTERIZER, RasterizerSplash); + Renderer->bind(kueken::framebuffer::EXEC, RendertargetFramebuffer); Renderer->exec(Clear); Renderer->bind(0, kueken::sampler::SAMPLER, SamplerSplash);