Forum Thread Not Found, Sorry.

Game Development Community

Two Windows When Launched?

by Seth Willits · in Torque Game Builder · 05/03/2008 (2:14 pm) · 21 replies

Hey guys,

When I build and then launch my game, there are two windows. One is full size and contains everything I expect, the second is smaller (800x600 it looks like) and is black.

Any ideas?
Page «Previous 1 2
#1
05/17/2008 (7:13 am)
That's weird. Have you messed with the initialization process at all?
#2
05/17/2008 (10:46 am)
No. The problem is caused by the asynchronous window fading. The default window when TGB starts up is 800x600 and fades in asynchronously. When the video mode changes to 1024x768, it tells that window asynchronously fade out (it's yet to actually fade in yet), and fades in the newly created 1024x768 window. It seems that the async fade out before the async fade in is done, is what's causing the window not be closed.

I tried removing the fading altogether, but for some silly reason, the standard ShowWindow() call to display the window simply is not working. I even checked that the alpha value of the window is opaque. Nothing. It's very weird.

I worked around it by having the windows asynchronously fade in, but instead of asynchronously fading out, just closing and releasing them immediately and that worked. Even synchronously fading didn't. It's really really strange stuff.
#3
06/06/2009 (5:24 pm)
I'm getting the same thing, but only when I build my project on Mac. I have a simple project originally authored on PC. It builds and runs as expected on PC, but when I build the project on my Mac (copy the project to the Mac and build/publish from the TGB menu), the resulting Mac build launches the game as expected PLUS a slightly larger black window behind.

The strange thing is, the black window only started showing up recently. I've gone through several work/build sessions before where the Mac build plays as expected (no extra black window).

Any help from GG would be appreciated.
#4
06/08/2009 (11:54 am)
It's a bug in Torque on the Mac side. Unfortunately, Mac bugs haven't been getting fixed.
#5
06/11/2009 (6:35 pm)
I have the same thing happening. I copy the project and associated files over to the Mac, and launch. An empty black window behind the active game window appears, which can be moved or closed independently.
#6
06/19/2009 (9:34 am)
An update on this topic:

I have been largely building on an XP PC. When I do a Mac build from the raw project (on the PC or the Mac), when launching I have been having the 2nd, black-filled window appear. The testing to date has been a Feb 2009 Intel-based MacBook (10.5.7).

This morning, I brought my build files along to work and built them on the Intel laptop again for a network test. Then, on a lark, I copied the built project over to my G5 iMac (10.4.11) and launched it. The second window does NOT appear on the G5/older OS version.
#7
06/19/2009 (10:19 am)
@Netwyrm:

I am using an Intel-based Mac for testing (not sure of the OS version, but it is fairly up to date). Interesting that the older OS version/hardware does not experience the bug.
#8
06/19/2009 (11:28 am)
I'm still getting email notifications about this, and I thought I'd finally reply since no one else seems to have come to any conclusion.

I investigated the issues mooooonths ago and found the problem in the Torque source. It has to do with the way the Mac platform code works for the video/window initialization process. As I recall, Torque initially creates *a* default window (which is 800x600), and then later the resolution of that window changes as needed. However, I believe some reference to the existing window wasn't properly set or checked or something similar, so the window's resolution change actually creates a second window.

It's a simple bug. Someone just needs to go in and fix it.
#9
08/05/2009 (1:03 am)
@seth, would you mind sharing some more details about the bit of code which contains this bug? Specifically, which files are related and perhaps function names or line numbers.

@any_gg_employee, do you guys even have a Mac in your office?
#10
08/05/2009 (1:26 pm)
As I said, it was mooonths ago (actually over a year ago), so I don't remember the line numbers. It's just in the Mac platform code. There's only a few relevant files. I thought one of the updates fixed it too.

If I get some time I'll look at it again. Maybe if I fix it, GG will give me a free update to T2D :p (Not bloody likely!)
#11
08/05/2009 (1:54 pm)
Yes, this bug appears only on Intel Macs from what I understand.

Any GG employees reading this??? Lately there seems to be more movement towards fixing bugs... any word on if this issue will be looked into and fixed?
#12
08/05/2009 (2:11 pm)
Hmm. I apparently fixed it in my code base because I only see one window on my Mac Pro.
#13
08/19/2009 (7:08 pm)
Seth,

Did you do anything special to fix this bug?

I'm still having this issue on an older project, but not on a new project. If you don't know what you did, I'll just start comparing code between my projects until I find the culprit. :)
#14
08/21/2009 (12:26 am)
I haven't used TGB in ages. As soon as I can remember how to change the window size in a project so that when the built game is launched, it opens with that given size, I'll be able to reproduce it.

I just downloaded 1.7.4 and created a new project. If I just run the current scene, two windows appear. If I build the project and launch the binary though, it's just one window which is really small. I'm looking through the tutorials again to remember how to do this, but if someone could just remind me, that'd be helpful :D
#15
08/21/2009 (12:37 am)
Ok, I found it.

MacCarbPlatState::MacCarbPlatState()
{
   hDisplay       = NULL;
   appWindow      = NULL;
   
   captureDisplay = true;
   fadeWindows    = false; // Seth Willits


Turning off fading is the simple way to avoid it. I never changed anything significantly enough to really *fix* it.
#16
08/21/2009 (5:44 pm)
That doesn't work for me. If I make fadeWindows false, I get *no windows*, at all, when switching from fullscreen to windowed mode. Both the extra black window *and* my main window go away. Bummer. Anyone else got any solutions?
#17
08/22/2009 (12:25 am)
Well that ain't right. You're using 1.7.4 I assume? I did this back in 1.7.2 and didn't double-check it in 1.7.4. Maybe something else changed, but from the diffs everything seemed unrelated.
#18
08/22/2009 (9:25 pm)
Yes, I'm using 1.7.4. I also have a change Melv May sent me that reduces the memory consumption by around 85%. I don't know if that would affect it... I doubt it though.
#19
09/24/2009 (7:34 am)
hey... i'm getting the wierd problem by executing the .exe file more than one time after build the game. How to stop them. i want to do that for the windows based systems
#20
09/24/2009 (8:11 am)
i.e.,:) more then one window playing the game
Page «Previous 1 2