Pandora Allegro 5.1 for Pandora


ptitSeb

Serial Porter
Joined
Aug 15, 2012
Messages
9,307
Age
51
Location
France, near Lyon
In this archive are the libs, headers and pkg files for allegro 5.1.6 for the OpenPandora. It's the version I used for Dune Dynasty & The Devil.

I want to put the entire dev folder, with sources & samples, but the archive is 40Mo of size so I don't know where to put it.
 

Attachments

  • allegro51.tar.gz
    550 KB · Views: 136
Last edited by a moderator:
 

For thoses of you who want to take a look, and improve things, here are the sources of the port.

You need a late 5.1.5 sources base or early 5.1.6 sources. In the tgz you'll find the whole "src" folder. And you will also need CMakeList.txt to replace the original.

Then launch a "ccmake .", and don't forget to put PANDORA to ON...

Good luck compiling.

Notes that for libDUMB, the cmake doesn't find it. The problem is libdumb need libm, but cmake doesn't link it and so fail... I have cheated (messing with CMakeCache.txt) to have it inside my build...
 

Attachments

  • allegro5.tar.gz
    706.4 KB · Views: 125
  • CMakeLists.txt
    31.1 KB · Views: 603
Last edited by a moderator:
Did you get anywhere with the al_lock_bitmap function? I haven't so far :(
 
Me neither, but I haven't worked on Allegro lately (but that what I do, when I'm stuck on something, I do other things to learn new tricks).
 
Last edited by a moderator:
Seb, since my rewrite of TournamentHub, I'm trying to run my code, and it segfaults when trying to create the EGL Display

According to GDB, the error was in

Code:
0x40a5e9c8 in IMGeglGetDisplay () from /usr/lib/libIMGegl.so
My previous PND still works though, but I don't have the code on my Pandora to check if it compiles and runs. Any ideas?
 
That's strange.

The screen init process is based on eglport, and it happens that way:

1. I call EGL_Open() to initialize EGL & eglport

int8_t EGL_Open( void )
{
    EGLint eglMajorVer, eglMinorVer;
    EGLBoolean result;
    const char* output;

    // Setup any platform specific bits
    Platform_Open();

    printf( "EGL Opening EGL display\n" );
    if (GetNativeDisplay() != 0)
    {
        printf( "EGL ERROR: Unable to obtain native display!\n" );
        return 1;
    }

    g_eglDisplay = peglGetDisplay( g_nativeDisplay );
    if (g_eglDisplay == EGL_NO_DISPLAY)
    {
        CheckEGLErrors( __FILE__, __LINE__ );
        printf( "EGL ERROR: Unable to create EGL display.\n" );
        return 1;
    }

    printf( "EGL Initializing\n" );
    result = peglInitialize( g_eglDisplay, &eglMajorVer, &eglMinorVer );
    if (result != EGL_TRUE )
    {
        CheckEGLErrors( __FILE__, __LINE__ );
        printf( "EGL ERROR: Unable to initialize EGL display.\n" );
        return 1;
    }

    // Get EGL Library Information
    printf( "EGL Implementation Version: Major %d Minor %d\n", eglMajorVer, eglMinorVer );
    output = peglQueryString( g_eglDisplay, EGL_VENDOR );
    printf( "EGL_VENDOR: %s\n", output );
    output = peglQueryString( g_eglDisplay, EGL_VERSION );
    printf( "EGL_VERSION: %s\n", output );
    output = peglQueryString( g_eglDisplay, EGL_EXTENSIONS );
    printf( "EGL_EXTENSIONS: %s\n", output );
    
    CheckEGLErrors( __FILE__, __LINE__ );

    return 0;
}

Than I create the X11 fullscreen window

   if (getenv("DISPLAY")) {
      _al_mutex_lock(&system->lock);
      Window root = RootWindow(
         system->x11display, DefaultScreen(system->x11display));
      XWindowAttributes attr;
      XGetWindowAttributes(system->x11display, root, &attr);
      d->window = XCreateWindow(
         system->x11display,
         root,
         0,
         0,
         attr.width,
         attr.height,
         0, 0,
         InputOnly,
         DefaultVisual(system->x11display, 0),
         0,
         NULL
      );
      XGetWindowAttributes(system->x11display, d->window, &attr);
      XSelectInput(
         system->x11display,
         d->window,
         PointerMotionMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask
/*
         StructureNotifyMask | FocusChangeMask | PointerMotionMask
         | KeyPressMask | KeyReleaseMask | ButtonPressMask
         | ButtonReleaseMask | PropertyChangeMask
*/
      );
      XMapWindow(system->x11display, d->window);
      //XSetInputFocus(system->x11display, d->window, RevertToParent, CurrentTime);
      _al_xwin_reset_size_hints(display);
      _al_xwin_set_fullscreen_window(display, 2);
      _al_xwin_set_size_hints(display, INT_MAX, INT_MAX);
      d->wm_delete_window_atom = XInternAtom(system->x11display,
         "WM_DELETE_WINDOW", False);
      XSetWMProtocols(system->x11display, d->window, &d->wm_delete_window_atom, 1);
      _al_mutex_unlock(&system->lock);
   }

And after that, the EGL_Init() phase to create context

int8_t EGL_Init( void )
{
    int configIndex = 0;

    if (FindAppropriateEGLConfigs() != 0)
    {
        printf( "EGL ERROR: Unable to configure EGL. See previous error.\n" );
        return 1;
    }

    printf( "EGL Using Config %d\n", configIndex );
    if ( ConfigureEGL(g_allConfigs[configIndex]) != 0)
    {
        CheckEGLErrors( __FILE__, __LINE__ );
        printf( "EGL ERROR: Unable to configure EGL. See previous error.\n" );
        return 1;
    }

    return 0;
}

I am not sure why it crashed. Are you on default driver?
 
Yes, as far as I know. I don't think I've changed anything. That's why I'm a little confused. I'll have another play, see if I can figure it out
 
Maybe it's calling the init 2* times, and the second time is the crash. Do you see some window flickering before the Segfault?
 
Nope it doesn't seem to actually touch the display. I get the following out in my terminal:

Code:
al_create_display(800, 480)
al_get_system_driver()
system->vt->get_display_driver()
driver->create_display(800, 480)
EGL Opening EGL display
Segmentation fault
 
So, it looks to happens inside "GetNativeDisplay"

int8_t GetNativeDisplay( void )
{
#if defined(USE_EGL_SDL) || defined(USE_EGL_RAW)
    printf( "EGL Opening X11 display\n" );

    g_nativeDisplay = XOpenDisplay( NULL );
    if (g_nativeDisplay == NULL)
    {
        printf( "EGL ERROR: unable to get display!\n" );
        return 1;
    }
#else
    g_nativeDisplay = EGL_DEFAULT_DISPLAY;
#endif /* USE_EGL_SDL */

    return 0;
}

EGL_USE_RAW is defined here.
 
Okay, I wrote a 4 line test on the Pandora that opens a display, and that works fine! Now to find out why that does and The Tournament Hub doesn't :/

Edit: Got it fixed. I certainly don't understand the problem, because it ran on my desktop, and netbook, and under my linux VM all fine, but anyway, problem solved :)
 
Last edited by a moderator:
Back
Top