Closed giorgosgs closed 11 years ago
That's not good. Perhaps the aspect-ratio stretching code is incorrect with GL windows? What are the values of SCREEN_WIDTH and SCREEN_HEIGHT in your example? Also, are you using the environment variable STRETCH_MODE? Can you experiment with setting it to "noscale" or "fill"?
Here is how I do it:
//Auto adjust resolution
const SDL_VideoInfo* myMonitor = SDL_GetVideoInfo();
SCREEN_WIDTH = myMonitor->current_w;
SCREEN_HEIGHT = myMonitor->current_h;
I dont use STRETCH_MODE or anything else. I dont even know how to use it.
I noticed 2 weird things:
1) When I compiled the new SDL library with QNX Momentics I got an error saying: cannot find 'mainWindow ' in SDL_playbookvideo.c in this line:
info->mainWindow = _priv->mainWindow;
I had to comment it out for it to compile.
2) When the playbook is in portrait and I start the app and see it like the image above I print the game's resolution and it says: 600x450. It should say 1024x600. I don't get it.
Something seems strange about your SDL library. Did you refresh the project after updating from Git? I do not get any errors about mainWindow when building. Alternatively, can you test that SDL works if you check it out to 20c331e324ad5d58ef80c8352a760e2ac866747e instead of HEAD? This should remove the more recent changes from January, but keep the change that introduced the STRETCH_MODE options, and hopefully help us find the problematic change. Thanks!
Yes I refreshed my project.
I started the project with fixed resolution:
gv.window = SDL_SetVideoMode(1024, 600, SCREEN_BPP, SDL_OPENGL | SDL_FULLSCREEN);
When the playbook is in portrait and I start the app and see it shrinked in 1/3 horizontal and 1/2 vertical.
This is very weird! I loaded the SDL before STRETCH_MODE change and still it does the same error!
Maybe a fix before that which at the time I didnt check this error?
I really dont know which fix triggered the error but its there and its happening 100% 1) When I start the app on my playbook from landscape view the app starts correct. 2) When I start the app on my playbook from portrait view the app starts wrong, like the image above.
I have:
<initialWindow>
<aspectRatio>landscape</aspectRatio>
<autoOrients>false</autoOrients>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
</initialWindow>
I suspect that when I launch the app in portrait, it doesnt have time to fully change the resolution to landscape when the app starts. Its in a middle state (from one aspect to the other) and thus the new app cannot be set correctly.
Any news?
I've been completely swamped with other things at the moment and haven't really had any time to investigate. It would help me out if you could isolate which version you had that was working before (just the SHA will do).
I had the same issue before 5 months and I submitted it and you guys fixed it. Check here: https://github.com/blackberry/SDL/issues/28 You will see there who fixed it and when. But the issue came back...
Can you please look into it. I would like to publish my app into the BB Appworld until mid Feb to participate into blackberries 'build for blackberry' program. Thanks a lot.
I will try to investigate. If necessary, can you send me an application that shows the problem? I will try to investigate in either case, but it may be useful to have your app. A simple test app is fine.
Can you try it with d92c59639dbefc4bfb7ba8b74c3789a67ccac449?
I tried it. I confirm, it works. Now the resolutions works as expected.
After January updates I have an error that I didnt have in the previous SDL release. When I hold my playbook in portrait mode and I start my SDL app, the game screen shrinks in 1/3 horizontal and 1/1 vertical. Its stretched. Look at the image I attack. The red is the game screen and the rest of the screen is black. Before January updates this worked ok.
I start the app with this: