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 / Object Oriented GDK - WIP

Author
Message
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 20th Nov 2007 20:49 Edited at: 22nd Nov 2007 16:51
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:


OO GDK:



GDK:


OOGDK:



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.



"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

Attachments

Login to view attachments
kBessa
17
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 21st Nov 2007 01:02
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
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 21st Nov 2007 01:05
Quote: "I think I've seen something like this somewhere"

lol, yeah

werent 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 [href]here[/href]
kBessa
17
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 21st Nov 2007 01:11
I know RPDan is trying to make a 1:1 version of LightEngine for C++ (using Managed C++)
n008
17
Years of Service
User Offline
Joined: 18th Apr 2007
Location: Chernarus
Posted: 21st Nov 2007 01:27
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!

Niels Henriksen
19
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 21st Nov 2007 13:58
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
kBessa
17
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 21st Nov 2007 14:29
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.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 21st Nov 2007 20:21
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
RPDan
16
Years of Service
User Offline
Joined: 29th Apr 2007
Location:
Posted: 21st Nov 2007 20:47
Are you using managed or unmanaged c++?
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 21st Nov 2007 20:58
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
Miguel Melo
18
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 21st Nov 2007 23:12
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
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 21st Nov 2007 23:24
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
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 22nd Nov 2007 15:09
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 There are currently 96 object methods you can use, that should be good for now.

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
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 22nd Nov 2007 16:42 Edited at: 22nd Nov 2007 16:51
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
General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 22nd Nov 2007 18:56
hmm interesting

I have AMD Athlon X2 5200+, Geforce 7600GS, 2GB Ram, 240GB HDD and one hell of a headache
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 1st Dec 2007 15:32
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
Coding Fodder
20
Years of Service
User Offline
Joined: 25th Sep 2003
Location: Somewhere in my cerebralcortex
Posted: 6th Dec 2007 03:34
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"
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 6th Dec 2007 10:02
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!


Tux is my guildmaster.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 6th Dec 2007 15:02
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
Xarshi
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 6th Dec 2007 23:05
This looks pretty good. I'm making an oop thing, but its not going to be released unless its part of my fps engine . I'm just developing it for my own needs. Seems extremely similar. haha, oh yeah, good job for making the stuff like ghost on and ghost off in one command like setGhost. I was thinking I was the only one to think of that .

WC Physics - PhysX wrapper for Dark GDK.
Deagle
18
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Finland
Posted: 7th Dec 2007 08:42 Edited at: 7th Dec 2007 12:57
Oh man, i love this! Thank you

edit: the dbObjectScreenX and dbObjectScreenY haven't been converted yet?

Deagle aka D-Eagle
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 7th Dec 2007 19:08
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.

Deagle
18
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Finland
Posted: 12th Dec 2007 16:03
Found a bug; dbPickObject does not work if you use OO cameras.

Deagle aka D-Eagle
Slow Target
16
Years of Service
User Offline
Joined: 10th Jan 2008
Location:
Posted: 27th Jan 2008 21:55
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!

Login to post a reply

Server time is: 2024-04-25 18:19:20
Your offset time is: 2024-04-25 18:19:20