void paintGL(){
		gl::clearAll();
		using namespace gl::DrawArrays;
		program.use();
		program.bindVertexArray(vao);
		gl::drawArrays( Mode::TRIANGLES,0,6 );
    }
	void paintGL() {
		gl::clearAll();
		program.use();
		glEnable(GL_PROGRAM_POINT_SIZE);
		program.bindVertexArray(vao);
		if (baseIndex&1) {
			gl::pointCoordOrigin(
				gl::PointCoordOrigin::LOWER_LEFT
				);
		}
		else {
			gl::pointCoordOrigin(
				gl::PointCoordOrigin::UPPER_LEFT
				);
		}
		using namespace gl::DrawElementsInstancedBaseInstance;
		gl::drawElementsInstancedBaseInstance(
			Mode::POINTS,
			1,
			Type::UNSIGNED_INT,
			0,
			4,
			4*baseIndex
			);
		glDisable(GL_PROGRAM_POINT_SIZE);
	}
        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);
        }
Beispiel #4
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() );
    }