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


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

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


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

示例1: Render

    void Render() {
        using namespace oglplus;

        gl.Clear().ColorBuffer().DoIt();

        GLfloat t = GLfloat(FrameTime());

        rndr.Use();

        text_stream.str(std::string());
        text_stream << "Time: " << std::fixed << std::setw(5)
                    << std::setprecision(3) << t << " [s]";
        if(time_str != text_stream.str()) {
            time_str = text_stream.str();
            time_layout.Set(time_str);
        }

        rndr.SetCamera(CamMatrixf::Orbiting(
          Vec3f(),
          GLfloat(9.0 + SineWave(t / 7.0) * 3.0),
          -FullCircles(t / 17.0),
          Degrees(SineWave(t / 21.0) * 35)));

        rndr.SetLayoutTransform(ModelMatrixf::Translation(-3.0f, 0.7f, 1.1f));
        rndr.Render(oglp_layout);

        rndr.SetLayoutTransform(ModelMatrixf::Translation(-6.0f, -0.7f, 0.0f));
        rndr.Render(desc_layout);

        rndr.SetLayoutTransform(
          ModelMatrixf::Translation(-4.0f, -2.0f, -0.5f) *
          ModelMatrixf::Scale(0.7f, 0.7f, 0.5f));
        rndr.Render(time_layout);
    }
开发者ID:matus-chochlik,项目名称:oglplus,代码行数:34,代码来源:004_any_text_rendering.cpp

示例2: Render

	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
		);
	}
开发者ID:BrainlessLabsInc,项目名称:oglplus,代码行数:34,代码来源:026_blender_mesh_loader.cpp

示例3: Render

    void Render() {
        using namespace oglplus;

        gl.Clear().ColorBuffer().StencilBuffer();

        glc.Color(0.2, 0.2, 1.0);

        text_path.StencilFillInstanced(
          glyph_indices,
          PathNVFillMode::CountUp,
          0xFF,
          PathNVTransformType::TranslateX,
          glyph_spacings);
        text_path.CoverFillInstanced(
          glyph_indices,
          PathNVFillCoverMode::BoundingBoxOfBoundingBoxes,
          PathNVTransformType::TranslateX,
          glyph_spacings);

        glc.Color(0.0, 0.0, 0.0);

        text_path.StencilStrokeInstanced(
          glyph_indices,
          1,
          ~0,
          PathNVTransformType::TranslateX,
          glyph_spacings);
        text_path.CoverStrokeInstanced(
          glyph_indices,
          PathNVStrokeCoverMode::ConvexHull,
          PathNVTransformType::TranslateX,
          glyph_spacings);
    }
开发者ID:matus-chochlik,项目名称:oglplus,代码行数:33,代码来源:003_simple_text.cpp

示例4: 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

示例5: Render

	void Render(void)
	{
		gl.Clear().ColorBuffer();

		gl.DrawArrays(
			oglplus::PrimitiveType::Triangles,
			0, 3
		);
	}
开发者ID:James-Z,项目名称:oglplus,代码行数:9,代码来源:android_001_triangle.cpp

示例6: Render

	void Render(void)
	{
		gl.Clear().ColorBuffer().DepthBuffer();
		//
		oglplus::Uniform<GLfloat>(prog, "Time") = FrameTime();

		// draw 36 instances of the cube
		// the vertex shader will take care of their placement
		cube_instr.Draw(cube_indices, 36);
	}
开发者ID:pm990320,项目名称:OpenGLLearning,代码行数:10,代码来源:007_glm_boxes.cpp

示例7: Render

	void Render(void)
	{
		using namespace oglplus;

		gl.Clear().ColorBuffer().StencilBuffer();

		glc.Color(0.2, 0.2, 1.0);

		path.StencilFill(PathNVFillMode::CountUp, 0x1F);
		path.CoverFill(PathNVFillCoverMode::BoundingBox);

		glc.Color(0.1, 0.1, 0.1);

		path.StencilStroke(1, ~0);
		path.CoverStroke(PathNVStrokeCoverMode::ConvexHull);
	}
开发者ID:BrainlessLabsInc,项目名称:oglplus,代码行数:16,代码来源:002_simple_path.cpp

示例8: Display

	void Display(void)
	{
		using namespace oglplus;

		gl.Clear().ColorBuffer();

		glc.Begin(CompatibilityPrimitiveType::Triangles);
			glc.Color(1.0, 0.0, 0.0);
			glc.Vertex(0.0f, 0.0f);

			glc.Color(0.0, 1.0, 0.0);
			glc.Vertex(1.0f, 0.0f);

			glc.Color(0.0, 0.0, 1.0);
			glc.Vertex(0.0f, 1.0f);
		glc.End();
	}
开发者ID:AdamSimpson,项目名称:oglplus,代码行数:17,代码来源:002_triangle_compatibility.cpp

示例9: Render

	void Render(void)
	{
		using namespace oglplus;

		gl.Clear().ColorBuffer().StencilBuffer();

		auto h = Height();
		int l = font_height / 2, i = 1;
		RenderText(l, h - font_height*i++, "NV_path_rendering");

		{
			std::stringstream s;
			s << "Frame no.: " << FrameNumber();
			RenderText(l, h - font_height*i++, s.str());
		}
		{
			std::stringstream s;
			s << std::fixed << std::setprecision(2);
			s << "Time: " << FrameTime() << " [s]";
			RenderText(l, h - font_height*i++, s.str());
		}
		{
			std::stringstream s;
			s << std::fixed << std::setprecision(2);
			s << "Average FPS: " << (FrameTime()>0.0 ? AverageFPS() : 0.0);
			RenderText(l, h - font_height*i++, s.str());
		}
		{
			std::stringstream s;
			s << std::fixed << std::setprecision(2);
			s << "Current FPS: " << (FrameDuration()>0.0 ? CurrentFPS() : 0.0);
			RenderText(l, h - font_height*i++, s.str());
		}
		{
			std::stringstream s;
			s << "Viewport: " << Width() << " x " << Height();
			RenderText(l, h - font_height*i++, s.str());
		}
		{
			std::stringstream s;
			s << std::fixed << std::setprecision(3);
			s << "Aspect ratio: " << Aspect();
			RenderText(l, h - font_height*i++, s.str());
		}
	}
开发者ID:Extrunder,项目名称:oglplus,代码行数:45,代码来源:004_text_rendering.cpp

示例10: Render

	void Render(void)
	{
		using namespace oglplus;

		gl.Clear().ColorBuffer().DepthBuffer();

		camera_matrix.Set(
			CamMatrixf::Orbiting(
				Vec3f(),
				9.5 - SineWave(FrameTime() / 6.0) * 7.0,
				FullCircles(FrameTime() / 9.0),
				Degrees(SineWave(FrameTime() / 30.0) * 90)
			)
		);

		model_matrix.Set(ModelMatrixf::RotationX(FullCircles(FrameTime() * 0.1)));

		textured_cube.Draw();
	}
开发者ID:AdamSimpson,项目名称:oglplus,代码行数:19,代码来源:003_dsa_texture.cpp

示例11: Render

	void Render(void)
	{
		using namespace oglplus;

		GLfloat t = GLfloat(FrameTime());
		GLfloat i = t*0.3f;
		int interval = int(i);
		GLfloat f = i - GLfloat(interval);
		if(prev_interval < interval)
		{
			LoadNext();
			prev_interval = interval;
		}

		gl.Clear().ColorBuffer().DoIt();

		rndr_opacity.Set(SineWave(f*0.5f));

		rndr.SetLayoutTransform(ModelMatrixf::TranslationZ(-20.0f+16.0f*f));
		rndr.Render(layout);
	}
开发者ID:Extrunder,项目名称:oglplus,代码行数:21,代码来源:004_pango_cairo_hello.cpp


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