本文整理汇总了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();
}
示例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();
}
示例3: Reshape
void Reshape() {
using namespace oglplus;
gl.Viewport(Width(), Height());
rndr.SetProjection(
CamMatrixf::PerspectiveX(Degrees(60), Width() / Height(), 1, 60));
}
示例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);
}
示例5: Reshape
void Reshape(void)
{
using namespace oglplus;
gl.Viewport(Width(), Height());
projection_matrix.Set(
CamMatrixf::PerspectiveX(
Degrees(60),
Aspect(),
1, 50
)
);
}
示例6: Reshape
void Reshape(void)
{
using namespace oglplus;
gl.Viewport(Width(), Height());
Uniform<Mat4f>(prog, "ProjectionMatrix").Set(
CamMatrixf::PerspectiveX(
Degrees(60),
Aspect(),
1, 70
)
);
}
示例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);
}
示例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;
}
示例9: Reshape
void Reshape(void)
{
using namespace oglplus;
gl.Viewport(Width(), Height());
}
示例10: Reshape
void Reshape(GLuint width, GLuint height)
{
gl.Viewport(0, 0, width, height);
}