GBitmap being deleted from t2dImageMapDatablock??
by Quoc Le · in Torque Game Engine · 03/13/2010 (12:02 pm) · 3 replies
I'm trying to access GBitmap through t2dImageMapDatablock but I keep getting NULL.
`TextureHandle tex = getImageMapFrameTexture(frame);
GBitmap* bmp = tex.getBitmap();
`
I see through the code it might be deallocated after loading into the GLTexture. Is there an option on the ImageMap that I can turn this off?
`TextureHandle tex = getImageMapFrameTexture(frame);
GBitmap* bmp = tex.getBitmap();
`
I see through the code it might be deallocated after loading into the GLTexture. Is there an option on the ImageMap that I can turn this off?
About the author
#2
At the least this should give you a stepping point to figure out what is going on.
In TGE only
BitmapTexture
BitmapKeepTexture
BitmapNoDownloadTexture
will keep thier respective Gbitmaps after creation every other enumerated Texturehandletype deletes it's gbitmap upon creation when the texturehandle registers the texture with the texturemanager.
so you could either try getting your instance to use whatever equivalent TGB uses or create your own type and have it function very similar to one of those three. Either way it would depend on what you want to do with your Gbitmap.
that is how it works in TGE as far as TGB your on your own.
03/23/2010 (2:55 am)
Well acctually i might have an answer for this little problem though not sure how simlar or dissimlar TGB/T2D is from Torque as far as it's structure at handling texture types.At the least this should give you a stepping point to figure out what is going on.
In TGE only
BitmapTexture
BitmapKeepTexture
BitmapNoDownloadTexture
will keep thier respective Gbitmaps after creation every other enumerated Texturehandletype deletes it's gbitmap upon creation when the texturehandle registers the texture with the texturemanager.
so you could either try getting your instance to use whatever equivalent TGB uses or create your own type and have it function very similar to one of those three. Either way it would depend on what you want to do with your Gbitmap.
that is how it works in TGE as far as TGB your on your own.
#3
Thanks..
03/24/2010 (1:59 pm)
Yeah I ended up creating my own class, copying from StaticObject, and forcing BitmapKeepTexture so I can keep the GBitmap.Thanks..
Torque 3D Owner Daniel Buckmaster
Not sure if this response was necessary or even useful, but you're far more likely to get a response in the TGB/T2D forum.