[SailfishDevel] Question creating full screen SDL window

Thomas Perl th.perl at gmail.com
Mon Apr 7 08:56:33 UTC 2014


Hi,

I've submitted a patch for this to upstream SDL now:
https://bugzilla.libsdl.org/show_bug.cgi?id=2481

For testing the changes, RPMs with the change applied are available here:
http://repo.merproject.org/obs/home:/thp:/sdl2/1.0.4.20_armv7hl/armv7hl/

You can install RPM files with "pkcon install-local <filename>".

Downstream PR:
https://github.com/nemomobile-packages/libsdl/pull/1


HTH :)
Thomas

On 2014-04-04 18:57, Iosif Hamlatzis wrote:
> I have different behaviour creating a full screen SDL window between 
> Sailfish OS and other mobile platforms I have tested.
>
> I am using the same source code below:
>
>
> SDL_Window*  pWindow  =  SDL_CreateWindow("",  0,  0,  0,  0,  SDL_WINDOW_OPENGL|SDL_WINDOW_FULLSCREEN|SDL_WINDOW_SHOWN);
> int  ActualScreenWidth_  =  -1;
>
>
> int  ActualScreenHeight_  =  -1;
>
>
> SDL_GetWindowSize(pWindow,  &ActualScreenWidth_,  &ActualScreenHeight_);
>
>
>
>
>
> In all cases including Sailfish OS I get the correct width and height of the device, but (yes there is a but) on Sailfish OS nothing is drawn on screen when I later try to render an image. I have tested this on the emulator and on the actual device. Also I have tested this not only with my code but also with code I've found athttps://github.com/thp/sdl2-opengles-test
>
>
>
>
>
> If I modify my code to:
>
>
> SDL_Window*  pWindow  =  SDL_CreateWindow("",  0,  0,  0,  0,  SDL_WINDOW_OPENGL|SDL_WINDOW_FULLSCREEN|SDL_WINDOW_SHOWN);
>
>
>
> int  ActualScreenWidth_  =  -1;
>
>
> int  ActualScreenHeight_  =  -1;
>
>
> SDL_GetWindowSize(pWindow,  &ActualScreenWidth_,  &ActualScreenHeight_);
>
>
> *SDL_DestroyWindow(pWindow);*
> pWindow  =  SDL_CreateWindow("",
>                             0,  0,
>                             *ActualScreenWidth_,  ActualScreenHeight_*,
>                             SDL_WINDOW_OPENGL|SDL_WINDOW_FULLSCREEN|SDL_WINDOW_SHOWN);
> Which I think is strange since in the first place the*pWindow*  I get from the first call is valid and the values I get from querying the window size correspond to the device's resolution.
> Besides the first code snippet works on all platforms I've tested from plain PC to mobile platforms such as webOS. BlackBerry (PlayBook and BB10) and iOS
>
>
> _______________________________________________
> SailfishOS.org Devel mailing list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20140407/5dc06d82/attachment.html>


More information about the Devel mailing list