예제 #1
0
    void paintGL(){

		 
		program.use();
		program.bindFrameBuffer(dFBO.frameBuffer());
		program.bindVertexArray(vao);
		glViewport(0, 0, 512, 512);
		glClearColor(0.5f, 0.1f, 0.1f, 1);
		gl::clearAll();
		gl::drawArrays(gl::DrawArraysMode::TRIANGLES, 0, 3);
		program.bindFrameBuffer();

		glViewport(0, 0,super->width(), super->height());
		glClearColor(0.1f, 0.1f, 0.5f, 1);
		gl::clearAll();
		glViewport(
			(super->width()-512)/2, 
			(super->height()-512)/2,
			512, 512);
		renderRectangle.render( dFBO.renderBuffer() );
    }
예제 #2
0
        void paintGL(){
            constexpr static float clearColor[] = \
                {0.5f,0.3f,0.3f,1};
            gl::NamedFrameBufferObject root;
            root.clearColor(clearColor);
            root.clearDepth(1);
            program.use();
            program.bindFrameBuffer(root);
            program.bindVertexArray(vao);
            program.setUniformMatrix4fv(
                1, 1, false, &(modelScale[0][0]));
			program.setUniformMatrix4fv(
				3, 1, false, &(normalMatrix[0][0]));
            using namespace gl::DrawElements;
            Pack pack(
                Mode::TRIANGLES,
                indexCount,
                Type::UNSIGNED_INT,
                nullptr);
            gl::draw(pack);
        }