Jump to content

CreateTexture issue


tec.imp
 Share

Recommended Posts

Hey there,

 

I've got a problem regarding the function CreateTexture in 2.31 and the later use of the all new created texture object.

 

Here's what I do (pseudo code):

 

myTexture = CreateTexture(256, 64, TEXTURE_RGBA);

BindTexture(myTexture, 0);
<1. render stuff and flip>

UpdateWorld();

BindTexture(myTexture, 0); // <- crash
<2. render stuff and flip>

 

As you can see, this is nothing fancy. I create a new texture object, bind it, render some stuff, see it on screen, update the world and render some more stuff. You may say that the texture is empty. Well it is but that's only for testing purpose and shouldn't cause any problems now, should it? Well, wrong.

 

It crashes on me within the second render part. Apparently, the pointer/handle/whatever to the texture object is now invalid and the engine will crash. However this behaviour isn't true for textures being loaded from file. Wth?!

 

If I remove the UpdateWorld() call everything is just peachy. I do suspect the BlitzMax Garbage Collector of being overeagerly doing its work. Seriously, what's going on here?

 

Josh, maybe?

 

 

Mfg Imp

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...