Re: Raspberry Pi (Raspbian) + OpenglES + no X

Gabriel Jacobo <[email protected]>
Newsgroups gmane.comp.lib.sdl
Message-ID <CAKDfesm2eYsrMO5hybtoG6SmM0OB9KBw_b6W09fEOHhdXvErig@mail.gmail.com>
2016-10-06 12:59 GMT-03:00 cleger <[email protected]>:

> Greetings.
>
> I'm trying to build an application on Raspberry Pi (version 1A or
> 2B+)/raspbian which:
>
> - uses SDL for event handling, image loading, sound, etc.
> - uses OpenglES for rendering
> - runs without X (just to save memory)
>
> I've read a great many posts where people help each other build or run
> SDL+OpenglES apps, but I can never completely nail down what config people
> are dealing with.
>
> My questions:
> - Can I build and run the above app with the stock SDL2-dev library that I
> can get from the Raspbian ppt?
>

It depends on how that library was built. If it has both X11 and RPi video
backends in it, you need to make sure the right one is selected when
launching your app (SDL by default just goes through the list of video
backends compiled in until one works). That's why I suggest disabling X11
support when building for the RPi, since it doesn't really work and gets in
the way.



>
> - In order to build and run my app, must I first build SDL2 with
> rpi-related flags enabled, and use a few disables, such as
> --disable-video-x11, --disable-video-opengl, etc.?
>
> My main dilemma is that I don't know whether SDL for Raspbian 'prefers' or
> 'assumes' it is running inside of, or outside of, X.
>

It doesn't assume anything, in terms of "preference", you can see the video
backend selection logic here:
https://hg.libsdl.org/SDL/file/tip/src/video/SDL_video.c#l472

It can be affected by the environment variable SDL_VIDEODRIVER, otherwise
it'll go through the bootstrap array, where X11 is listed in second place
thus it'll be initialized before the RPi direct hardware backend.

Gabriel.

_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.