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.

Raspberry Pi / SetDisplayAspect(-1) issue on Pi

Author
Message
XANAX 2B
13
Years of Service
User Offline
Joined: 20th Jun 2003
Location: Corsica (France)
Posted: 17th Nov 2016 14:42
Hello

I've a problem with SetDisplayAspect(-1) on Pi.
My window (or fullscreen) always stay at 4:3 proportions, and is sometimes stretched vertically and not horizontally.

May be because I've ordered a 7'' screen for my Pi 3, with a resolution of 1024x600.

Can you help me finding a solution ?

+ Code Snippet

My Freewares here : http://www.retro-bruno.com
=PRoF=
14
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 17th Nov 2016 20:42
Quote: "Use an aspect ratio of -1 to use the device aspect ratio (fills the whole screen without black borders, but will cause stretching and look different on every device) An alternative method of filling the screen which avoids this problem is to use SetScissor with the values 0,0,0,0. "


I think your problem is that you are doing both methods suggested in the help. Try one or the other, I would set the aspect to 640.0/480.0. You will need to use negative x co'ords to position stuff at the left hand edge of the screen.

Hope that helps
XANAX 2B
13
Years of Service
User Offline
Joined: 20th Jun 2003
Location: Corsica (France)
Posted: 18th Nov 2016 12:01
I've tried many things since yesterday.
Finally, i've set the Scissor to (0,0,639,479) and let the DisplayAspect to -1.
All is ok on Windows, Android, Ipad, but there is still this problem on RPi 3.
When i maximize the window OR when i set my game to Fullscreen, it doesnt fit the screen.
There is also an other problem.
AGK thinks the game fit the screen, so sprites positions and UVs are not drawn where it should.
Even when the Window is not maximized.

I've also tried an other TV with better resolutions, same problem.

I think there is a bug in this for the RPI's AppGameKit 2.
My Freewares here : http://www.retro-bruno.com
XANAX 2B
13
Years of Service
User Offline
Joined: 20th Jun 2003
Location: Corsica (France)
Posted: 24th Nov 2016 09:32 Edited at: 24th Nov 2016 15:26
Ok, SetDisplayAspect(-1) don't stretch the screen under Raspbian. For that, i'll wait an update of AppGameKit 2.

But i have an other problem on Pi. I thought it was due to SetDisplayAspect but it's probably not the case.

I explain.
I have a sprite for the background of my game.
Its image is 2560x2560 size in pixels.
I show just a part of it using SetSpriteUV & SetSpriteSize, to make scrollings.

But under Pi, the Sprite not show its image where it should be.

I suppose it's due to a limit in images size under raspbian. Can you confirm me that ? May be 2048x2048 or less ?


EDIT:
After importing my 2560x2560 pixels image, i've just printed to the screen the width of my image, it was 2048.
So, i confirm, this is the images size limit for the Pi.
My Freewares here : http://www.retro-bruno.com

Login to post a reply

Server time is: 2017-05-23 00:18:12
Your offset time is: 2017-05-23 00:18:12