Game Development Community

Resizing the window

by Neil Marshall · in Torque Game Engine · 05/30/2005 (10:33 am) · 11 replies

I've got my torque window resizing but the content is not resizing with it. Does anyone know how to force the picture to resize properly? All I found was an old link on the subject that was 404.

#1
05/30/2005 (10:49 am)
Hi Neil,

When you say your picture isn't resizing, do you mean the render of the 3d world, your GUI elements, or both? And how are you resizing your window?
#2
05/30/2005 (11:03 am)
Not the in game GUI. I'm resizing the windows window. The screen is locked at 800x600 so I see garbage around the sides.
#3
05/30/2005 (11:19 am)
Neil,

I'm not positive on this, but I believe that Torque is only setup to render the screen at certain resolutions (listed in your graphics options dialog drop down list). You may be able to have it dynamically resize but I would imagine it might be a bit processor intessive forcing Torque to refresh it's resolution while dragging your window size.

If you're dead set on doing this, take a look at the script used in the option dialog script file for when you hit Apply settings on the graphics page to change the resolution. Don't know if it will work but that's where I would look.

Hope this helps,

-justin'
#4
05/30/2005 (11:28 am)
I know ShowTool Pro does it, so I know it's possible (It blanks out when resizing but as soon as you stop it pops in)
#5
05/30/2005 (1:04 pm)
Neil, have a look at your GUI. There is a GUI control in which the game is rendered. That control might not be resized when you resize the window. Check the GUI editor before and after resizing the window, and see if you can find any differences. I'm not sure if I am correct here, but it could be possible this is what's going wrong.
#6
05/31/2005 (7:59 am)
I think it has more to do with the C++ code then scripting.
I can't seem to figure out what the resize "message" is.
#7
05/31/2005 (9:37 am)
Maybe you should post a pic of what your looking at to help, but I'll hazard a guess to see if this is what you are looking for....


%window.resize(	getWord($Pref_WindowPosition, 0),
			getWord($Pref_WindowPosition, 1),
			getWord($Pref_WindowExtent,   0),
			getWord($Pref_WindowExtent,   1)	);


If you resize a window control with the above command(need to supply your own variables), the children will resize with it.
#8
05/31/2005 (10:51 am)
But that's scripting code. I'm working in C++. Mainly what I'm looking for is which event fires when the hWnd resizes?

If you need a screenshot, here is what I'm talking about.
#9
10/29/2005 (7:00 am)
@Neil: Did you manage to find a solution for this? i'd appreciate it if you can share the solution.

Thanks
#10
10/29/2005 (7:32 am)
No, I still need the solution too.
#11
10/29/2005 (10:47 am)
@Neil
I'm not a native windows programer, however, from looking at things it looks like torque don't process any resize events in the way you would think. engine/platformWin32/winWindow.cc in WindowProc would seem like the most likely place it would deal with that type of system message.
Looking in there it handles the WM_MOVE, but nothing about resizing.

So you would probably want to catch the WM_RESIZE (or whatever the event is), and hand that off to the setScreenMode with repaint set to true. That should cause it to repaint with the new resoultion.