add near/far clip plane control to EnterPerspective
This commit is contained in:
@@ -596,7 +596,7 @@ void RageDisplay::PopMatrix()
|
||||
* When finished, the current position will be the "viewpoint" (at 0,0). negative
|
||||
* Z goes into the screen, positive X and Y is right and down.
|
||||
*/
|
||||
void RageDisplay::EnterPerspective(float fov, bool preserve_loc)
|
||||
void RageDisplay::EnterPerspective(float fov, bool preserve_loc, float near_clip, float far_clip)
|
||||
{
|
||||
g_PerspectiveMode++;
|
||||
if(g_PerspectiveMode > 1) {
|
||||
@@ -612,7 +612,7 @@ void RageDisplay::EnterPerspective(float fov, bool preserve_loc)
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
float aspect = SCREEN_WIDTH/(float)SCREEN_HEIGHT;
|
||||
gluPerspective(fov, aspect, 1.000f, 1000.0f); // This far clipping this might cause Z-fighting if we ever turn the z-buffer on
|
||||
gluPerspective(fov, aspect, near_clip, far_clip);
|
||||
|
||||
/* Flip the Y coordinate, so positive numbers go down. */
|
||||
glScalef(1, -1, 1);
|
||||
|
||||
Reference in New Issue
Block a user