I must be using texture wrong: ISSUE RESOLVED

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

I must be using texture wrong: ISSUE RESOLVED

Post by keless »

1) gs_Intro loads a texture:
m_pRPGLogo = NULL;
printf("loading dragon.bmp\n");
m_driver->setTextureCreationFlag(irr::video::ETCF_OPTIMIZED_FOR_QUALITY, true);
m_pRPGLogo = m_driver->getTexture("data/dragon.bmp");

2) gs_Intro trys to draw the texture during rendering:
if(m_pRPGLogo) m_driver->draw2DImage(m_pRPGLogo,
irr::core::position2d< irr::s32 >(50,50),
irr::core::rect< irr::s32 >(0,0,320,240),
0,
irr::video::SColor(255, 255, 255, 255),
true
);

3) gs_Intro is destroyed, and unloads it:
if(m_pRPGLogo) {
printf("unloading dragon.bmp\n");
m_pRPGLogo->drop(); //should we be dropping?
m_pRPGLogo = NULL;
}

4) gs_Intro is created again, trys to load texture, crashes:
"
loading dragon.bmp (1)
Loaded texture: data/dragon.bmp
unloading dragon.bmp (3)
loading dragon.bmp (4)
Fatal Error: Tried to set a texture not owned by this driver.
"


also, the image never actually draws (2), unless I load the image somewhere else first.
Last edited by keless on Thu Jan 22, 2004 4:18 am, edited 1 time in total.
a screen cap is worth 0x100000 DWORDS
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

issue resolved:

when loading the dragon texture, I did not create a color key texture for transparency like the Ice image. Thus, when I was drawing the dragon image, and still had 'true' for use alpha transparency, the whole thing was determined to be transparent. I have turned this to false and it works now. My bad.
a screen cap is worth 0x100000 DWORDS
Post Reply