From da20a407ff468719085c7eef9a370cf8d9cb2655 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 4 Dec 2005 17:14:50 +0000 Subject: [PATCH] remove RageDisplay_OGL::SetViewport; nothing changes the viewport offset --- stepmania/src/RageDisplay_OGL.cpp | 22 +++++----------------- stepmania/src/RageDisplay_OGL.h | 1 - 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index 6e614d97dc..7fad2914a0 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -607,7 +607,10 @@ void RageDisplay_OGL::ResolutionChanged() { //LOG->Warn( "RageDisplay_OGL::ResolutionChanged" ); - SetViewport(0,0); + int fWidth = g_pWind->GetActualVideoModeParams().width; + int fHeight = g_pWind->GetActualVideoModeParams().height; + + glViewport( 0, 0, fWidth, fHeight ); /* Clear any junk that's in the framebuffer. */ if( BeginFrame() ) @@ -655,21 +658,6 @@ CString RageDisplay_OGL::TryVideoMode( const VideoModeParams &p, bool &bNewDevic return CString(); // successfully set mode } -void RageDisplay_OGL::SetViewport(int shift_left, int shift_down) -{ - int width = g_pWind->GetActualVideoModeParams().width; - int height = g_pWind->GetActualVideoModeParams().height; - - //LOG->Warn( "RageDisplay_OGL::SetViewport( %d, %d )", width, height ); - - /* left and down are on a 0..SCREEN_WIDTH, 0..SCREEN_HEIGHT scale. - * Scale them to the actual viewport range. */ - shift_left = int( shift_left * float(width) / SCREEN_WIDTH ); - shift_down = int( shift_down * float(height) / SCREEN_HEIGHT ); - - glViewport( shift_left, -shift_down, width, height ); -} - int RageDisplay_OGL::GetMaxTextureSize() const { GLint size; @@ -1305,7 +1293,7 @@ void RageDisplay_OGL::DrawLineStripInternal( const RageSpriteVertex v[], int iNu * It's worth it for the AA, though. */ glEnable( GL_LINE_SMOOTH ); - /* Our line width is wrt the regular internal SCREEN_WIDTHxSCREEN_HEIGHT screen, + /* fLineWidth is wrt the regular internal SCREEN_WIDTHxSCREEN_HEIGHT screen, * but these width functions actually want raster sizes (that is, actual pixels). * Scale the line width and point size by the average ratio of the scale. */ float fWidthVal = float(g_pWind->GetActualVideoModeParams().width) / SCREEN_WIDTH; diff --git a/stepmania/src/RageDisplay_OGL.h b/stepmania/src/RageDisplay_OGL.h index 73599119e4..6395698626 100644 --- a/stepmania/src/RageDisplay_OGL.h +++ b/stepmania/src/RageDisplay_OGL.h @@ -86,7 +86,6 @@ protected: CString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ); RageSurface* CreateScreenshot(); - void SetViewport(int shift_left, int shift_down); PixelFormat GetImgPixelFormat( RageSurface* &img, bool &FreeImg, int width, int height, bool bPalettedTexture ); bool SupportsSurfaceFormat( PixelFormat pixfmt );