add near/far clip plane control to EnterPerspective

This commit is contained in:
Glenn Maynard
2003-04-16 18:57:20 +00:00
parent 059e3a6fb6
commit 07c0cdd64e
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -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);
+2 -1
View File
@@ -79,7 +79,8 @@ public:
int GetMaxTextureSize() const;
void EnterPerspective(float fov, bool preserve_loc = true);
// This far clipping this might cause Z-fighting if we ever turn the z-buffer on
void EnterPerspective(float fov, bool preserve_loc = true, float near = 1, float far = 1000);
void ExitPerspective();
void LookAt(const RageVector3 &Eye, const RageVector3 &At, const RageVector3 &Up);