This is baffling.
Scenario: I'm building a tool that allows me to mess with multiple images' data in memblocks, then convert them to images, and texture my object and its limbs at will (If the images exist they are deleted first.)
Problem:Works first 400 times...[edit]Arround 255 actually[/edit] code gone thorugh mecticulously! After that I get DirectX Errors - constantly coming up and the texturing doesn't work anylonger, last textured image covers all limbs - (I suspect after the fated dbSetObjectTexture(ID,Img) coammd fails, all the limbs are showing the texture globally.)
Direct3D9: (ERROR) :Texture not created with this device. SetTexture failed.
Facts:
1: Images do exist
2: Images have unique ID's.
3: I don't recycle image id's.
4: Happens around the 255'th time.. Pecular computer number to goof.
5: I've verified the ID's Are generated properly... as they continue to go up.
Any ideas? I've been checking my code for hours... The Steps Are:
1:Remove All Images via dbDeleteImage(id) (I've tried setting object/limbs texture Id to zero, and without this attempt to "disconnect images from object)
2repare Memblocks with GFX data Compatible with dbMakeImageFromMemblock() command (One for each limb 0root thru limb3 in my test)
3:dbMakeImageFromMemBlock() (For Each Limb 0=root thru what ever. (One for each limb: 0root thru limb3 in my test)
4:dbTextureObject(id,imgid)...And dbTextureLimb(id,limb,img) In My test.. Object gets textured first, limb1, limb2, limb3
Note: Memblocks are used over and over, as I just put different data in em.
DarkBasic Help: (Notice the 65535 Cap... not 255.. I would Assume DarkGDK is same as DBPro here.
Quote: "SAVE IMAGE
This command will save an image to a file. You must specify an existing image number between 1 and 65535. The file must not already exist, otherwise the command will fail. The image file format is determined by the extension given, and can be one of 'BMP', 'DDS', 'JPG' and 'DIB'
"