本文整理汇总了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);
}
示例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
);
}
示例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);
}
示例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();
}
示例5: Render
void Render(void)
{
gl.Clear().ColorBuffer();
gl.DrawArrays(
oglplus::PrimitiveType::Triangles,
0, 3
);
}
示例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);
}
示例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);
}
示例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();
}
示例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());
}
}
示例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();
}
示例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);
}