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.

AppGameKit Classic Chat / T2 changing resolution

Author
Message
The Zoq2
15
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 2nd Dec 2012 13:43
Hi, i have started playing around with AppGameKit tier 2, but I have run into a problem, I have no idea about how to change the resolution of the app window. I have tried looking around in the code for the solution, but so far I have had no luck. In T1 it's done in the setup.agc file but im guessing that's not the way to do it in T2.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 2nd Dec 2012 17:31
For starters, look in the Core.cpp file. Near the top are two lines like this:


Change the values to reflect the size you want in Windows.

Assuming you are using virtual resolution and not percentage, remember to use the agk::SetVirtualResolution command in the app::Begin method (or in some function/method called within app::Begin).

Cheers,
Ancient Lady
AGK Community Tester
The Zoq2
15
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 2nd Dec 2012 17:57
Ohh so that's where that variable is, I wonder why VS didn't find it when I searched for "witdht". Thanks for the help.

Also, is there a way to get the app running in fullscreen mode and adapt to the resolution like T1 does if you use percentatge resolution.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 2nd Dec 2012 18:16
You can use percentage if you want. I don't and don't know the things people do to adapt to different environments.

Having said that, every command you see in Tier 1 exists in Tier 2. So, whatever commands you use to do your percentage system in Tier 1 should work.

In order to make your Tier 2 app appear in full screen as a default, you need to change 'false' to true' in this call in the _tWinMain function in Core.cpp:


This will cause the app to be full screen, but it won't have the header bar thing (with title, minimize, maximize, exit buttons) or any border.

And, it won't really know the actual resolution available on whatever Windows box it is running on. It will open full screen, but use the 'resolution' defined by the two DEVICE_<x> variables. It will expand everything to fit that size.

Even Tier 1 does not really know the resolution available in Windows. It uses the values in the setup.agc file.

On other platforms, like iOS and Android, it will try to get the actual resolution of the device. On the Mac, it works similar to on Windows, you set the resolution in the CoreForApp.h file.

Cheers,
Ancient Lady
AGK Community Tester
The Zoq2
15
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 2nd Dec 2012 18:31 Edited at: 2nd Dec 2012 18:32
That seems to have solved it, thanks

Quote: "Even Tier 1 does not really know the resolution available in Windows. It uses the values in the setup.agc file."


For me atleast, if I set my app to fullscreen, it adapts to the current screen resolution, no matter what the width and height is set to... Edit: The same thing seems to happen in T2...

Login to post a reply

Server time is: 2024-11-24 03:58:35
Your offset time is: 2024-11-24 03:58:35