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 / [NOT A BUG!] SetWindowSize, GetDeviceHeight, GetDeviceWidth

Author
Message
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 28th Jan 2017 19:48
In version 2017.01.09, when you set the size of the window via SetWindowSize (windowed mode), it never creates it in that size. And somehow GetDeviceSize and GetDeviceHeight don't report back the desktop size but something related to the window.
Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200. Using AGK2 Tier 1.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th Jan 2017 16:38
Quote: "when you set the size of the window via SetWindowSize (windowed mode), it never creates it in that size."

Works here on Windows

Quote: "somehow GetDeviceSize and GetDeviceHeight don't report back the desktop size but something related to the window."

That is as expected. The commands for the desktop size are GetMaxDeviceWidth and GetMaxDeviceHeight
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 31st Jan 2017 11:46
Ok, I will add a screenshot tonight so you can see about SetWindowSize.
Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200. Using AGK2 Tier 1.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 31st Jan 2017 12:09 Edited at: 31st Jan 2017 12:15
I'm with Mike on this one.
Surely this code should create a window that fills the desktop:


But as you can see from the screenshot - it doesn't.

This code produces exactly the same results:


But when I print the device sizes I get:
GetDeviceWidth: 1180
GetMaxDeviceWidth: 1280
GetDeviceHeight: 944
GetMaxDeviceHeight: 1024
AGK V2 user - Tier 1 (mostly)

Attachments

Login to view attachments
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 31st Jan 2017 13:27
btw,
for windows you also need the desktop visible coordinates, left,top,with,height because the task bar can resized or moved.
AGK (Steam) V2017.01.09 : Windows 10 Pro 64 Bit : AMD (16.12.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 31st Jan 2017 15:37
You can use the full screen parameter to get a window that fills the entire screen, or users can maximize the window to fill the desktop. What would be the use case for a window that fills the entire screen but isn't full screen?
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 31st Jan 2017 15:41
Tool creation using AGK.
You would expect the window to fill the screen but would still want window borders and title bar.
AGK V2 user - Tier 1 (mostly)
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 31st Jan 2017 16:15
If I tell it to be 1920 wide, it should cover my screen from left to right. But it doesn't.
And try out different heights, you will be surprised.
Is that behaviour by design?
Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200. Using AGK2 Tier 1.
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 31st Jan 2017 19:55
With this code



I get the picture and window in the attachment.
Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200. Using AGK2 Tier 1.

Attachments

Login to view attachments
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 31st Jan 2017 21:25
It's currently like that to avoid the window going over the taskbar, for example I have my taskbar on the right. Would a MaximizeWindow() command work in this case?
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 1st Feb 2017 08:34 Edited at: 1st Feb 2017 08:34
Quote: "Would a MaximizeWindow() command work in this case?"

Partially.

For me (I think I'm reading from the same page as Mike) I would like to be able to create a window that fills the screen with a title bar and window borders and create the AppGameKit 'canvas' to the size of the drawable area of that window so that there are no mipmapping issues.
Adding a MaximizeWindow() command would go some way to achieve that but would create mipmapping issues because the AppGameKit window would be slightly reduced by the title bar and borders.

I think the best solution would be three new commands:
GetMaxWindowWidth() - Reports the maximum width of the drawable area inside a maximized window on the current display.
GetMaxWindowHeight() - Reports the maximum height of the drawable area inside a maximized window on the current display.

Then we could say:
SetVirtualResolution(GetMaxWindowWidth(), GetMaxWindowHeight())

MaximizeWindow()
AGK V2 user - Tier 1 (mostly)
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 1st Feb 2017 10:48 Edited at: 1st Feb 2017 10:48
Paul Johnston wrote: "Would a MaximizeWindow() command work in this case?"


Not really, for an example, if I want it to be 1920x900. Still can't do that. This problem I have is not about a full sized window.
Once you come close to one edge or the other, AGK2 is like "no no, that isn't good for your app, you should use that size. Baahmm, here you go!"

Quote: "It's currently like that to avoid the window going over the taskbar"


So I take it, it is by design. To bad, I am using AGK2 only for desktop. I wasn't aware of this feature.

So I suggest to add this information to the documentation as it will confuse more people once they try it!
Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200. Using AGK2 Tier 1.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 1st Feb 2017 10:55
I think if you go with my suggestion and include the taskbar size as well, taking into account where the task bar is (not everyone has it on the right!) then it would solve my issue, Mike's issue and any future issues where people want a fullscreen but still windowed app.
AGK V2 user - Tier 1 (mostly)
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 1st Feb 2017 15:06
Quote: "Then we could say:
SetVirtualResolution(GetMaxWindowWidth(), GetMaxWindowHeight())
MaximizeWindow()"

The GetDeviceWidth and GetDeviceHeight commands could still be used with a maximized window, they would only return the area drawable by AppGameKit, for example this would work for a 1:1 pixel relationship


Quote: "Not really, for an example, if I want it to be 1920x900. Still can't do that. This problem I have is not about a full sized window. "

But wouldn't that risk part of the window becoming invisible if it moves off the edge of the screen or under the taskbar (if for example someone has a 1920 width display with the taskbar on the left or right)? My view is that AppGameKit should ensure that code written for one configuration should continue to work reasonably well on other configurations. However I guess there is no great harm in the window going out of bounds if that is what you want it to do. I'll consider adding an extra parameter to the command that will ignore the bounds checks.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 1st Feb 2017 15:26
Quote: "The GetDeviceWidth and GetDeviceHeight commands could still be used with a maximized window"

In that case a MaximizeWindow() command definitely gets my vote
AGK V2 user - Tier 1 (mostly)
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 1st Feb 2017 17:13
Paul Johnson wrote: " I'll consider adding an extra parameter to the command that will ignore the bounds checks."


Don't put extra effort into this. If the current functionality is by design, which you have explained resonably well, then so it be.
I am sure you will have enough work on your hands. And I always say, use the tool for a job which fits it the best. I have other tools to achive what I want.

Anyway, thanks for listening and explaining why AGK2 behaves like that. After all, it isn't a bug now.
Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200. Using AGK2 Tier 1.

Login to post a reply

Server time is: 2024-11-24 20:50:01
Your offset time is: 2024-11-24 20:50:01