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 / Graphics don't appear on the very left screenside in Windows Fullscreen Mode

Author
Message
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 14th Mar 2017 13:18
If e.g. i draw something at 0,0

it begins rather @ like y + 100 pixels
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 14th Mar 2017 13:24
rectification :

more like 5 pixels from the left and from the top

// nothing of big importance
but still, is it possible to start at the very left of the screen ?
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 14th Mar 2017 13:33
y+ 100 pixels is when i set window & resolution to like 1024x768, then switch to fullscreen

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 14th Mar 2017 13:50
you mean the borders? black bars?
SetScissor ( 0,0,0,0 )
https://www.appgamekit.com/documentation/Reference/Core/SetScissor.htm
AGK (Steam) V2017.02.28 : Windows 10 Pro 64 Bit : AMD (17.2.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 14th Mar 2017 14:01 Edited at: 14th Mar 2017 14:08
Scissors are set to 0000 ;

the graphics still don't start at the very left & very top of the window - rather like + ~ 5 pixels

on the right and bottom side, however, they close exactly with the window borders
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 14th Mar 2017 14:18 Edited at: 14th Mar 2017 14:32
The reason seems to be SetWindowAllowResize( 1 )

If this is active the lines dont align to the very left and top


SetWindowAllowResize( 1 )
SetWindowSize( 1024, 768, 0 )
SetVirtualResolution( 1024, 768 )
SetScissor( 0,0,0,0 )

Do

drawline(1,1,1024,1,255,255,0)
drawline(1,1,1,768,255,255,0)
sync()

Loop

======

Without SetWindowAllowResize it works fine, line direct at left and top


SetWindowSize( 1024, 768, 0 )
SetVirtualResolution( 1024, 768 )
SetScissor( 0,0,0,0 )

Do

drawline(1,1,1024,1,255,255,0)
drawline(1,1,1,768,255,255,0)
sync()

Loop


Seems to be a bug in SetWindowAllowResize( )
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 14th Mar 2017 15:04
the VirtualResolution size is constant if a window resize.
see commands
GetScreenBoundsBottom ()
GetScreenBoundsLeft ()
GetScreenBoundsRight ()
GetScreenBoundsTop ()
AGK (Steam) V2017.02.28 : Windows 10 Pro 64 Bit : AMD (17.2.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 14th Mar 2017 15:11
It has nothing to do with Virtual Resolution -> it works fine, even if Virtual Resolution is set

It is, because SetWindowAllowResize( ) is buggy.

Witout this command, everything works well.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 14th Mar 2017 17:08 Edited at: 14th Mar 2017 18:57
u used both the same size
SetWindowSize( 1024, 768, 0 )
SetVirtualResolution( 1024, 768 )
if your window get 16:9 it will show 4:3 inside.

but i remember if the windows changed maximized and get back to normal it get a different size.

if you set full screen here it ignore the size x,y and used the desktop size
SetWindowSize

AGK (Steam) V2017.02.28 : Windows 10 Pro 64 Bit : AMD (17.2.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 14th Mar 2017 19:44 Edited at: 14th Mar 2017 19:48
If I run your code, there are ~ 5 pixels black borders at the top and the left.

Remove the " SetWindowAllowResize( 1 ) " line from your code and restart - then it will start properly from the beginning.

So there must be a bug in the "SetWindowAllowResize" command.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 14th Mar 2017 19:51
hmm, don't know why, we need others to test also.
AGK (Steam) V2017.02.28 : Windows 10 Pro 64 Bit : AMD (17.2.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Mar 2017 21:15 Edited at: 14th Mar 2017 21:17
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 14th Mar 2017 21:48
This makes the distance between 1,1 and the border even bigger at my window -

without the SetWindowAllowResize() it works well - i think it needs to be fixed
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Mar 2017 22:04
is this for windows? because it works fine for me
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 14th Mar 2017 22:41
yes, windows
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Mar 2017 22:43
Maybe just try the code as is. See if that works because it does work perfectly for me
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 14th Mar 2017 22:50
i did - it doesn't - the distance gets even bigger then

TGC's shall fix SetWindowAllowResize( 1 )

CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 14th Mar 2017 23:06
I just tested on my machine. Works fine here too (although I just realised I'm still on 2017.02.21). Maybe Paul will have a look if he's got everything he needs. Let him know what version Windows and AppGameKit you are using etc.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Mar 2017 23:31 Edited at: 14th Mar 2017 23:35
This is what it looks like on my pc. The pink sprite is positioned at 0,0


Then i resize the window and it looks like this (Note the pink sprite);


I attached the project

Attachments

Login to view attachments
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 14th Mar 2017 23:48
(built on 2017-02-27) // Windows 10
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 15th Mar 2017 00:18
Yeah, looks like a bug, although not as described in the OP. I've replaced your prints with text so it doesn't resize with the change in virtual res (which was confusing things). Now it is clear to see what is happening. The very first resize of the window appears to shrink the window by 10 pixels in the width and height. Looks to me like upon resize, the GetDeviceWidth/Height is deducting the width of the window border from the result perhaps? All subsequent resizes work fine.

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 15th Mar 2017 00:34 Edited at: 15th Mar 2017 00:40
You can fix that by inserting a setwindowsize(width+10, 768+10, 0) before the setvirtualresolution if you want to force a fixed height.
you are right though; the whole resize/getdevicewidth/height/setwindowsize/setvirtualresolution thing needs to be synchronized

i don't think that is what he's talking about though
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 15th Mar 2017 00:58 Edited at: 15th Mar 2017 01:07
i described it correctly in the V2 Feature Request ; it also doesn't work correctly without any virtual resolution set
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 15th Mar 2017 01:22
Your code (From the V2 feature request) works perfectly for me;


Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 15th Mar 2017 01:34
sick ; windows 10 ?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 15th Mar 2017 01:39 Edited at: 15th Mar 2017 03:29
Yes (built on 2017-02-27) // Windows 10

When i change the setwindowsize to SetWindowSize( 1024, 768, 1 ) (Fullscreen) or when i maximize my window i get the results you speak about.
The reason is my display resolution is 1920x1080 which is an aspect of about 1.777 where as 1024x768 is an aspect of 1.33333
AGK will clip the screen to try to display the aspect you request. That is why it is shifting your graphics to the right.
you can still access these areas by using negative x and y values and setscissor(0,0,0,0). you can also get the x/y values of the right/left/top/bottom of your window
using the GetScreenBounds commands
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 16th Mar 2017 17:29
Thanks, fixed for the next version. It appears Windows changes the window title bar style when it is allowed/not allowed to be resized, which changes the window resolution. We'll use a different method to restrict resizing for the next version.
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 17th Mar 2017 02:28 Edited at: 17th Mar 2017 02:29
I had the same problem too regarding sprites at 0,0 on Android.
If I SetImmersiveMode(1)
and then SetVirtualResolution( getdevicewidth(),getdeviceheight() )
and then SetOrientationAllowed( 0,0,1,0 ) (to force horizontal orientation)
The sprites thats positioned at 0,0 will be shifted to the right by a few pixels.

The problem would not occur when I specify the SetVirtualResolution with real number, such as
SetVirtualResolution( 1920,1080 )

Will post a proper bug thread with example project later
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 17th Mar 2017 06:26
Thanks for fixing !
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 17th Mar 2017 17:01
Quote: "If I SetImmersiveMode(1)
and then SetVirtualResolution( getdevicewidth(),getdeviceheight() )
The problem would not occur when I specify the SetVirtualResolution with real number, such as
SetVirtualResolution( 1920,1080 )"

It might be that getdevicewidth/height are not updated immediately. The OS takes some time to activate immersive mode so you may have to poll those commands and adjust the virtual resolution when they change.
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 17th Mar 2017 19:12 Edited at: 17th Mar 2017 19:14
Quote: "It might be that getdevicewidth/height are not updated immediately. The OS takes some time to activate immersive mode so you may have to poll those commands and adjust the virtual resolution when they change."


I waited for the device orientation to change to horizontal with WHILE/ENDWHILE until screen width>length.
After that, I update the sprite position to 0,0 in every frame in the main loop.
But still the 0,0 sprite will get shifted

Login to post a reply

Server time is: 2024-09-30 01:29:32
Your offset time is: 2024-09-30 01:29:32