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 / Using the DSDK to make classes, seperate from main source file.

Author
Message
Briere
19
Years of Service
User Offline
Joined: 28th Feb 2005
Location: Amherst New York, United States
Posted: 13th Jun 2006 01:27
How can I make functions with the DSDK in a class, and store them in header or cpp files and use them in other projects.

Example, I make a class and I make an object of it called Engine.
In the object Engine, there is a function called Stop.

So I want to keep all the coding for that in its own header or cpp file.

Then I start a new project, and I say HEY! I CAN SAVE TIME AND USE THIS CLASS!

I want to make a call like Engine.Stop();

instead of typing the 100 lines id have in there.

5/14/06- 1720 lines into my 3D game engine! Player Movement and File System completed. Working on weapon inventory and player classes.
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 13th Jun 2006 03:30
could you instance the sdk, do all of the necessary boilerplate coding then make a dll out of it?

then your other projects could just instance the dll as an object.

(im no c++ guy so I am not sure here)

Briere
19
Years of Service
User Offline
Joined: 28th Feb 2005
Location: Amherst New York, United States
Posted: 13th Jun 2006 03:48
Never mind, I can put everything in headers, just so long as the dsdk header is the 1st header included in the project

5/14/06- 1720 lines into my 3D game engine! Player Movement and File System completed. Working on weapon inventory and player classes.
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 13th Jun 2006 04:16 Edited at: 13th Jun 2006 04:19
Briere, download my Asteroids clone. Done with DGSDK. It was put together rapidly because of the nature of the project, but it contains classes and code that may help you to get something up very quickly.

Find more info at http://forum.thegamecreators.com/?m=forum_view&t=80262&b=5

[EDIT] If you do use the classes or code, some acknowledgement would be cool, like to see what you do with it etc

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
Briere
19
Years of Service
User Offline
Joined: 28th Feb 2005
Location: Amherst New York, United States
Posted: 14th Jun 2006 20:06
Will do.

5/14/06- 1720 lines into my 3D game engine! Player Movement and File System completed. Working on weapon inventory and player classes.

Login to post a reply

Server time is: 2024-05-25 22:48:59
Your offset time is: 2024-05-25 22:48:59