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 / Program initializing problem

Author
Message
JDforce
19
Years of Service
User Offline
Joined: 27th Jul 2004
Location: Sea of Tranquility
Posted: 8th Jan 2007 19:09 Edited at: 8th Jan 2007 19:11
Am having a little trouble with the startup of a program am doing in GDK (win32).
I would like that the program just pops up with the window sized and configured as I am placing it in the first lines of code, it is, using the current screen size(1024x768 or 800x600), with no borders or title bar, no caption and with certain location in screen, top and left defined by code.
Instead, the program first opens a black window, about 640x480, with title bar, no caption with borders. After a few instants, the program seems to read and accept my settings and follows them correctly.
Problem is, for the final user those window poppings are annoying and confusing, and the program doesn't look professional. Of course am going to place a splash screen, but it seems that everytime darkGdk() is run, the problem appears again.
Is there a workaround or some way of preconfiguring the "first run"?

May the 3d force B with U
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 8th Jan 2007 19:17
is there a way to hide the window until some later point in the code?

Niels Henriksen
19
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 8th Jan 2007 19:48
JDforce

Doubleclick "My Project" in Solution Explorer and choose the tab "Application". In Application Type your program is in "Console Application". Set that to "Windows Application"

--
Niels Henriksen
Working on a RPG right now
James Bondo
17
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 8th Jan 2007 22:39 Edited at: 8th Jan 2007 22:39
I dont think thats what he meant.

The problem is if you have something like this code (pseudo):


First the game windows opens a small window, after half a second it changes the resolution and then goes to fullscreen. It makes the application flicker and look unprofessional.

Tho as far as i know, theres no way to make it not do that except if Paul changes how the InitializeDGDK method works or makes it (alot) faster or something.
Im thinking that the initialize method doesnt show the window at all until you use ShowWindow() or similar... that would be kinky

Proud member of The Unforgiven Warriors
http://www.tuwguild.com
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 9th Jan 2007 00:07
James is correct in what he has said, the initial window size creation and display is out of my control. I have actually brought this issue up with Mike, and asked if there is a way to control the initial creation and display of the window.

I'm sorry about this, but the problem is also the same with WinForms applications as well.

Paul.

CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Jan 2007 03:45
I am not convinced that this thread is specific to DGDK.NET since he said DGK (w32). I know overall the issue will be the same across both platforms (lib vs .net) but everyone so far answered from a dgdk.net perspective which further makes me believe that we definitely DO need a sep dgdk.net forum. Miguel's point was valid in that other thread regarding the issue, but the avoidance of confusion outweighs the cross-compatibility info issue. And lets face it, it would be separated only by a click or two to see our constituents in the c++/lib zone. Plus apex swings both ways from what I hear, don't ya, big fella, don't ya?

APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 9th Jan 2007 09:17 Edited at: 9th Jan 2007 09:19
Cattle, that's partly my fault for reading the code from James's post.

[EDIT] Both ways eh!! Why you.... <reaches for the Louisiana Slugger!!> ( j.k )

Paul.

CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Jan 2007 15:01
lol, thats "Louisville"

JDforce
19
Years of Service
User Offline
Joined: 27th Jul 2004
Location: Sea of Tranquility
Posted: 9th Jan 2007 21:46
Yes, my version is unmanaged win32, not .NET, and am compiling with C++ not C#.

I didn't find an option for reconfiguring the project from console to Windows form app in visual c++ 2005 express, and so I downloaded the trial for the full version. There was no option there either, and not a template for that purpose.

The templates for making windowed applications just do the work of creating a window and refering to form-code pairs, just as delphi or c#.

I think the problem lies inside the initialization of the routines in the DarkGDK(), and something has to be corrected there, which is unreachable for us, unless some expert at TGC have a trick. The DarkGDK() encapsulated function is an excellent piece of isolation and productivity, because it is extremely simple for making games, and also have the power of C++, but this hidden routines can also prevent us developers to correct a simple thing due to the isolation obtained.
Am going to try a test sample with a splash screen that disimulate the aforementioned problem and post my opinion and result.

May the 3d force B with U
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Jan 2007 22:27
I suspected you were using lib c++


JDforce
19
Years of Service
User Offline
Joined: 27th Jul 2004
Location: Sea of Tranquility
Posted: 10th Jan 2007 04:49
Actually I purchased it by mistake, since I wanted the NET version, but in the middle of the night my vision was kind of blurred. Seriously. So I had to give it a test.

May the 3d force B with U
Niels Henriksen
19
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 10th Jan 2007 10:22
JDforce - I contacted TGC when I bought the wrong version and they gave me the NET version as my plan was. Maybe you can try ??

Anyway I think that both versions should be together in a bundle

--
Niels Henriksen
Working on a RPG right now
JDforce
19
Years of Service
User Offline
Joined: 27th Jul 2004
Location: Sea of Tranquility
Posted: 10th Jan 2007 14:47
Thanks Niels. Considering the situation, I already contacted TGC asking if there is some discount for both versions.

And, does the problem happen with .NET version?

May the 3d force B with U
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 10th Jan 2007 14:58
yes

APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 10th Jan 2007 15:51
The .NET version is practically identical in every functional way to the C++ DGDK version.

Paul.

Miguel Melo
18
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 10th Jan 2007 22:10
Quote: "Thanks Niels. Considering the situation, I already contacted TGC asking if there is some discount for both versions.
"


Rick Vanner told me in December that one such discount was going to be put into place, which is very cool. I was hopeful it would have appeared on Newsletter 48 but, unfortunately, that was not the case.

I have vague plans for World Domination
JDforce
19
Years of Service
User Offline
Joined: 27th Jul 2004
Location: Sea of Tranquility
Posted: 13th Jan 2007 17:28
Well, I just tested with .NET version and the problem remains the same, both in winForms and console versions.

The engine seems to create and show a default HWND which is needed to show the directX surface and handle windows messages. The problem is that GDK is assuming a default and creating it, instead of having a routine (or it is there somewhere?) that initializes the engine BEFORE creating the HWND. In DarkBasic Pro, there is the project display options and the initial state follows that rule.

By the way, with a windows analyser I discovered that the "class" name for all darkBasicPro running programs is "12345", and the same for GDK win32. As long as I can tell, it can not be changed by us. GDK.NET has another, similar awkward class name I can not recall. If a developer read this, please, in the next update try to change the class names to "TGCGame", "GameClass", "DBPGame", or similar, because "12345" sounds like first project test at college.

May the 3d force B with U

Login to post a reply

Server time is: 2024-06-26 09:42:11
Your offset time is: 2024-06-26 09:42:11