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(); }
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)); }
//------------------------------------------------------------------------------ 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); }
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 ) ); }
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); }
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()); }
void Reshape(GLuint width, GLuint height) { gl.Viewport(0, 0, width, height); }