StelQGLRenderer.cpp   StelQGLRenderer.cpp 
skipping to change at line 24 skipping to change at line 24
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include <cmath> #include <cmath>
#include "StelQGLRenderer.hpp" #include "StelQGLRenderer.hpp"
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "QSettings"
void StelQGLRenderer::bindTextureBackend void StelQGLRenderer::bindTextureBackend
(StelTextureBackend* const textureBackend, const int textureUnit) (StelTextureBackend* const textureBackend, const int textureUnit)
{ {
invariant(); invariant();
StelQGLTextureBackend* qglTextureBackend = StelQGLTextureBackend* qglTextureBackend =
dynamic_cast<StelQGLTextureBackend*>(textureBackend); dynamic_cast<StelQGLTextureBackend*>(textureBackend);
Q_ASSERT_X(qglTextureBackend != NULL, Q_FUNC_INFO, Q_ASSERT_X(qglTextureBackend != NULL, Q_FUNC_INFO,
"Trying to bind a texture created by a different renderer backend"); "Trying to bind a texture created by a different renderer backend");
QSettings* conf = StelApp::getInstance().getSettings();
const TextureStatus status = qglTextureBackend->getStatus(); const TextureStatus status = qglTextureBackend->getStatus();
if(status == TextureStatus_Uninitialized) if(status == TextureStatus_Uninitialized)
{ {
qglTextureBackend->startAsynchronousLoading(); qglTextureBackend->startAsynchronousLoading();
} }
// Ignore the texture if we don't have enough texture units // Ignore the texture if we don't have enough texture units
// or if texture unit is nonzero and we don't support multitexturing . // or if texture unit is nonzero and we don't support multitexturing .
if(textureUnit >= textureUnitCount) if(textureUnit >= textureUnitCount)
{ {
invariant(); invariant();
skipping to change at line 56 skipping to change at line 59
if(status == TextureStatus_Loaded) if(status == TextureStatus_Loaded)
{ {
if(currentlyBoundTextures[textureUnit] != qglTextureBackend) if(currentlyBoundTextures[textureUnit] != qglTextureBackend)
{ {
qglTextureBackend->bind(textureUnit); qglTextureBackend->bind(textureUnit);
currentlyBoundTextures[textureUnit] = qglTextureBack end; currentlyBoundTextures[textureUnit] = qglTextureBack end;
} }
} }
else else
{ {
getPlaceholderTexture()->bind(textureUnit); // by default placeholder is hide but its can be enabled for
currentlyBoundTextures[textureUnit] = getPlaceholderTexture( debugging
); if (conf->value("debug/texture_placeholder_flag", false).toB
ool())
{
getPlaceholderTexture()->bind(textureUnit);
currentlyBoundTextures[textureUnit] = getPlaceholder
Texture();
}
} }
invariant(); invariant();
} }
void StelQGLRenderer::destroyTextureBackend(StelTextureBackend* const textu reBackend) void StelQGLRenderer::destroyTextureBackend(StelTextureBackend* const textu reBackend)
{ {
invariant(); invariant();
StelQGLTextureBackend* qglTextureBackend = StelQGLTextureBackend* qglTextureBackend =
dynamic_cast<StelQGLTextureBackend*>(textureBackend); dynamic_cast<StelQGLTextureBackend*>(textureBackend);
Q_ASSERT_X(qglTextureBackend != NULL, Q_FUNC_INFO, Q_ASSERT_X(qglTextureBackend != NULL, Q_FUNC_INFO,
 End of changes. 3 change blocks. 
3 lines changed or deleted 12 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/