Example(GLuint width, GLuint height)
	 : log_sink(
		[](const oglplus::ARB_debug_output::CallbackData& data) -> void
		{
			std::cout << "[" << data.id << "] '" <<
				data.message << "'" << std::endl;
			std::cout << "  [source]   '" <<
				oglplus::EnumValueName(data.source)  << "'" <<
				std::endl;
			std::cout << "  [type]     '" <<
				oglplus::EnumValueName(data.type)  << "'" <<
				std::endl;
			std::cout << "  [severity] '" <<
				oglplus::EnumValueName(data.severity)  << "'" <<
				std::endl;
		}
	)
	{
		using namespace oglplus;

		dbg.Control(
			DebugOutputARBSource::DontCare,
			DebugOutputARBType::DontCare,
			DebugOutputARBSeverity::Low,
			true
		);

		gl.ClearColor(1.0f, 1.0f, 1.0f, 0.0f);
		gl.Viewport(width, height);

		glc.MatrixMode(CompatibilityMatrixMode::Projection);
		glc.LoadIdentity();
		glc.MatrixMode(CompatibilityMatrixMode::Modelview);
		glc.LoadIdentity();
	}
示例#2
0
  void drawScene() {
    gl.ClearColor(0.2, 0.2, 0.2, 1.0);
    gl.Clear().ColorBuffer().DepthBuffer();
    gl.Viewport(0, 0, 640, 480);

    // draw GUI
    System::getSingleton().renderAllGUIContexts();
  }
    void Reshape() {
        using namespace oglplus;

        gl.Viewport(Width(), Height());

        rndr.SetProjection(
          CamMatrixf::PerspectiveX(Degrees(60), Width() / Height(), 1, 60));
    }
示例#4
0
//------------------------------------------------------------------------------
void Example::Resize(int width, int height)
{
	if((width > 0) && (height > 0))
	{
		screen_width = width;
		screen_height = height;
		view_aspect = float(width)/float(height);
	}
	gl.Viewport(0, 0, width, height);
}
示例#5
0
	void Reshape(void)
	{
		using namespace oglplus;

		gl.Viewport(Width(), Height());

		projection_matrix.Set(
			CamMatrixf::PerspectiveX(
				Degrees(60),
				Aspect(),
				1, 50
			)
		);
	}
	void Reshape(void)
	{
		using namespace oglplus;

		gl.Viewport(Width(), Height());

		Uniform<Mat4f>(prog, "ProjectionMatrix").Set(
			CamMatrixf::PerspectiveX(
				Degrees(60),
				Aspect(),
				1, 70
			)
		);
	}
示例#7
0
	void Reshape(void)
	{
		gl.Viewport(Width(), Height());

		auto camera = glm::perspective(
			53.0f,
			GLfloat(Aspect()),
			1.0f, 100.0f
		) * glm::lookAt(
			glm::vec3(21.0f, 7.0f, 0.0f),
			glm::vec3( 0.0f, 0.0f, 0.0f),
			glm::vec3( 0.0f, 1.0f, 0.0f)
		);
		oglplus::Uniform<oglplus::Mat4f>(prog, "CameraMatrix").Set(camera);
	}
示例#8
0
	void Reshape(void)
	{
		using namespace oglplus;

		gl.Viewport(Width(), Height());

		dsa.ProjectionMatrix()
			.LoadIdentity()
			.Ortho(0, Width(), 0, Height(), -1, 1);

		GLfloat font_min_max[2];
		text_glyphs.GetMetricRange(
			PathNVMetricQuery::FontYMinBounds|
			PathNVMetricQuery::FontYMaxBounds,
			1, 0,
			font_min_max
		);
		font_y_min = font_min_max[0];
		font_y_max = font_min_max[1];
		font_height = font_y_max - font_y_min;
	}
	void Reshape(void)
	{
		using namespace oglplus;

		gl.Viewport(Width(), Height());
	}
示例#10
0
	void Reshape(GLuint width, GLuint height)
	{
		gl.Viewport(0, 0, width, height);
	}