Dark GDK / Object Oriented GDK - WIP |
| Author | Message | ||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
If you are anything like me, you probably hate the way you create objects, camera, images, and other entities in DBP and GDK. The way you have to number things gets so frustrating. Well, I got the free version of GDK, and since it takes no advantage of C++'s OO features, I am working on something that does. Doesn't do alot so far, but you can make objects and manipulate them using OO. Here are some examples: GDK: + Code Snippet OO GDK: + Code Snippet GDK: + Code Snippet OOGDK: + Code Snippet You may not want to use it, since you are likely used to the DBP way of making things, and since this has no documentation yet, but if I get anywhere with it, I will write up some help stuff and release it. C&C please [edit] Version 1 Uploaded. I will create a simple demo to go with it later, in the meantime, fool about with it a bit yourself, the intellisense should help. If you want to see all available commands, press Ctrl+Atl+J to get to the Object Browser, find your project, open it up and look through all the classes. Simply include "OOGDK.h" to your project to get it working. [edit] Here's a demo to try. By the way, the crappy 3rd person camera is just GDK's way of doing it. Personally, I would do it different (so it would properly work), but hey, such is life. + Code Snippet "It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers |
||
| Back to top |
|||
|
kBessa
User Joined: Wed Nov 8th 2006 Location: Manaus, Amazonas, Brazil |
I think I've seen something like this somewhere... I just hoped all "Wanna make my own DarkGDK OO Wrapper" would join efforts and make a unified one. At least there's only one for DGDK.NET. Anyways, good work out there, but remember: coding will be fun! The problems it to write the Docs :-P Best regards, Thiago |
||
| Back to top |
|||
|
CattleRustler
Moderator ![]() ![]() Joined: Fri Aug 8th 2003 Location: case modding at overclock.net |
Quote: "I think I've seen something like this somewhere"
lol, yeahwerent there also 2 version for c++, one by IanM and one by someone else I cant remember atm...? My DBP plugins page is now hosted here |
||
| Back to top |
|||
|
kBessa
User Joined: Wed Nov 8th 2006 Location: Manaus, Amazonas, Brazil |
I know RPDan is trying to make a 1:1 version of LightEngine for C++ (using Managed C++) |
||
| Back to top |
|||
|
n008
User Joined: Wed Apr 18th 2007 Location: Gazala 1943 |
Quote: "got the free version of GDK, and since it takes no advantage of C++'s OO features"
What in the hell?! Whew, i'm glad i decided to wait for GDK.NET! It was my only reason for switching in the first place! ![]() |
||
| Back to top |
|||
|
Niels Henriksen
User Joined: Mon Sep 27th 2004 Location: Behind you breathing heavely |
Quote: "I know RPDan is trying to make a 1:1 version of LightEngine for C++ (using Managed C++) "
So a project in LightEngine.NET will actually could be moved to LightEngine++ ?Niels Henriksen Working on a (MMO)RPG right now in LightEngine http://noggs.netopcom.dk/forum/default.asp - Forum for the game |
||
| Back to top |
|||
|
kBessa
User Joined: Wed Nov 8th 2006 Location: Manaus, Amazonas, Brazil |
I cannot confirm this for sure, as RPDan is doing it on its own. I actually am planning on translating LightEngine to C++ myself, but that would not happen (or even be started) in the next couple of months. |
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Hi all. So far I have made OO implementations for Objects (Cubes, Spheres, Cylinders, Cones, Planes [not plains], and Loaded objecs), Cameras, and Images. All work in practically the exact same way as the examples I gave. I have also added alot of extra features to the two vectors classes that are needed throughout. Both vectors allow you to set and retrieve components, get vector angles, dot products, lengths, addition, subtraction, multiplication, division, etc. 3D Vectors have extra features, such as setting the vector to the normals of an angle, which is useful for things such as 3rd person cameras, etc. I will soon start working on sounds, music, etc "It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers |
||
| Back to top |
|||
|
RPDan
User Joined: Sun Apr 29th 2007 Location: Cyberspace |
Are you using managed or unmanaged c++? |
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Unmanaged "It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers |
||
| Back to top |
|||
|
Miguel Melo
User ![]() Joined: Mon Aug 8th 2005 Location: Lisbon, Portugal |
Quote: "Unmanaged"
I'll keep an eye on your project Zotoaster, then. So far I only ever used unmanaged gdk. I have vague plans for World Domination ![]() |
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Good stuff. Just finished adding sound and music capabilities. Now to sprites, matrices, terrains, all that misc stuff. "It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers |
||
| Back to top |
|||
|
Google Ad
AdBot Joined: Aug 26th 2002 Location: Everywhere |
|||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Ok, got all the possible object commands in OOP form, expect for animation commands, which I can do later. There's nothing for limbs or meshes or anything, because most of them have nothing to do with the actual object. The beauty of it all is that if there's something missing in this wrapper you can always use the actual dgdk functions Okay, now, to work on cameras, images, etc. Oh god "It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers |
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Sorry for the triple post. Just wanted to bump this and say that I've uploaded the first version in the top thread. Please read the information at the bottom for how to use it. [edit] Uploaded a demo to try on top thread. "It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers |
||
| Back to top |
|||
|
General Reed
User Joined: Fri Feb 24th 2006 Location: Cyberspace |
hmm interesting I have AMD Athlon X2 5200+, Geforce 7600GS, 2GB Ram, 240GB HDD and one hell of a headache |
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Well, I'm putting this to the test and trying it out to see how practical it is, and I'm using it for my project that I have to do in computing class, and I have to say, it works really well. I havent found many commands yet that I havent implemented, but then again, it's a 2D game. I suggest some people please try it out and report back any bugs or errors, or any missing commands. It would help me out alot. Cheers "It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers |
||
| Back to top |
|||
|
Coding Fodder
User Joined: Thu Sep 25th 2003 Location: Somewhere in my cerebralcortex |
I just installed GDK. Pretty annoying how all the DB AND directX commands get dumped on the global namespace. Something really catchy that makes people stop and think about the meaning of life and say to themselves "My but thats clever" |
||
| Back to top |
|||
|
Bishop
User ![]() Joined: Wed Dec 18th 2002 Location: In my favorite chair... |
Quote: "What in the hell?! Whew, i'm glad i decided to wait for GDK.NET! It was my only reason for switching in the first place!"
You still get a significant performance boost by switching =P Looking forward to this! Would be very nice to have this wrapper...I remember a while back someone was making an OO wrapper for DarkBASIC professional, that was kinda cool, but this will make the GDK complete! Cheers! |
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Quote: "Pretty annoying how all the DB AND directX commands get dumped on the global namespace."
That's one of the main advantages of this. What I love about VS is it's IntelliSense, it's very useful, but GDK doesn't take any advantage of this, so you have to know all the commands anyway. Instead of sticking "db" before every function, it would be alot better if there was a db namespace, and then you can browse all the commands, but, that doesn't seem to be the case. With this wrapper, you just have to remember the names of a few classes (and even if you dont, there are namespaces that you can browse with IntelliSense), then you can browse all the methods of those classes. The names pretty much correspond with the actual DGDK ones, except for some (i.e. SetGhost( bool ); ), but on the whole, it's pretty easy to understand what they all mean. Also, all the commands you browse are made for that current class. If there was a db namespace, you would have to browse every command that DGDK offers. On another, slightly theoretical note, if you have run out of ideas of how to make your objects look good, you dont have to remember all the appearance commands. Just loop through all the commands using IntelliSense, and say to yourself, "Hey, I forgot that command, let's plug it in", heheh. Bishop: Yeah, but it didn't get finished. There's another one on it's way I believe, but they were both just precompilers. You would have to compile twice for it to work (not that there's any better way of doing it). C++ has classes nativelly, so it's a huge advantage. "It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers |
||
| Back to top |
|||
|
Benny53
User Joined: Sun Dec 25th 2005 Location: Ohio |
This looks pretty good. I'm making an oop thing, but its not going to be released unless its part of my fps engine WC Physics - PhysX wrapper for Dark GDK. |
||
| Back to top |
|||
|
Deagle
User ![]() Joined: Sun Aug 28th 2005 Location: Finland |
Oh man, i love this! Thank you edit: the dbObjectScreenX and dbObjectScreenY haven't been converted yet? Deagle aka D-Eagle |
||
| Back to top |
|||
|
jason p sage
User Joined: Sun Jun 10th 2007 Location: Ellington, CT USA |
Yeah - I think many of us have our reasons for ooping GDK ourselves - while others find the already made stuff ideal - or leading efforts to get coders to unite. I personally think unmanaged is better - plus its truly compiled - not at runtime - which I just think is stupid - and sadly that's the architecture .net is built on. More speed period using C++. More work too - like having to clean up everything yourself - where in .net - most objects get "disposed" when they go out of scope - or at least are flagged as "ready to be freed/deleted from ram" - so the garbage collector can get to it whenever it wants or you force it. My reasons for doing my own wrapper are: 1: I know every nook and cranny - helps me when its time to optimize, track errors, etc. 2: Tailored for my own purposes - I have my own coding style - thats a mixture of commerical business style code, assembly lean mean fighting fast tricks, and because I wrote it myself - all the things I look for ARE considered - and if not - I write them. Note - like Benny - I too make some functions one call - in place of using two or more variaties of DarkGDK call. Another thing I do is to make my classes such that I can use the classes and the raw GDK commands at will - with minor "rules" or considerations to keep things purring - this way I can have both OOP "organization" and "Ojects" etc while still having the ability to utilize the MUCH FASTER "non-oop" calls directly. Remember - the more fluff you add to make programming easier - USUALLY translates into more code the CPU needs to crunch. Easier to code CAN have consequences in speed etc. |
||
| Back to top |
|||
|
Deagle
User ![]() Joined: Sun Aug 28th 2005 Location: Finland |
Found a bug; dbPickObject does not work if you use OO cameras. Deagle aka D-Eagle |
||
| Back to top |
|||
|
Slow Target
User Joined: Thu Jan 10th 2008 Location: Cyberspace |
Zotoaster, This is cool. In another post I compained that some of the commands were not consisant. For example, you can position a camera with a vector or x,y,&z, but not an object. You've fixed it! |
||
| Back to top |
|||
Sorry, but it has been so long since anyone replied to this Thread that it has been automatically locked.
You may read it but not reply.
You may read it but not reply.
Forum Search
Enter a word or phrase to search our Forum for:
|
|












