当前位置: 首页>>代码示例>>C++>>正文


C++ Context::Viewport方法代码示例

本文整理汇总了C++中oglplus::Context::Viewport方法的典型用法代码示例。如果您正苦于以下问题:C++ Context::Viewport方法的具体用法?C++ Context::Viewport怎么用?C++ Context::Viewport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在oglplus::Context的用法示例。


在下文中一共展示了Context::Viewport方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

	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();
	}
开发者ID:AdamSimpson,项目名称:oglplus,代码行数:35,代码来源:002_triangle_compatibility.cpp

示例2: drawScene

  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();
  }
开发者ID:jherico,项目名称:VirtualChess,代码行数:8,代码来源:UiTest.cpp

示例3: Reshape

    void Reshape() {
        using namespace oglplus;

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

        rndr.SetProjection(
          CamMatrixf::PerspectiveX(Degrees(60), Width() / Height(), 1, 60));
    }
开发者ID:matus-chochlik,项目名称:oglplus,代码行数:8,代码来源:004_any_text_rendering.cpp

示例4: Resize

//------------------------------------------------------------------------------
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);
}
开发者ID:James-Z,项目名称:oglplus,代码行数:11,代码来源:029_mandelbrot_glfw3.cpp

示例5: Reshape

	void Reshape(void)
	{
		using namespace oglplus;

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

		projection_matrix.Set(
			CamMatrixf::PerspectiveX(
				Degrees(60),
				Aspect(),
				1, 50
			)
		);
	}
开发者ID:AdamSimpson,项目名称:oglplus,代码行数:14,代码来源:003_dsa_texture.cpp

示例6: Reshape

	void Reshape(void)
	{
		using namespace oglplus;

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

		Uniform<Mat4f>(prog, "ProjectionMatrix").Set(
			CamMatrixf::PerspectiveX(
				Degrees(60),
				Aspect(),
				1, 70
			)
		);
	}
开发者ID:BrainlessLabsInc,项目名称:oglplus,代码行数:14,代码来源:026_blender_mesh_loader.cpp

示例7: Reshape

	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);
	}
开发者ID:pm990320,项目名称:OpenGLLearning,代码行数:15,代码来源:007_glm_boxes.cpp

示例8: Reshape

	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;
	}
开发者ID:Extrunder,项目名称:oglplus,代码行数:21,代码来源:004_text_rendering.cpp

示例9: Reshape

	void Reshape(void)
	{
		using namespace oglplus;

		gl.Viewport(Width(), Height());
	}
开发者ID:BrainlessLabsInc,项目名称:oglplus,代码行数:6,代码来源:002_simple_path.cpp

示例10: Reshape

	void Reshape(GLuint width, GLuint height)
	{
		gl.Viewport(0, 0, width, height);
	}
开发者ID:James-Z,项目名称:oglplus,代码行数:4,代码来源:android_001_triangle.cpp


注:本文中的oglplus::Context::Viewport方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。