Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Limited number of Times you can Texture Object? Or How Many Images Limit?

Author
Message
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 31st Dec 2007 05:13 Edited at: 31st Dec 2007 06:28
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'
"


Attachments

Login to view attachments
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 31st Dec 2007 09:11
Thank You - Resolved - kinda - just made a demo to see if this was a bug:



And it wasn't - so I just trimmed out my code - did a rewrite - elimiated a bunch of function calls - basically functions I know that work - but - hey - simplified - went all NATIVE DarkGDK in the troublesome routine - and now it works I'm happy.

Pharoseer
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: Right behind you
Posted: 31st Dec 2007 09:42
Hey Jason,

Sorry I didn't notice this thread sooner. Seeing what you can accomplish I prefer to see you moving forward, not getting stuck and having to muck around with defects. Glad you got it resolved though!

So, did you ever figure out where the bug was? Or have you just forgotten it even existed now that you have working code?

-Frank
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 31st Dec 2007 10:02
It was strange - I would step through the code and even when it was "Messing up" EVERY VALUE was dead on correct - stepping through - examining everything - was PERFECT. I was SURE it was a bug in DarkGDK.

So - I made a simple test app - posted above - ...hmm.... No Bug.

After enough time with the code and this proof that it SHOULD WORK... ...To answer your question - NO I never found it... it was one of those.... DELETE DELETE DELETE - Rewrite differently - period. It works - Onward March!

Thanx for popping in!

Attachments

Login to view attachments
Pharoseer
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: Right behind you
Posted: 1st Jan 2008 04:06
No problem! I get excited every time I see your progress. It makes me feel like a slacker though. I'm not making near as much progress with my own terrain engine.

Keep up the good work!
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 1st Jan 2008 04:52

Login to post a reply

Server time is: 2024-11-19 23:09:58
Your offset time is: 2024-11-19 23:09:58