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 / Can You Hide DarkGDK Window At Startup?

Author
Message
MLT Software
15
Years of Service
User Offline
Joined: 27th Apr 2009
Location:
Posted: 16th Jun 2009 06:46
I want to change window position, window title, display mode, and window size before the window appears. Is there a way to do this?

Right now my code works, but you can see the window jump and resize itself from how it opens up at first.

Thanks...
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 16th Jun 2009 13:10
You can, but the best way I know to do it, is to use WinAPI calls to set the window size etc before its created, then create it at the size etc that you need....

The header file "DarkGDK2.h" has 3 methods in it that can be used :



Personally i havent used them yet, but they are pretty self explanatory if you understand the winAPI.
The Advantage is that you have complete control over the program and its window through windows API, message pumps etc.. the Downside is that unless you are proficient in using the winAPI and C++ , its going to be a difficult task.

There are some tutorials however on using the Win32API with DarkGDK from before the above commands were added to DarkGDK. You can find them in these forums by searching "WinAPI tutorial".

If there is a simpler way of achieving what you want, I dont know it im sorry.

If it ain't broke.... DONT FIX IT !!!
MrEd
15
Years of Service
User Offline
Joined: 28th Apr 2009
Location:
Posted: 16th Jun 2009 20:29
I want change window properties too, and I can use these functions, but they didn't work. I get error:

Probably these function aren't implemented yet.
MLT Software
15
Years of Service
User Offline
Joined: 27th Apr 2009
Location:
Posted: 17th Jun 2009 02:00
Thanks, Mista Wilson. I appreciate your help.
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 17th Jun 2009 10:20
I remember IanM doing a tutorial on how to sue these - do a forum search.

Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 17th Jun 2009 11:18
Those functions are enabled, just get the latest update to darkGDK as they wont be in the original version.

I think 7.3 is the latest released, you can find it in the forums as a sticky

Also, I forgot to mention in my post above, but if you want to have a look at them working in a way that controls the windows completely(by actually not having a window at all lol) download the source code to the Nvidia Physx Screen Saver from the DarkGDK page at thegamecreators.com.

If you dont have a bunch of other software, aswell as darkphysics, you wont be able to compile that source, but its a very good example of how to interact with the windows API using those 3 new commands, to make it do what you want before your window is created.

If it ain't broke.... DONT FIX IT !!!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
MLT Software
15
Years of Service
User Offline
Joined: 27th Apr 2009
Location:
Posted: 17th Jun 2009 22:45
IanM, that is so cool!

Thanks!

By the way, I noticed that I can't just transfer the code from this project into my own VC++ project, it doesn't work when I do that. I am apparently going to have to transfer my code into a copy of the project from the thread you quoted.

Do you know if there's some particular project setting that's not standard in what was provided in the thread you quoted?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Jun 2009 00:08
Quote: "it doesn't work when I do that"

How does it not work?

Do you get the linker errors (you haven't excluded DarkSDK.lib), or a 640x480 window (you haven't include DarkGDK_Window.h).

You can drop the DarkGDK_Window.h into your GDK include folder alongside all the other GDK include files if you want, just for ease of use.

MLT Software
15
Years of Service
User Offline
Joined: 27th Apr 2009
Location:
Posted: 18th Jun 2009 05:04
Quote: "How does it not work?"


First off, the project you provided, with no changes, opens a window whose size is 320 x 240. If I open up a new game project (any of the 3 available new projects) and add the exact same code that's in the original project, I get a 640 x 480 window instead. But I have included DarkGDK_Window.h.

Then when I run my newly-created project, the window characteristics don't reflect how I've changed constants like DisplayWidth. In fact, DarkGDKStart and DarkGDKInit do not get called at all (I checked in the VC++ debugger).

It all works fine in the original project, though.
MLT Software
15
Years of Service
User Offline
Joined: 27th Apr 2009
Location:
Posted: 18th Jun 2009 06:14
I just created a new DarkGDK project. I copied-and-pasted the code from the project you provided into this new project. It opens in a window that's 640 x 480, even though I set other values for the window size:

DWORD DisplayWidth = 1024;
DWORD DisplayHeight = 768;

The DarkGDKStart and DarkGDKInit functions are never called.

The project is attached to this msg.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-10-01 03:20:54
Your offset time is: 2024-10-01 03:20:54