[opengl] Remove all references to RageDisplay_OGL (changed to _Legacy). Start removing old D3D stuff.
This commit is contained in:
+75
-75
@@ -1,8 +1,8 @@
|
||||
#include "global.h"
|
||||
|
||||
#include "RageDisplay_OGL.h"
|
||||
#include "RageDisplay_OGL_Helpers.h"
|
||||
using namespace RageDisplay_OGL_Helpers;
|
||||
#include "RageDisplay_Legacy.h"
|
||||
#include "RageDisplay_Legacy_Helpers.h"
|
||||
using namespace RageDisplay_Legacy_Helpers;
|
||||
|
||||
#include "RageFile.h"
|
||||
#include "RageSurface.h"
|
||||
@@ -249,13 +249,13 @@ static void TurnOffHardwareVBO()
|
||||
}
|
||||
}
|
||||
|
||||
RageDisplay_OGL::RageDisplay_OGL()
|
||||
RageDisplay_Legacy::RageDisplay_Legacy()
|
||||
{
|
||||
LOG->Trace( "RageDisplay_OGL::RageDisplay_OGL()" );
|
||||
LOG->Trace( "RageDisplay_Legacy::RageDisplay_Legacy()" );
|
||||
LOG->MapLog("renderer", "Current renderer: OpenGL");
|
||||
|
||||
FixLittleEndian();
|
||||
RageDisplay_OGL_Helpers::Init();
|
||||
RageDisplay_Legacy_Helpers::Init();
|
||||
|
||||
g_pWind = NULL;
|
||||
g_bTextureMatrixShader = 0;
|
||||
@@ -442,9 +442,9 @@ void InitShaders()
|
||||
}
|
||||
}
|
||||
|
||||
static LocalizedString OBTAIN_AN_UPDATED_VIDEO_DRIVER ( "RageDisplay_OGL", "Obtain an updated driver from your video card manufacturer." );
|
||||
static LocalizedString GLDIRECT_IS_NOT_COMPATIBLE ( "RageDisplay_OGL", "GLDirect was detected. GLDirect is not compatible with this game and should be disabled." );
|
||||
RString RageDisplay_OGL::Init( const VideoModeParams &p, bool bAllowUnacceleratedRenderer )
|
||||
static LocalizedString OBTAIN_AN_UPDATED_VIDEO_DRIVER ( "RageDisplay_Legacy", "Obtain an updated driver from your video card manufacturer." );
|
||||
static LocalizedString GLDIRECT_IS_NOT_COMPATIBLE ( "RageDisplay_Legacy", "GLDirect was detected. GLDirect is not compatible with this game and should be disabled." );
|
||||
RString RageDisplay_Legacy::Init( const VideoModeParams &p, bool bAllowUnacceleratedRenderer )
|
||||
{
|
||||
g_pWind = LowLevelWindow::Create();
|
||||
|
||||
@@ -537,12 +537,12 @@ RString RageDisplay_OGL::Init( const VideoModeParams &p, bool bAllowUnaccelerate
|
||||
return RString();
|
||||
}
|
||||
|
||||
RageDisplay_OGL::~RageDisplay_OGL()
|
||||
RageDisplay_Legacy::~RageDisplay_Legacy()
|
||||
{
|
||||
delete g_pWind;
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::GetDisplayResolutions( DisplayResolutions &out ) const
|
||||
void RageDisplay_Legacy::GetDisplayResolutions( DisplayResolutions &out ) const
|
||||
{
|
||||
out.clear();
|
||||
g_pWind->GetDisplayResolutions( out );
|
||||
@@ -705,9 +705,9 @@ void SetupExtensions()
|
||||
}
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::ResolutionChanged()
|
||||
void RageDisplay_Legacy::ResolutionChanged()
|
||||
{
|
||||
//LOG->Warn( "RageDisplay_OGL::ResolutionChanged" );
|
||||
//LOG->Warn( "RageDisplay_Legacy::ResolutionChanged" );
|
||||
|
||||
/* Clear any junk that's in the framebuffer. */
|
||||
if( BeginFrame() )
|
||||
@@ -719,9 +719,9 @@ void RageDisplay_OGL::ResolutionChanged()
|
||||
// Return true if mode change was successful.
|
||||
// bNewDeviceOut is set true if a new device was created and textures
|
||||
// need to be reloaded.
|
||||
RString RageDisplay_OGL::TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut )
|
||||
RString RageDisplay_Legacy::TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut )
|
||||
{
|
||||
//LOG->Warn( "RageDisplay_OGL::TryVideoMode( %d, %d, %d, %d, %d, %d )", p.windowed, p.width, p.height, p.bpp, p.rate, p.vsync );
|
||||
//LOG->Warn( "RageDisplay_Legacy::TryVideoMode( %d, %d, %d, %d, %d, %d )", p.windowed, p.width, p.height, p.bpp, p.rate, p.vsync );
|
||||
|
||||
RString err;
|
||||
err = g_pWind->TryVideoMode( p, bNewDeviceOut );
|
||||
@@ -761,14 +761,14 @@ RString RageDisplay_OGL::TryVideoMode( const VideoModeParams &p, bool &bNewDevic
|
||||
return RString(); // successfully set mode
|
||||
}
|
||||
|
||||
int RageDisplay_OGL::GetMaxTextureSize() const
|
||||
int RageDisplay_Legacy::GetMaxTextureSize() const
|
||||
{
|
||||
GLint size;
|
||||
glGetIntegerv( GL_MAX_TEXTURE_SIZE, &size );
|
||||
return size;
|
||||
}
|
||||
|
||||
bool RageDisplay_OGL::BeginFrame()
|
||||
bool RageDisplay_Legacy::BeginFrame()
|
||||
{
|
||||
/* We do this in here, rather than ResolutionChanged, or we won't update the
|
||||
* viewport for the concurrent rendering context. */
|
||||
@@ -784,7 +784,7 @@ bool RageDisplay_OGL::BeginFrame()
|
||||
return RageDisplay::BeginFrame();
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::EndFrame()
|
||||
void RageDisplay_Legacy::EndFrame()
|
||||
{
|
||||
glFlush();
|
||||
|
||||
@@ -797,7 +797,7 @@ void RageDisplay_OGL::EndFrame()
|
||||
RageDisplay::EndFrame();
|
||||
}
|
||||
|
||||
RageSurface* RageDisplay_OGL::CreateScreenshot()
|
||||
RageSurface* RageDisplay_Legacy::CreateScreenshot()
|
||||
{
|
||||
int width = g_pWind->GetActualVideoModeParams().width;
|
||||
int height = g_pWind->GetActualVideoModeParams().height;
|
||||
@@ -820,7 +820,7 @@ RageSurface* RageDisplay_OGL::CreateScreenshot()
|
||||
return image;
|
||||
}
|
||||
|
||||
RageSurface *RageDisplay_OGL::GetTexture( unsigned iTexture )
|
||||
RageSurface *RageDisplay_Legacy::GetTexture( unsigned iTexture )
|
||||
{
|
||||
if( iTexture == 0 )
|
||||
return NULL; // XXX
|
||||
@@ -844,7 +844,7 @@ RageSurface *RageDisplay_OGL::GetTexture( unsigned iTexture )
|
||||
return pImage;
|
||||
}
|
||||
|
||||
VideoModeParams RageDisplay_OGL::GetActualVideoModeParams() const
|
||||
VideoModeParams RageDisplay_Legacy::GetActualVideoModeParams() const
|
||||
{
|
||||
return g_pWind->GetActualVideoModeParams();
|
||||
}
|
||||
@@ -903,7 +903,7 @@ static void SetupVertices( const RageSpriteVertex v[], int iNumVerts )
|
||||
glNormalPointer( GL_FLOAT, 0, Normal );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SendCurrentMatrices()
|
||||
void RageDisplay_Legacy::SendCurrentMatrices()
|
||||
{
|
||||
RageMatrix projection;
|
||||
RageMatrixMultiply( &projection, GetCentering(), GetProjectionTop() );
|
||||
@@ -1364,7 +1364,7 @@ void RageCompiledGeometryHWOGL::Draw( int iMeshIndex ) const
|
||||
}
|
||||
}
|
||||
|
||||
RageCompiledGeometry* RageDisplay_OGL::CreateCompiledGeometry()
|
||||
RageCompiledGeometry* RageDisplay_Legacy::CreateCompiledGeometry()
|
||||
{
|
||||
if( GLExt.glGenBuffersARB )
|
||||
return new RageCompiledGeometryHWOGL;
|
||||
@@ -1372,12 +1372,12 @@ RageCompiledGeometry* RageDisplay_OGL::CreateCompiledGeometry()
|
||||
return new RageCompiledGeometrySWOGL;
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::DeleteCompiledGeometry( RageCompiledGeometry* p )
|
||||
void RageDisplay_Legacy::DeleteCompiledGeometry( RageCompiledGeometry* p )
|
||||
{
|
||||
delete p;
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::DrawQuadsInternal( const RageSpriteVertex v[], int iNumVerts )
|
||||
void RageDisplay_Legacy::DrawQuadsInternal( const RageSpriteVertex v[], int iNumVerts )
|
||||
{
|
||||
TurnOffHardwareVBO();
|
||||
SendCurrentMatrices();
|
||||
@@ -1386,7 +1386,7 @@ void RageDisplay_OGL::DrawQuadsInternal( const RageSpriteVertex v[], int iNumVer
|
||||
glDrawArrays( GL_QUADS, 0, iNumVerts );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::DrawQuadStripInternal( const RageSpriteVertex v[], int iNumVerts )
|
||||
void RageDisplay_Legacy::DrawQuadStripInternal( const RageSpriteVertex v[], int iNumVerts )
|
||||
{
|
||||
TurnOffHardwareVBO();
|
||||
SendCurrentMatrices();
|
||||
@@ -1395,7 +1395,7 @@ void RageDisplay_OGL::DrawQuadStripInternal( const RageSpriteVertex v[], int iNu
|
||||
glDrawArrays( GL_QUAD_STRIP, 0, iNumVerts );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::DrawSymmetricQuadStripInternal( const RageSpriteVertex v[], int iNumVerts )
|
||||
void RageDisplay_Legacy::DrawSymmetricQuadStripInternal( const RageSpriteVertex v[], int iNumVerts )
|
||||
{
|
||||
int iNumPieces = (iNumVerts-3)/3;
|
||||
int iNumTriangles = iNumPieces*4;
|
||||
@@ -1434,7 +1434,7 @@ void RageDisplay_OGL::DrawSymmetricQuadStripInternal( const RageSpriteVertex v[]
|
||||
&vIndices[0] );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::DrawFanInternal( const RageSpriteVertex v[], int iNumVerts )
|
||||
void RageDisplay_Legacy::DrawFanInternal( const RageSpriteVertex v[], int iNumVerts )
|
||||
{
|
||||
TurnOffHardwareVBO();
|
||||
SendCurrentMatrices();
|
||||
@@ -1443,7 +1443,7 @@ void RageDisplay_OGL::DrawFanInternal( const RageSpriteVertex v[], int iNumVerts
|
||||
glDrawArrays( GL_TRIANGLE_FAN, 0, iNumVerts );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::DrawStripInternal( const RageSpriteVertex v[], int iNumVerts )
|
||||
void RageDisplay_Legacy::DrawStripInternal( const RageSpriteVertex v[], int iNumVerts )
|
||||
{
|
||||
TurnOffHardwareVBO();
|
||||
SendCurrentMatrices();
|
||||
@@ -1452,7 +1452,7 @@ void RageDisplay_OGL::DrawStripInternal( const RageSpriteVertex v[], int iNumVer
|
||||
glDrawArrays( GL_TRIANGLE_STRIP, 0, iNumVerts );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::DrawTrianglesInternal( const RageSpriteVertex v[], int iNumVerts )
|
||||
void RageDisplay_Legacy::DrawTrianglesInternal( const RageSpriteVertex v[], int iNumVerts )
|
||||
{
|
||||
TurnOffHardwareVBO();
|
||||
SendCurrentMatrices();
|
||||
@@ -1461,7 +1461,7 @@ void RageDisplay_OGL::DrawTrianglesInternal( const RageSpriteVertex v[], int iNu
|
||||
glDrawArrays( GL_TRIANGLES, 0, iNumVerts );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::DrawCompiledGeometryInternal( const RageCompiledGeometry *p, int iMeshIndex )
|
||||
void RageDisplay_Legacy::DrawCompiledGeometryInternal( const RageCompiledGeometry *p, int iMeshIndex )
|
||||
{
|
||||
TurnOffHardwareVBO();
|
||||
SendCurrentMatrices();
|
||||
@@ -1469,7 +1469,7 @@ void RageDisplay_OGL::DrawCompiledGeometryInternal( const RageCompiledGeometry *
|
||||
p->Draw( iMeshIndex );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::DrawLineStripInternal( const RageSpriteVertex v[], int iNumVerts, float fLineWidth )
|
||||
void RageDisplay_Legacy::DrawLineStripInternal( const RageSpriteVertex v[], int iNumVerts, float fLineWidth )
|
||||
{
|
||||
TurnOffHardwareVBO();
|
||||
|
||||
@@ -1555,7 +1555,7 @@ static bool SetTextureUnit( TextureUnit tu )
|
||||
return true;
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::ClearAllTextures()
|
||||
void RageDisplay_Legacy::ClearAllTextures()
|
||||
{
|
||||
FOREACH_ENUM( TextureUnit, i )
|
||||
SetTexture( i, 0 );
|
||||
@@ -1566,7 +1566,7 @@ void RageDisplay_OGL::ClearAllTextures()
|
||||
GLExt.glActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
}
|
||||
|
||||
int RageDisplay_OGL::GetNumTextureUnits()
|
||||
int RageDisplay_Legacy::GetNumTextureUnits()
|
||||
{
|
||||
if( GLExt.glActiveTextureARB == NULL )
|
||||
return 1;
|
||||
@@ -1574,7 +1574,7 @@ int RageDisplay_OGL::GetNumTextureUnits()
|
||||
return g_iMaxTextureUnits;
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetTexture( TextureUnit tu, unsigned iTexture )
|
||||
void RageDisplay_Legacy::SetTexture( TextureUnit tu, unsigned iTexture )
|
||||
{
|
||||
if( !SetTextureUnit( tu ) )
|
||||
return;
|
||||
@@ -1590,7 +1590,7 @@ void RageDisplay_OGL::SetTexture( TextureUnit tu, unsigned iTexture )
|
||||
}
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetTextureMode( TextureUnit tu, TextureMode tm )
|
||||
void RageDisplay_Legacy::SetTextureMode( TextureUnit tu, TextureMode tm )
|
||||
{
|
||||
if( !SetTextureUnit( tu ) )
|
||||
return;
|
||||
@@ -1629,7 +1629,7 @@ void RageDisplay_OGL::SetTextureMode( TextureUnit tu, TextureMode tm )
|
||||
}
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetTextureFiltering( TextureUnit tu, bool b )
|
||||
void RageDisplay_Legacy::SetTextureFiltering( TextureUnit tu, bool b )
|
||||
{
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, b? GL_LINEAR: GL_NEAREST );
|
||||
|
||||
@@ -1661,7 +1661,7 @@ void RageDisplay_OGL::SetTextureFiltering( TextureUnit tu, bool b )
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, iMinFilter );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetEffectMode( EffectMode effect )
|
||||
void RageDisplay_Legacy::SetEffectMode( EffectMode effect )
|
||||
{
|
||||
if( GLExt.glUseProgramObjectARB == NULL )
|
||||
return;
|
||||
@@ -1700,7 +1700,7 @@ void RageDisplay_OGL::SetEffectMode( EffectMode effect )
|
||||
DebugAssertNoGLError();
|
||||
}
|
||||
|
||||
bool RageDisplay_OGL::IsEffectModeSupported( EffectMode effect )
|
||||
bool RageDisplay_Legacy::IsEffectModeSupported( EffectMode effect )
|
||||
{
|
||||
switch( effect )
|
||||
{
|
||||
@@ -1718,7 +1718,7 @@ bool RageDisplay_OGL::IsEffectModeSupported( EffectMode effect )
|
||||
return false;
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetBlendMode( BlendMode mode )
|
||||
void RageDisplay_Legacy::SetBlendMode( BlendMode mode )
|
||||
{
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
@@ -1785,21 +1785,21 @@ void RageDisplay_OGL::SetBlendMode( BlendMode mode )
|
||||
glBlendFunc( iSourceRGB, iDestRGB );
|
||||
}
|
||||
|
||||
bool RageDisplay_OGL::IsZWriteEnabled() const
|
||||
bool RageDisplay_Legacy::IsZWriteEnabled() const
|
||||
{
|
||||
bool a;
|
||||
glGetBooleanv( GL_DEPTH_WRITEMASK, (unsigned char*)&a );
|
||||
return a;
|
||||
}
|
||||
|
||||
bool RageDisplay_OGL::IsZTestEnabled() const
|
||||
bool RageDisplay_Legacy::IsZTestEnabled() const
|
||||
{
|
||||
GLenum a;
|
||||
glGetIntegerv( GL_DEPTH_FUNC, (GLint*)&a );
|
||||
return a != GL_ALWAYS;
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::ClearZBuffer()
|
||||
void RageDisplay_Legacy::ClearZBuffer()
|
||||
{
|
||||
bool write = IsZWriteEnabled();
|
||||
SetZWrite( true );
|
||||
@@ -1807,12 +1807,12 @@ void RageDisplay_OGL::ClearZBuffer()
|
||||
SetZWrite( write );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetZWrite( bool b )
|
||||
void RageDisplay_Legacy::SetZWrite( bool b )
|
||||
{
|
||||
glDepthMask( b );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetZBias( float f )
|
||||
void RageDisplay_Legacy::SetZBias( float f )
|
||||
{
|
||||
float fNear = SCALE( f, 0.0f, 1.0f, 0.05f, 0.0f );
|
||||
float fFar = SCALE( f, 0.0f, 1.0f, 1.0f, 0.95f );
|
||||
@@ -1820,7 +1820,7 @@ void RageDisplay_OGL::SetZBias( float f )
|
||||
glDepthRange( fNear, fFar );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetZTestMode( ZTestMode mode )
|
||||
void RageDisplay_Legacy::SetZTestMode( ZTestMode mode )
|
||||
{
|
||||
glEnable( GL_DEPTH_TEST );
|
||||
switch( mode )
|
||||
@@ -1832,7 +1832,7 @@ void RageDisplay_OGL::SetZTestMode( ZTestMode mode )
|
||||
}
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetTextureWrapping( TextureUnit tu, bool b )
|
||||
void RageDisplay_Legacy::SetTextureWrapping( TextureUnit tu, bool b )
|
||||
{
|
||||
/* This should be per-texture-unit state, but it's per-texture state in OpenGl,
|
||||
* so we'll behave incorrectly if the same texture is used in more than one texture
|
||||
@@ -1844,7 +1844,7 @@ void RageDisplay_OGL::SetTextureWrapping( TextureUnit tu, bool b )
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, mode );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetMaterial(
|
||||
void RageDisplay_Legacy::SetMaterial(
|
||||
const RageColor &emissive,
|
||||
const RageColor &ambient,
|
||||
const RageColor &diffuse,
|
||||
@@ -1878,18 +1878,18 @@ void RageDisplay_OGL::SetMaterial(
|
||||
}
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetLighting( bool b )
|
||||
void RageDisplay_Legacy::SetLighting( bool b )
|
||||
{
|
||||
if( b ) glEnable( GL_LIGHTING );
|
||||
else glDisable( GL_LIGHTING );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetLightOff( int index )
|
||||
void RageDisplay_Legacy::SetLightOff( int index )
|
||||
{
|
||||
glDisable( GL_LIGHT0+index );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetLightDirectional(
|
||||
void RageDisplay_Legacy::SetLightDirectional(
|
||||
int index,
|
||||
const RageColor &ambient,
|
||||
const RageColor &diffuse,
|
||||
@@ -1911,7 +1911,7 @@ void RageDisplay_OGL::SetLightDirectional(
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetCullMode( CullMode mode )
|
||||
void RageDisplay_Legacy::SetCullMode( CullMode mode )
|
||||
{
|
||||
if (mode != CULL_NONE)
|
||||
glEnable(GL_CULL_FACE);
|
||||
@@ -1931,39 +1931,39 @@ void RageDisplay_OGL::SetCullMode( CullMode mode )
|
||||
}
|
||||
}
|
||||
|
||||
const RageDisplay::PixelFormatDesc *RageDisplay_OGL::GetPixelFormatDesc(PixelFormat pf) const
|
||||
const RageDisplay::PixelFormatDesc *RageDisplay_Legacy::GetPixelFormatDesc(PixelFormat pf) const
|
||||
{
|
||||
ASSERT( pf < NUM_PixelFormat );
|
||||
return &PIXEL_FORMAT_DESC[pf];
|
||||
}
|
||||
|
||||
bool RageDisplay_OGL::SupportsThreadedRendering()
|
||||
bool RageDisplay_Legacy::SupportsThreadedRendering()
|
||||
{
|
||||
return g_pWind->SupportsThreadedRendering();
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::BeginConcurrentRenderingMainThread()
|
||||
void RageDisplay_Legacy::BeginConcurrentRenderingMainThread()
|
||||
{
|
||||
g_pWind->BeginConcurrentRenderingMainThread();
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::EndConcurrentRenderingMainThread()
|
||||
void RageDisplay_Legacy::EndConcurrentRenderingMainThread()
|
||||
{
|
||||
g_pWind->EndConcurrentRenderingMainThread();
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::BeginConcurrentRendering()
|
||||
void RageDisplay_Legacy::BeginConcurrentRendering()
|
||||
{
|
||||
g_pWind->BeginConcurrentRendering();
|
||||
RageDisplay::BeginConcurrentRendering();
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::EndConcurrentRendering()
|
||||
void RageDisplay_Legacy::EndConcurrentRendering()
|
||||
{
|
||||
g_pWind->EndConcurrentRendering();
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::DeleteTexture( unsigned iTexture )
|
||||
void RageDisplay_Legacy::DeleteTexture( unsigned iTexture )
|
||||
{
|
||||
if( iTexture == 0 )
|
||||
return;
|
||||
@@ -1981,7 +1981,7 @@ void RageDisplay_OGL::DeleteTexture( unsigned iTexture )
|
||||
}
|
||||
|
||||
|
||||
PixelFormat RageDisplay_OGL::GetImgPixelFormat( RageSurface* &img, bool &bFreeImg, int width, int height, bool bPalettedTexture )
|
||||
PixelFormat RageDisplay_Legacy::GetImgPixelFormat( RageSurface* &img, bool &bFreeImg, int width, int height, bool bPalettedTexture )
|
||||
{
|
||||
PixelFormat pixfmt = FindPixelFormat( img->format->BitsPerPixel, img->format->Rmask, img->format->Gmask, img->format->Bmask, img->format->Amask );
|
||||
|
||||
@@ -2048,7 +2048,7 @@ void SetPixelMapForSurface( int glImageFormat, int glTexFormat, const RageSurfac
|
||||
DebugAssertNoGLError();
|
||||
}
|
||||
|
||||
unsigned RageDisplay_OGL::CreateTexture(
|
||||
unsigned RageDisplay_Legacy::CreateTexture(
|
||||
PixelFormat pixfmt,
|
||||
RageSurface* pImg,
|
||||
bool bGenerateMipMaps )
|
||||
@@ -2258,7 +2258,7 @@ private:
|
||||
unsigned m_iTexHandle;
|
||||
};
|
||||
|
||||
RageTextureLock *RageDisplay_OGL::CreateTextureLock()
|
||||
RageTextureLock *RageDisplay_Legacy::CreateTextureLock()
|
||||
{
|
||||
if( !GLExt.HasExtension("GL_ARB_pixel_buffer_object") )
|
||||
return NULL;
|
||||
@@ -2266,7 +2266,7 @@ RageTextureLock *RageDisplay_OGL::CreateTextureLock()
|
||||
return new RageTextureLock_OGL;
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::UpdateTexture(
|
||||
void RageDisplay_Legacy::UpdateTexture(
|
||||
unsigned iTexHandle,
|
||||
RageSurface* pImg,
|
||||
int iXOffset, int iYOffset, int iWidth, int iHeight )
|
||||
@@ -2421,7 +2421,7 @@ void RenderTarget_FramebufferObject::FinishRenderingTo()
|
||||
GLExt.glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 );
|
||||
}
|
||||
|
||||
bool RageDisplay_OGL::SupportsRenderToTexture() const
|
||||
bool RageDisplay_Legacy::SupportsRenderToTexture() const
|
||||
{
|
||||
return GLExt.m_bGL_EXT_framebuffer_object || g_pWind->SupportsRenderToTexture();
|
||||
}
|
||||
@@ -2432,7 +2432,7 @@ bool RageDisplay_OGL::SupportsRenderToTexture() const
|
||||
* particularly GeForce 2, but is simpler and faster when available.
|
||||
*/
|
||||
|
||||
unsigned RageDisplay_OGL::CreateRenderTarget( const RenderTargetParam ¶m, int &iTextureWidthOut, int &iTextureHeightOut )
|
||||
unsigned RageDisplay_Legacy::CreateRenderTarget( const RenderTargetParam ¶m, int &iTextureWidthOut, int &iTextureHeightOut )
|
||||
{
|
||||
RenderTarget *pTarget;
|
||||
if( GLExt.m_bGL_EXT_framebuffer_object )
|
||||
@@ -2449,7 +2449,7 @@ unsigned RageDisplay_OGL::CreateRenderTarget( const RenderTargetParam ¶m, in
|
||||
return iTexture;
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetRenderTarget( unsigned iTexture, bool bPreserveTexture )
|
||||
void RageDisplay_Legacy::SetRenderTarget( unsigned iTexture, bool bPreserveTexture )
|
||||
{
|
||||
if( iTexture == 0 )
|
||||
{
|
||||
@@ -2510,7 +2510,7 @@ void RageDisplay_OGL::SetRenderTarget( unsigned iTexture, bool bPreserveTexture
|
||||
}
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetPolygonMode( PolygonMode pm )
|
||||
void RageDisplay_Legacy::SetPolygonMode( PolygonMode pm )
|
||||
{
|
||||
GLenum m;
|
||||
switch( pm )
|
||||
@@ -2522,12 +2522,12 @@ void RageDisplay_OGL::SetPolygonMode( PolygonMode pm )
|
||||
glPolygonMode( GL_FRONT_AND_BACK, m );
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetLineWidth( float fWidth )
|
||||
void RageDisplay_Legacy::SetLineWidth( float fWidth )
|
||||
{
|
||||
glLineWidth( fWidth );
|
||||
}
|
||||
|
||||
RString RageDisplay_OGL::GetTextureDiagnostics( unsigned iTexture ) const
|
||||
RString RageDisplay_Legacy::GetTextureDiagnostics( unsigned iTexture ) const
|
||||
{
|
||||
/*
|
||||
s << (bGenerateMipMaps? "gluBuild2DMipmaps":"glTexImage2D");
|
||||
@@ -2560,7 +2560,7 @@ RString RageDisplay_OGL::GetTextureDiagnostics( unsigned iTexture ) const
|
||||
return RString();
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetAlphaTest( bool b )
|
||||
void RageDisplay_Legacy::SetAlphaTest( bool b )
|
||||
{
|
||||
glAlphaFunc( GL_GREATER, 0.01f );
|
||||
if( b )
|
||||
@@ -2584,7 +2584,7 @@ void RageDisplay_OGL::SetAlphaTest( bool b )
|
||||
* Another case of this is incomplete packed pixels support. Some implementations
|
||||
* neglect GL_UNSIGNED_SHORT_*_REV.
|
||||
*/
|
||||
bool RageDisplay_OGL::SupportsSurfaceFormat( PixelFormat pixfmt )
|
||||
bool RageDisplay_Legacy::SupportsSurfaceFormat( PixelFormat pixfmt )
|
||||
{
|
||||
switch( g_GLPixFmtInfo[pixfmt].type )
|
||||
{
|
||||
@@ -2596,7 +2596,7 @@ bool RageDisplay_OGL::SupportsSurfaceFormat( PixelFormat pixfmt )
|
||||
}
|
||||
|
||||
|
||||
bool RageDisplay_OGL::SupportsTextureFormat( PixelFormat pixfmt, bool bRealtime )
|
||||
bool RageDisplay_Legacy::SupportsTextureFormat( PixelFormat pixfmt, bool bRealtime )
|
||||
{
|
||||
/* If we support a pixfmt for texture formats but not for surface formats, then
|
||||
* we'll have to convert the texture to a supported surface format before uploading.
|
||||
@@ -2616,14 +2616,14 @@ bool RageDisplay_OGL::SupportsTextureFormat( PixelFormat pixfmt, bool bRealtime
|
||||
}
|
||||
}
|
||||
|
||||
bool RageDisplay_OGL::SupportsPerVertexMatrixScale()
|
||||
bool RageDisplay_Legacy::SupportsPerVertexMatrixScale()
|
||||
{
|
||||
// Intel i915 on OSX 10.4.4 supports vertex programs but not hardware vertex buffers.
|
||||
// Our software vertex rendering doesn't support vertex programs.
|
||||
return GLExt.glGenBuffersARB && g_bTextureMatrixShader != 0;
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetSphereEnvironmentMapping( TextureUnit tu, bool b )
|
||||
void RageDisplay_Legacy::SetSphereEnvironmentMapping( TextureUnit tu, bool b )
|
||||
{
|
||||
if( !SetTextureUnit( tu ) )
|
||||
return;
|
||||
@@ -2644,7 +2644,7 @@ void RageDisplay_OGL::SetSphereEnvironmentMapping( TextureUnit tu, bool b )
|
||||
|
||||
GLint iCelTexture1, iCelTexture2 = NULL;
|
||||
|
||||
void RageDisplay_OGL::SetCelShaded( int stage )
|
||||
void RageDisplay_Legacy::SetCelShaded( int stage )
|
||||
{
|
||||
if( !GLExt.m_bGL_ARB_fragment_shader )
|
||||
return; // not supported
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* RageDisplay_OGL: OpenGL renderer. */
|
||||
/* RageDisplay_Legacy: OpenGL renderer. */
|
||||
|
||||
#ifndef RAGE_DISPLAY_OGL_H
|
||||
#define RAGE_DISPLAY_OGL_H
|
||||
@@ -12,7 +12,7 @@
|
||||
#define AssertNoGLError() \
|
||||
{ \
|
||||
GLenum error = glGetError(); \
|
||||
ASSERT_M( error == GL_NO_ERROR, RageDisplay_OGL_Helpers::GLToString(error) ); \
|
||||
ASSERT_M( error == GL_NO_ERROR, RageDisplay_Legacy_Helpers::GLToString(error) ); \
|
||||
}
|
||||
|
||||
#if defined(DEBUG) || !defined(GL_GET_ERROR_IS_SLOW)
|
||||
@@ -23,11 +23,11 @@
|
||||
#define DebugAssertNoGLError()
|
||||
#endif
|
||||
|
||||
class RageDisplay_OGL: public RageDisplay
|
||||
class RageDisplay_Legacy: public RageDisplay
|
||||
{
|
||||
public:
|
||||
RageDisplay_OGL();
|
||||
virtual ~RageDisplay_OGL();
|
||||
RageDisplay_Legacy();
|
||||
virtual ~RageDisplay_Legacy();
|
||||
virtual RString Init( const VideoModeParams &p, bool bAllowUnacceleratedRenderer );
|
||||
|
||||
virtual RString GetApiDescription() const { return "OpenGL"; }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "RageDisplay_OGL_Helpers.h"
|
||||
#include "RageDisplay_Legacy_Helpers.h"
|
||||
#include "RageUtil.h"
|
||||
|
||||
#include "RageLog.h"
|
||||
@@ -31,12 +31,12 @@ namespace
|
||||
}
|
||||
};
|
||||
|
||||
void RageDisplay_OGL_Helpers::Init()
|
||||
void RageDisplay_Legacy_Helpers::Init()
|
||||
{
|
||||
InitStringMap();
|
||||
}
|
||||
|
||||
RString RageDisplay_OGL_Helpers::GLToString( GLenum e )
|
||||
RString RageDisplay_Legacy_Helpers::GLToString( GLenum e )
|
||||
{
|
||||
if( g_Strings.find(e) != g_Strings.end() )
|
||||
return g_Strings[e];
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#undef __glext_h_
|
||||
#include "glext.h"
|
||||
|
||||
/* Import RageDisplay, for types. Do not include RageDisplay_OGL.h. */
|
||||
/* Import RageDisplay, for types. Do not include RageDisplay_Legacy.h. */
|
||||
#include "RageDisplay.h"
|
||||
|
||||
/* Windows defines GL_EXT_paletted_texture incompletely: */
|
||||
@@ -31,7 +31,7 @@
|
||||
typedef bool (APIENTRY * PWSWAPINTERVALEXTPROC) (int interval);
|
||||
|
||||
/** @brief Utilities for working with the RageDisplay. */
|
||||
namespace RageDisplay_OGL_Helpers
|
||||
namespace RageDisplay_Legacy_Helpers
|
||||
{
|
||||
void Init();
|
||||
RString GLToString( GLenum e );
|
||||
|
||||
+23
-19
@@ -421,12 +421,12 @@ static void AdjustForChangedSystemCapabilities()
|
||||
}
|
||||
|
||||
#if defined(WIN32)
|
||||
#include "RageDisplay_D3D.h"
|
||||
//#include "RageDisplay_D3D.h"
|
||||
#include "archutils/Win32/VideoDriverInfo.h"
|
||||
#endif
|
||||
|
||||
#if defined(SUPPORT_OPENGL)
|
||||
#include "RageDisplay_OGL.h"
|
||||
#include "RageDisplay_Legacy.h"
|
||||
#endif
|
||||
|
||||
#include "RageDisplay_Null.h"
|
||||
@@ -469,6 +469,7 @@ struct VideoCardDefaults
|
||||
}
|
||||
} const g_VideoCardDefaults[] =
|
||||
{
|
||||
/*
|
||||
VideoCardDefaults(
|
||||
"Xbox",
|
||||
"d3d",
|
||||
@@ -477,9 +478,10 @@ struct VideoCardDefaults
|
||||
2048,
|
||||
true
|
||||
),
|
||||
*/
|
||||
VideoCardDefaults(
|
||||
"Voodoo *5",
|
||||
"d3d,opengl", // received 3 reports of opengl crashing. -Chris
|
||||
"opengl", // received 3 reports of opengl crashing. -Chris
|
||||
640,480,
|
||||
32,32,32,
|
||||
2048,
|
||||
@@ -487,7 +489,7 @@ struct VideoCardDefaults
|
||||
),
|
||||
VideoCardDefaults(
|
||||
"Voodoo|3dfx", // all other Voodoos: some drivers don't identify which one
|
||||
"d3d,opengl",
|
||||
"opengl",
|
||||
640,480,
|
||||
16,16,16,
|
||||
256,
|
||||
@@ -495,7 +497,7 @@ struct VideoCardDefaults
|
||||
),
|
||||
VideoCardDefaults(
|
||||
"Radeon.* 7|Wonder 7500|ArcadeVGA", // Radeon 7xxx, RADEON Mobility 7500
|
||||
"d3d,opengl", // movie texture performance is terrible in OpenGL, but fine in D3D.
|
||||
"opengl", // movie texture performance is terrible in OpenGL, but fine in D3D.
|
||||
640,480,
|
||||
16,16,16,
|
||||
2048,
|
||||
@@ -503,7 +505,7 @@ struct VideoCardDefaults
|
||||
),
|
||||
VideoCardDefaults(
|
||||
"GeForce|Radeon|Wonder 9|Quadro",
|
||||
"opengl,d3d",
|
||||
"opengl",
|
||||
640,480,
|
||||
32,32,32, // 32 bit textures are faster to load
|
||||
2048,
|
||||
@@ -511,7 +513,7 @@ struct VideoCardDefaults
|
||||
),
|
||||
VideoCardDefaults(
|
||||
"TNT|Vanta|M64",
|
||||
"opengl,d3d",
|
||||
"opengl",
|
||||
640,480,
|
||||
16,16,16, // Athlon 1.2+TNT demonstration w/ movies: 70fps w/ 32bit textures, 86fps w/ 16bit textures
|
||||
2048,
|
||||
@@ -519,12 +521,13 @@ struct VideoCardDefaults
|
||||
),
|
||||
VideoCardDefaults(
|
||||
"G200|G250|G400",
|
||||
"d3d,opengl",
|
||||
"opengl",
|
||||
640,480,
|
||||
16,16,16,
|
||||
2048,
|
||||
false // broken, causes black screen
|
||||
),
|
||||
/*
|
||||
VideoCardDefaults(
|
||||
"Savage",
|
||||
"d3d",
|
||||
@@ -548,9 +551,10 @@ struct VideoCardDefaults
|
||||
256,
|
||||
false
|
||||
),
|
||||
*/
|
||||
VideoCardDefaults(
|
||||
"RAGE MOBILITY-M1",
|
||||
"d3d,opengl", // Vertex alpha is broken in OpenGL, but not D3D. -Chris
|
||||
"opengl", // Vertex alpha is broken in OpenGL, but not D3D. -Chris
|
||||
400,300, // lower resolution for 60fps
|
||||
16,16,16,
|
||||
256,
|
||||
@@ -558,7 +562,7 @@ struct VideoCardDefaults
|
||||
),
|
||||
VideoCardDefaults(
|
||||
"Mobility M3", // ATI Rage Mobility 128 (AKA "M3")
|
||||
"d3d,opengl", // bad movie texture performance in opengl
|
||||
"opengl", // bad movie texture performance in opengl
|
||||
640,480,
|
||||
16,16,16,
|
||||
1024,
|
||||
@@ -566,7 +570,7 @@ struct VideoCardDefaults
|
||||
),
|
||||
VideoCardDefaults(
|
||||
"Intel.*82810|Intel.*82815",
|
||||
"opengl,d3d",// OpenGL is 50%+ faster than D3D w/ latest Intel drivers. -Chris
|
||||
"opengl",// OpenGL is 50%+ faster than D3D w/ latest Intel drivers. -Chris
|
||||
512,384, // lower resolution for 60fps
|
||||
16,16,16,
|
||||
512,
|
||||
@@ -574,15 +578,15 @@ struct VideoCardDefaults
|
||||
),
|
||||
VideoCardDefaults(
|
||||
"Intel*Extreme Graphics",
|
||||
"d3d", // OpenGL blue screens w/ XP drivers from 6-21-2002
|
||||
"opengl", // OpenGL blue screens w/ XP drivers from 6-21-2002
|
||||
640,480,
|
||||
16,16,16, // slow at 32bpp
|
||||
1024,
|
||||
false
|
||||
),
|
||||
VideoCardDefaults(
|
||||
"Intel.*", /* fallback: all unknown Intel cards to D3D, since Intel is notoriously bad at OpenGL */
|
||||
"d3d,opengl",
|
||||
"Intel.*", /* fallback: all unknown Intel cards to since Intel is notoriously bad at OpenGL */
|
||||
"opengl",
|
||||
640,480,
|
||||
16,16,16,
|
||||
2048,
|
||||
@@ -595,17 +599,17 @@ struct VideoCardDefaults
|
||||
// bug 764830: ASSERT fail after glDeleteTextures for "VIA Tech VT8361/VT8601 Graphics Controller"
|
||||
// bug 791950: AV in glsis630!DrvSwapBuffers for "SiS 630/730"
|
||||
"Trident Video Accelerator CyberBlade|VIA.*VT|SiS 6*",
|
||||
"d3d,opengl",
|
||||
"opengl",
|
||||
640,480,
|
||||
16,16,16,
|
||||
2048,
|
||||
false
|
||||
),
|
||||
VideoCardDefaults(
|
||||
/* Unconfirmed texture problems on this; let's try D3D, since it's
|
||||
/* Unconfirmed texture problems on this; let's try since it's
|
||||
* a VIA/S3 chipset. */
|
||||
"VIA/S3G KM400/KN400",
|
||||
"d3d,opengl",
|
||||
"opengl",
|
||||
640,480,
|
||||
16,16,16,
|
||||
2048,
|
||||
@@ -623,7 +627,7 @@ struct VideoCardDefaults
|
||||
// Default graphics settings used for all cards that don't match above.
|
||||
// This must be the very last entry!
|
||||
"",
|
||||
"opengl,d3d",
|
||||
"opengl",
|
||||
640,480,
|
||||
32,32,32,
|
||||
2048,
|
||||
@@ -762,7 +766,7 @@ RageDisplay *CreateDisplay()
|
||||
if( sRenderer.CompareNoCase("opengl")==0 )
|
||||
{
|
||||
#if defined(SUPPORT_OPENGL)
|
||||
pRet = new RageDisplay_OGL;
|
||||
pRet = new RageDisplay_Legacy;
|
||||
#endif
|
||||
}
|
||||
else if( sRenderer.CompareNoCase("d3d")==0 )
|
||||
|
||||
Reference in New Issue
Block a user