Example #1
0
void AmjuGLOpenGLES2::SetPerspectiveProjection(float fov, float aspectRatio, float nearDist, float farDist)
{
  AMJU_CALL_STACK;

  // Expect current matrix mode to be perspective
  s_matrices[AmjuGL::AMJU_PROJECTION_MATRIX] = GLKMatrix4Multiply(
    s_matrices[AmjuGL::AMJU_PROJECTION_MATRIX],
    GLKMatrix4MakePerspective(DegToRad(fov), aspectRatio, nearDist, farDist));
}
Example #2
0
RenderSystem& RenderSystem::getRenderSystem()
{
    static RenderSystem *renderSystem = NULL;
    
    if (renderSystem == NULL) {
        renderSystem = new RenderSystem();
        
        glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
        
        glMatrixMode(GL_PROJECTION);
        GLKMatrix4MakePerspective(65.0f, 1280.0f/720.0f, 1, 1000);
        glViewport(0.0f, 0.0f, 1280.0f, 720.0f);
        glMatrixMode(GL_MODELVIEW);
        
        glEnable(GL_CULL_FACE);
    }
    
    return *renderSystem;
}
Example #3
0
void Camera::update_projection()
{
  projectionMatrix_ = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(fov_), aspectRatio_, near_, far_);
}