I agree fully to what you said.mp303 wrote: This is a general problem in PB, and one that you won't have in 90% of all other programming languages - it comes from being forced to choose your handles manually.
Imagine if commands like CreateEntity, CreateLight and CreateWhatever would RETURN a handle, instead of requiring you to CHOOSE one - this is how it works in virtually every other programming language. Now you would simply do this:
hMyCamera = CreateCamera(...)
hMyEntity = CreateEntity(...)
now your camera handle and your entity handles could be 1 and 2, or 123 and 456 - it would no longer matter what numeric values your handles have, and this is the way it SHOULD be, because:
THE NUMBERS YOU CHOOSE HAVE NO MEANING.
That's right - making you choose your handles manually simply doesn't make any sense, because the numbers don't MEAN anything - they don't carry ANY information whatsoever.
Apart from that, having to choose your own handles creates major problems for developers trying to work together on larger projects....
PS: I apologize for this slightly off-topic reply, I didn't realize I would get this far off![]()
Fred said once he would create a #PB_Any constant to get some commands (like Gadgets, Memory etc.) to return the Number instead the OS-Handle, but he didn't say when this will happen.
At least for Gadgets there is a solution NOW!
Look at:
viewtopic.php?t=6969
This library is maybe not that important for game programmer, but the same technique could surely be used for all other objects, Memory, Files, Cameras etc.