From: Glenn M. <gma...@us...> - 2007-05-06 02:43:06
|
Update of /cvsroot/stepmania/stepmania/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4433 Modified Files: RageDisplay_OGL.cpp Log Message: log this normally Index: RageDisplay_OGL.cpp =================================================================== RCS file: /cvsroot/stepmania/stepmania/src/RageDisplay_OGL.cpp,v retrieving revision 1.320 retrieving revision 1.321 diff -u -d -p -r1.320 -r1.321 --- RageDisplay_OGL.cpp 27 Mar 2007 00:24:56 -0000 1.320 +++ RageDisplay_OGL.cpp 6 May 2007 02:43:05 -0000 1.321 @@ -21,7 +21,6 @@ using namespace RageDisplay_OGL_Helpers; #include "arch/LowLevelWindow/LowLevelWindow.h" #include <set> -#include <sstream> #if defined(_MSC_VER) #pragma comment(lib, "opengl32.lib") @@ -2092,21 +2091,12 @@ unsigned RageDisplay_OGL::CreateTexture( ASSERT( iRealFormat == GL_RGBA8 ); } - - - { - ostringstream s; - - s << (bGenerateMipMaps? "gluBuild2DMipmaps":"glTexImage2D"); - s << "(format " << GLToString(glTexFormat) << - ", " << pImg->w << "x" << pImg->h << - ", format " << GLToString(glImageFormat) << - ", type " << GLToString(glImageType) << - ", pixfmt " << pixfmt << - ", imgpixfmt " << SurfacePixFmt << - ")"; - LOG->Trace( "%s", s.str().c_str() ); - } + LOG->Trace( "%s (format %s, %ix%i, format %s, type %s, pixfmt %i, imgpixfmt %i)", + bGenerateMipMaps? "gluBuild2DMipmaps":"glTexImage2D", + GLToString(glTexFormat).c_str(), + pImg->w, pImg->h, + GLToString(glImageFormat).c_str(), + GLToString(glImageType).c_str(), pixfmt, SurfacePixFmt ); FlushGLErrors(); @@ -2493,8 +2483,36 @@ void RageDisplay_OGL::SetLineWidth( floa glLineWidth( fWidth ); } -RString RageDisplay_OGL::GetTextureDiagnostics( unsigned id ) const +RString RageDisplay_OGL::GetTextureDiagnostics( unsigned iTexture ) const { + /* + s << (bGenerateMipMaps? "gluBuild2DMipmaps":"glTexImage2D"); + s << "(format " << GLToString(glTexFormat) << + ", " << pImg->w << "x" << pImg->h << + ", format " << GLToString(iFormat) << + ", type " << GLToString(glImageType) << + ", pixfmt " << pixfmt << + ", imgpixfmt " << SurfacePixFmt << + ")"; + LOG->Trace( "%s", s.str().c_str() ); + + glBindTexture( GL_TEXTURE_2D, iTexture ); + + GLint iWidth; + glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GLenum(GL_TEXTURE_WIDTH), (GLint *) &iWidth ); + GLint iHeight; + glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GLenum(GL_TEXTURE_HEIGHT), (GLint *) &iHeight ); + GLint iFormat; + glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GLenum(GL_TEXTURE_INTERNAL_FORMAT), (GLint *) &iFormat ); + + GL_CHECK_ERROR( "glGetTexLevelParameteriv(GL_TEXTURE_INTERNAL_FORMAT)" ); + if( iFormat != glTexFormat ) + { + sError = ssprintf( "Expected format %s, got %s instead", + GLToString(glTexFormat).c_str(), GLToString(iFormat).c_str() ); + break; + } +*/ return RString(); } |