Game Development Community

Screen Resolution

by Shawn · in Torque Game Engine · 08/17/2001 (2:52 pm) · 11 replies

Having difficulty getting the game to render at a diff. res. I have changed the clientprefs.cs file at lines 24 and 135, also the source file main.cc:
Platform::initWindow(Point2I(1024, 768), "V12 Test App");

Are there any other places to change the rez.?

Thanks

#1
08/17/2001 (3:03 pm)
i simply changed the res in clientprefs.cs, didnt change any code at all..

Phil.
#2
08/17/2001 (3:27 pm)
This is the line correct ? Wonder what could be wrong then.
$pref::Video::profiledRenderer = "GeForce2 GTS/AGP/3DNOW!";
$pref::Video::profiledVendor = "NVIDIA Corporation";
$pref::Video::resolution = "1024 768 16";
#3
08/17/2001 (11:08 pm)
Shawn, that should be fine. Thats all I did to change the res. I also changed the resolution for the editor (a seperate line). Are you running full-screen?
#4
08/18/2001 (12:15 am)
I can switch from 800x600 to fullscreen no prob changing the script, no luck as of yet getting out of that mode in a window :(
#5
08/18/2001 (12:49 am)
You want to change the resolution while the game is running?


function changeres(%x,%y,%c)
{
if(canvas.getcontent().getname() !$= "PlayGui")
{
$pref::Video::resolution = %x SPC %y SPC %c;
setResolution(%x,%y,%c);
}
}
#6
08/18/2001 (3:26 pm)
Thanks Harold, this works great in fullscreen, does it work in window mode on your machine?
#7
08/18/2001 (3:34 pm)
Yes.

I'm running a GeForce256 32MB card on an Athalon 1.3
#8
09/23/2001 (4:42 am)
ok so there's the setResolution function for changin the resolution ingame, but how to change from fullscreen -> windowed and back ingame, is there also a function for that?
#9
09/23/2001 (4:49 am)
Ok i've found the reply myself, it's the setscreenmode(widht, height, bpp, fullscreen); function, for example if you want your window to run at 1024x768x16 in fullscreen you would type:
setscreenmode(1024,768,16,1);
and if you want is in 800x600x16 windowed you would type:
setscreenmode(800,600,16,0);
hope this has been helpfull for anybody, actually it's been for me :)
#10
09/23/2001 (5:51 am)
Hmmm ok I just added this to the default.bind.cs

//------------------------------------------------------------------------------
// Change screen resolution
//------------------------------------------------------------------------------

function fullscreen(%val)
{
if (%val)
setscreenmode(1024,768,32,1);
}

function windowed(%val)
{
if (%val)
setscreenmode(800,600,32,0);
}


moveMap.bind(keyboard, l, fullscreen);
moveMap.bind(keyboard, o, windowed);

-------------------------------------------------------

And it look like it was going to work but.....
When i go to fullscreen it gives me an error, something about the texture in the cache, and then closes down.

I remember someone had the same problem and found a way to fix it.

Anyone remember where and how? or just have another idea?

// Clocks out

[EDIT]
I just found the original post and the fix is getting into the next release.
http://www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=1159
[/EDIIT]
#11
09/23/2001 (3:39 pm)
edit - neverminnnddd :-)