Game Development Community

Weird texture corruption

by Igor G · in Torque Game Engine Advanced · 08/09/2007 (12:49 pm) · 1 replies

I'm getting a texture corruption while in game like so:

x0e.xanga.com/f67d654326631140805356/b103804173.jpg
I'm using doing this to create my texture:

mTexture = GFX->mTextureManager->createTexture(mTextureWidth, mTextureHeight, GFXFormatR8G8B8X8, &GFXMyGUIProfile);

And my texture profile here:

GFX_ImplementTextureProfile(GFXMyGUIProfile,
GFXTextureProfile::DiffuseMap,
GFXTextureProfile::Dynamic |
GFXTextureProfile::NoPadding,
GFXTextureProfile::None);

I am manually putting the pixel data into the texture by locking and unlocking it.

Drawing my texture:
GFX->clearBitmapModulation();
RectI srcRegion;
srcRegion.set(0, 0, 800, 600);
RectI rect(offset, mBounds.extent);
GFX->drawBitmapStretchSR(mTexture, rect, srcRegion);

=========================================================
The weird thing is this ONLY happens in a mission. When I'm in the main menu, it works perfectly fine.
Also, if I make my control bigger (thereby making the texture bigger), the corruption diminishes until the size is the same as my screen resolution, at which point the texture is perfect.

Does anyone have any ideas what's going on? Am I not creating my texture correctly or something else?

Thanks.

#1
08/09/2007 (12:53 pm)
Ok, nevermind, I figured it out - just added GFXTextureProfile::NoMipmap to the profile.