maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nemo Mobile (https://talk.maemo.org/forumdisplay.php?f=53)
-   -   [Mer] Building libSDL with libEGL and Mer SDK? (https://talk.maemo.org/showthread.php?t=90346)

shmerl 2013-06-04 01:47

[Mer] Building libSDL with libEGL and Mer SDK?
 
Does anyone have an idea how to properly build libSDL on Mer SDK? Mer naturally doesn't provide libglx, but uses libEGL. However by default, configuring libSDL (stable 1.2.15 in my case) produces this:

HTML Code:

checking for OpenGL (GLX) support... no
...
checking for Touchscreen library support... no

Is it normal, or it means that it won't use OpenGL? What is the right way to make it use libEGL instead of libglx?

And also, what about proper way of enabling touchscreen support?

shmerl 2013-06-04 02:58

Re: [Mer] Building libSDL with libEGL and Mer SDK?
 
UPDATE: It's a limitation of libSDL 1.2.

Just pulled the latest libSDL 2.0 snapshot - and it configured with detecting libEGL out of the box. It's not a stable version however. So I guess we'll have to wait?

shmerl 2013-06-04 03:17

Re: [Mer] Building libSDL with libEGL and Mer SDK?
 
Anyway, my goal was to build scummvm which requires libSDL as a prerequisite. Did anyone succeed with that?

shmerl 2013-06-05 04:11

Re: [Mer] Building libSDL with libEGL and Mer SDK?
 
OK, scummvm got built against libSDL 1.2, and apparently one needs to disable OpenGL there explicitly. In theory it might use GLES, but scummvm doesn't work with libSDL 2.0 yet, and that's what is needed for using the GLES option.

I'll see how this works with Plasma Active (but that will have to wait until some bug fixes, since current devel image on Nexus 7 is in unusable condition and that's what I have now to test Mer builds on).

w00t 2013-06-05 10:32

Re: [Mer] Building libSDL with libEGL and Mer SDK?
 
Quote:

Originally Posted by shmerl (Post 1349357)
Is it normal, or it means that it won't use OpenGL? What is the right way to make it use libEGL instead of libglx

You probably found this out already, but GLX and EGL are two different things. If it doesn't have EGL support, then you're pretty much SOL - but it sounds like you already got this solved with a version upgrade.

thp 2013-06-05 12:24

Re: [Mer] Building libSDL with libEGL and Mer SDK?
 
Quote:

Originally Posted by shmerl (Post 1349658)
OK, scummvm got built against libSDL 1.2, and apparently one needs to disable OpenGL there explicitly. In theory it might use GLES, but scummvm doesn't work with libSDL 2.0 yet, and that's what is needed for using the GLES option.

I'll see how this works with Plasma Active (but that will have to wait until some bug fixes, since current devel image on Nexus 7 is in unusable condition and that's what I have now to test Mer builds on).

You should be able to repurpose the SDL 1.2 port to Harmattan (which includes patched-in OpenGL ES support, which adds OpenGL ES support (although the code might be SGX-specific): https://github.com/harmattan/harmattan-sdl

An example how this is used (use SDL_OPENGLES instead of SDL_OPENGL, etc..) can be found in the Brain Party Harmattan port: https://github.com/harmattan/brainpa...aster/main.cpp

Be sure to pick the right GLES version (1 or 2) using SDL_GL_SetAttribute() with SDL_GL_CONTEXT_MAJOR_VERSION.

shmerl 2013-06-05 14:51

Re: [Mer] Building libSDL with libEGL and Mer SDK?
 
I'll take a look, thanks. Why didn't OpenGL ES support make it into SDL 1.2 upstream?

Anyway, Scummvm developers said that it doesn't require OpenGL strictly speaking, since it mostly deals with 2D sprites and works decently without hardware acceleration.

javispedro 2013-06-05 15:05

Re: [Mer] Building libSDL with libEGL and Mer SDK?
 
Because SDL 1.2 was EOL'd.

SDL 1.3 became SDL 2.0, which I will try to adapt to the Jolla device once it is my hands. Sadly, SDL 2.0's API compatibility with 1.2 was also broken, so it does not help SDL 1.2 programs.

As for the harmattan SDL, the 3D stuff should be quite generic, but the 2D acceleration (aka SDL_HWSURFACE) is both SGX, OMAP and "Maemo X11" specific. The reasoning is that I did not find another way to ensure v-sync in Harmattan without having to resort to a OpenGL surface which uses much more memory (and unlike Qt, etc. SDL 1.2 programs expect their "context" to be kept between focus changes, so dropping it at focus out was not an option).
I believe you should be able to remove the OMAP specific patches (pvr2d-*) without much conflict, but you'll lose 2D v-sync in the process.

Additionally, acelerometer, vibration, etc and all the other non-standard additions are also Harmattan specific, but these are less important. Namely, sensord for accelerometer, which is probably in Mer too, but Vibetonz for vibration, which probably is not in Mer.

shmerl 2013-06-05 15:13

Re: [Mer] Building libSDL with libEGL and Mer SDK?
 
So you expect that each device will have to provide SDL (let's say we are talking about 2.0+) specifically tailored for it and there is no way to make an efficient generic libEGL variant that could be used by all derivatives based on the same Mer release?

javispedro 2013-06-05 15:24

Re: [Mer] Building libSDL with libEGL and Mer SDK?
 
Quote:

Originally Posted by shmerl (Post 1349763)
So you expect that each device will have to provide SDL (let's say we are talking about 2.0+) specifically tailored for it and there is no way to make an efficient generic libEGL variant that could be used by all derivatives based on the same Mer release?

Oh no, the SDL 2.0 world is much easier because they are already slightly more mobile-oriented. They dropped most of the old-style 2D acceleration, forcing OpenGL everywhere, and are much more EGL friendly (and more crap-mobile-OS *cough* android *cough* friendly by including events such as "EGL context lost").

Depending on how weird the window manager on Mer/Jolla currently is, you will still need to have a Mer/Jolla specific SDL, though. And accelerometer/vibrator need additional consideration. But otherwise nothing HW-specific in there.


All times are GMT. The time now is 10:05.

vBulletin® Version 3.8.8