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 / 3d engine

Author
Message
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 13th Mar 2009 09:24 Edited at: 13th Mar 2009 09:45
hi im making a 3d engine with DarkGDK(am i allowed to do this??) and i want to make an object loader that loads objects in the *.x format, how would i make it so it could return an object so i cound do something like this:


any help would be appreciated
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 13th Mar 2009 10:15
By making a class called Object or something and having your loadObject() function return an address of an instance of this class, the class would then store the GDK object ID and other attributes. But ideally you'd have methods inside the class to handle things like positioning as your suggested method would potentially lead to a lot of wasted lines.

tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 14th Mar 2009 04:33
how so?
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 14th Mar 2009 18:32
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 14th Mar 2009 18:47 Edited at: 14th Mar 2009 18:52
Here's what a VERY simple object class might be:



Then you have your 'frantic' namespace which might look like this:



Then you can do this:



That's just a simple example--it won't compile, it's just to show you one option.

EDIT:

I can't tell, is frantic a namespace or is loadObject() a static member of the class frantic?

tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 17th Mar 2009 09:51
Thanks alot! this got me started really well
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 17th Mar 2009 10:26 Edited at: 17th Mar 2009 10:26

Login to post a reply

Server time is: 2024-11-25 17:38:40
Your offset time is: 2024-11-25 17:38:40