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 / Control over your initial GDK window setup

Author
Message
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 31st Jan 2009 22:40
I've worked out (with a little assistance from Mike Johnson) how you can create a GDK application with the window setup that you want - and it's all fairly simple.

I have a header file that I've doctored - it simply brings together all the stuff in the DarkGDK.h, DarkSDK.h & DarkGDK2.h files and has one line amended to ensure that the correct library is used.

All you need to do is to include this header file (DarkGDK_Window.h) instead of the DarkGDK.h file, provide 3 simple functions, add the darkgdk.lib to the list of libraries to exclude ... and that's all.
(Note: If you miss any of these steps, you'll either get linker errors, or a standard 640x480 window).

I've attached a working example that includes the header file (you can make it globally available by dropping it into your GDK include folder if you wish).

Just play around with the settings at the top of the code.

Attachments

Login to view attachments
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 1st Feb 2009 22:48
Thanks. This will make a lot of people happy and appreciative.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 2nd Feb 2009 01:33 Edited at: 2nd Feb 2009 10:35
If we were to change from within "DarkGDK_Window.h"
To:


Am I correct in assuming that we would now be able to use the latest DirectX SDK?
Naturally we would not be able to use DarkGDK inbuilt networking functions.

EDIT: NOPE it does not work.
Even commenting out all instances of
#pragma comment ( lib, "multiplayer.lib"
and all instances of
#include "DarkSDKMultiplayer.h"
is still not enough.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Feb 2009 14:10
Firstly, the DirectX libraries are threaded thoughout all of the GDK headers, so you can't exclude a version by excluding a single lib - you'd need to exclude all, which would remove GDK from your app.

Secondly, the GDK relies on a single particular version of DirectX - using a later version, even if you managed to do it somehow, would break the GDK.

There is no way that I'm aware of for you to do what you are trying to do.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 2nd Feb 2009 15:40
this is very helpful as it was always annoying to get the standard gdk window size and then have to resize it etc. thanks a lot.
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 3rd Feb 2009 17:37
Does this mean we can get command line arguments sent to the program?
as dbCl doesnt work

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Feb 2009 18:41
This things I've posted here doesn't affect that, but you don't need to use dbCl() to get the command line - use the Windows API call, which is appropriately enough called GetCommandLine()

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Kilrath
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Alberta
Posted: 6th Feb 2009 15:39
Didnt think it was that hard to work with the window the GDK way...

Seemed pretty straight forward. This gave me a 1024x768 full screen window that covers over everything including the start bar without actually going full screen and having things crash out on ALT+TAB...



As i said maybe i got the wrong idea from this post but changing all that to knock 4 lines of code off the front of your app seems wierd.

Saving the world, one bit at a time.... Wait it's not worth saving. Get your own bits!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Feb 2009 18:17
Some people didn't like the fact that you get a 640x480 window popping up, then it resizes to full-screen or hides or whatever.

Using this method allows you to get the right window in the first place and avoid that.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 6th Feb 2009 19:53
the 640x480 window was really ugly! this new code rocks! thanks again!

Login to post a reply

Server time is: 2024-11-25 13:42:03
Your offset time is: 2024-11-25 13:42:03