blackberry / SDL

Simple DirectMedia Layer is an open-source, cross-platform multimedia library designed to provide a low level API.
GNU Lesser General Public License v2.1
86 stars 46 forks source link

Higher resolutions are not initializing properly #20

Closed jgranick closed 12 years ago

jgranick commented 12 years ago

Hi guys,

I am testing SDL against the BlackBerry 10 Developer Alpha, and I have discovered that it appears to work properly when the resolution is set to 1024 x 600, like the PlayBook, but when you initialize to 0 x 0, or 1280 x 768 for the Dev Alpha, it does not work properly.

Thanks!

jnicholl commented 12 years ago

I don't have any of those devices, actually. What happens? I noticed there are two locations in which 1024x600 is present in the code - one when using GL surfaces (SDL_playbookvideo_gl.c) and one in the TouchControlOverlay (touchcontroloverlay.cpp, loading the default controls).

-----Original Message----- From: Joshua Granick [mailto:reply@reply.github.com] Sent: Thursday, May 10, 2012 10:39 PM To: Jeremy Nicholl Subject: [SDL] Higher resolutions are not initializing properly (#20)

Hi guys,

I am testing SDL against the BlackBerry 10 Developer Alpha, and I have discovered that it appears to work properly when the resolution is set to 1024 x 600, like the PlayBook, but when you initialize to 0 x 0, or 1280 x 768 for the Dev Alpha, it does not work properly.

Thanks!


Reply to this email directly or view it on GitHub: https://github.com/blackberry/SDL/issues/20


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

jnicholl commented 12 years ago

Can you check if my recent commits to the next branch fix the issues? I only have PlayBooks at the moment, so I can't test the changes very well. I've also added several modes to determine how the view is stretched. Take a look at SDL_playbookvideo_c.h to specify each of them. The default is now to preserve the aspect ratio and letterbox if needed.

-----Original Message----- From: Joshua Granick [mailto:reply@reply.github.com] Sent: Thursday, May 10, 2012 10:39 PM To: Jeremy Nicholl Subject: [SDL] Higher resolutions are not initializing properly (#20)

Hi guys,

I am testing SDL against the BlackBerry 10 Developer Alpha, and I have discovered that it appears to work properly when the resolution is set to 1024 x 600, like the PlayBook, but when you initialize to 0 x 0, or 1280 x 768 for the Dev Alpha, it does not work properly.

Thanks!


Reply to this email directly or view it on GitHub: https://github.com/blackberry/SDL/issues/20


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

jgranick commented 12 years ago

Thanks!

I apologize for the delay.

It works perfectly for landscape applications. So long as the application does not have the aspect ratio set to "portrait" on the PlayBook, or "landscape" on the Dev Alpha, it renders perfectly (at full resolution) and handles device rotations (preserving the native aspect ratio) perfectly.

The only issue here is if someone tries to use the opposite orientation on either device.

If you handle landscape on the PlayBook and portrait on the Dev Alpha, both work perfectly. You can even use a different resolution (like 600 x 1024 on the PlayBook) and have it letterbox properly. Once you force the windowing to use the opposite orientation, though, it does the "squishing" effect it used to do a couple months ago.

You can initialize to the native resolution of either device, and handle the rotation in your rendering calls, but unfortunately the OS still expects gestures to occur for the native orientation (landscape on PlayBook, portrait on the Dev Alpha) rather than your "faux" orientation, done in software.

Thank you again for this improvement! I've updated NME on SVN with this build, as its better all around.

jnicholl commented 12 years ago

No problem, I'm glad it is an improvement. I will try to investigate how I can improve the orientation issues you mention.

----- Original Message ----- From: Joshua Granick [mailto:reply@reply.github.com] Sent: Wednesday, May 16, 2012 11:23 PM To: Jeremy Nicholl Subject: Re: [SDL] Higher resolutions are not initializing properly (#20)

Thanks!

I apologize for the delay.

It works perfectly for landscape applications. So long as the application does not have the aspect ratio set to "portrait" on the PlayBook, or "landscape" on the Dev Alpha, it renders perfectly (at full resolution) and handles device rotations (preserving the native aspect ratio) perfectly.

The only issue here is if someone tries to use the opposite orientation on either device.

If you handle landscape on the PlayBook and portrait on the Dev Alpha, both work perfectly. You can even use a different resolution (like 600 x 1024 on the PlayBook) and have it letterbox properly. Once you force the windowing to use the opposite orientation, though, it does the "squishing" effect it used to do a couple months ago.

You can initialize to the native resolution of either device, and handle the rotation in your rendering calls, but unfortunately the OS still expects gestures to occur for the native orientation (landscape on PlayBook, portrait on the Dev Alpha) rather than your "faux" orientation, done in software.

Thank you again for this improvement! I've updated NME on SVN with this build, as its better all around.


Reply to this email directly or view it on GitHub: https://github.com/blackberry/SDL/issues/20#issuecomment-5757476


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

racoonapps commented 12 years ago

Having the same problem now in my game with BB 10 SDK. It's OK when aspect ratio is set to portrait on the BB Dev Alpha. But when setting it to landscape it seems that every pixel in the width is 3x bigger. Pixels are OK in height.

Any news on this one?

asimonov-im commented 12 years ago

sorry, I've been rather busy and haven't had time to do much with this. Are you setting the orientation for your app in the bar-descriptor.xml file? Or are you hoping to handle both orientations? As it currently stands, this port of SDL doesn't support orientation changes, I'm afraid. https://github.com/blackberry/SDL/blob/emulate/src/video/playbook/SDL_playbookvideo.c#L451 is where we 'lock' the orientation to whatever is the startup orientation of the app, I believe. Does that help any?

(sorry, jnicholl here actually, I'm using Artem's computer)

jgranick commented 12 years ago

I wonder if there would be a clean way to be able to detect which orientation the developer intends to use.

One approach would be to check the orientation of the desired window size. If it is wider, make it landscape, etc. However, this would not be useful when you are trying to use a window size of 0 x 0 in order to use the full resolution of the device.

Would it be possible for us to read the application's XML properties, to determine if it is trying to use a certain orientation?

If "landscape" or "portrait" is not specified, I think it would be best for it to behave exactly as it does now -- using the native orientation of the device. However, it would be great to be able to specify a startup orientation, somehow. If not through the application XML, then perhaps it could be a flag for SDL_Init, or some other place to pass in this information?

jgranick commented 12 years ago

Oh, wait...

I just looked at the code again. So if I export ORIENTATION=90, this might lock to a different orientation?

jgranick commented 12 years ago

Perhaps we could use an ORIENTATION environment variable, but cause it to recognize "portrait" and "landscape", so it can compare to the device's native orientation to see if it requires a rotation

jnicholl commented 12 years ago

Yes, I believe that's how it's supposed to work. I haven't tried changing it separately from the application's XML file however, so I'm not entirely certain. :)

-----Original Message----- From: Joshua Granick [mailto:reply@reply.github.com] Sent: Thursday, July 05, 2012 5:08 PM To: Jeremy Nicholl Subject: Re: [SDL] Higher resolutions are not initializing properly (#20)

Oh, wait...

I just looked at the code again. So if I export ORIENTATION=90, this might lock to a different orientation?


Reply to this email directly or view it on GitHub: https://github.com/blackberry/SDL/issues/20#issuecomment-6790665


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

jgranick commented 12 years ago

Okay, I mentioned this on the thread for TouchControlOverlay, but thought this was a better place to discuss it.

When I try to use 1280 x 768, it is not stretched, but it extends beyond the dimensions of the device screen, perhaps if it were using the DPI of a PlayBook, so the additional 256 x 168 are rendered offscreen, or perhaps it is another issue.

Anyway, have you seen if 0 x 0 is working right? When I get back to my desk, I might see if 1024 x 768 works properly as a temporary workaround

Apart from this issue, landscape and FORCE_PORTRAIT are working fine

:)

jnicholl commented 12 years ago

Does defining STRETCHED help?


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

jgranick commented 12 years ago

I just found a fix, and submitted a pull request :)