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.

DLL Talk / a few questions about how some of the DBP commands work

Author
Message
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 8th Aug 2008 20:19 Edited at: 8th Aug 2008 20:32
Starting to build what I think is going to be a relatively simple plugin, a re-write of my bitmap font engine... I want to have bitmap fonts referred to in the same way as objects, using a vector.



By using a nested vector I can just refer to an entire charset with a number, just like an object, but the thing is when I delete one all the others after it move back one slot to fill the gap. I'm thinking this would affect what variables refer to what fonts—let's say you have TimesNewRoman = 1 and Courier = 2, delete TimesNewRoman and now Courier points to an unavailable slot.

So how, in theory, do DBP object numbers work? why is it that when I delete one object, the other object numbers aren't affected? o.O




My second question is rather simple... Can I load the DBProFileDebug.dll library and do this:


Would that work or should I just learn how to open/read files with standard C++?


Remember those old guys? They made epic renders, I think one of them was called DaVinci, and all they used was MS Paint. Sometimes it's just skill....
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Aug 2008 20:51
Here are two alternatives for your ID problem - include an 'in-use' flag in your vector rather than delete the item from the vector, or use a map or hash_map/unordered_map with the ID as the lookup key.

File I/O in DBPro has a small fraction of the functionality and flexibility of I/O in C and C++ - I prefer to use the C file I/O myself

Login to post a reply

Server time is: 2024-04-23 11:43:34
Your offset time is: 2024-04-23 11:43:34