void Render(void)
	{
		using namespace oglplus;

		double t = FrameTime();

		gl.Clear().ColorBuffer().DepthBuffer();
		//
		auto camera = CamMatrixf::Orbiting(
			camera_target,
			camera_distance,
			-FullCircles(t / 17.0),
			Degrees(SineWave(t / 41.0) * 85)
		);
		camera_matrix.Set(camera);
		camera_position.Set(camera.Position());

		light_position.Set(
			CamMatrixf::Orbiting(
				camera_target,
				camera_distance*2.0,
				FullCircles(t / 37.0),
				Degrees(SineWave(t / 31.0) * 85)
			).Position()
		);

		face_normals.Set(int(t*0.25) % 2);

		gl.DrawElements(
			PrimitiveType::TriangleFan,
			element_count,
			DataType::UnsignedInt
		);
	}
Пример #2
0
void FullscreenQuad::DrawElements() const
{
    static oglplus::Context gl;
    fsQuadVertexArray.Bind();
    gl.DrawElements(
        oglplus::PrimitiveType::Triangles, 6,
        oglplus::DataType::UnsignedInt
    );
}