views:

21

answers:

1

I'm using SDL_Image to display a JPEG on screen and having some issues with the resolution it's being displayed at.

I understand that if I pass 0 to width, height and bits when calling SDL_SetVideoMode that SDL takes the current modes values, however these seem to be wrong in my case.

I'm running this on an embedded linux system with a custom display (LED screen of 1440x900) and the framebuffer is 1280x720.

The JPEG is displayed but seems to be 640x480 and therefore leaves large parts of the screen white. When I specify width and height with SDL_SetVideoMode I get an error:

SDL_SetVideoMode: No video mode large enough for 1280x720

Here's the main code I'm using:

pImage = IMG_Load(file);
pScreen = SDL_SetVideoMode(0,0,0,SDL_ANYFORMAT);
SDL_BlitSurface(pImage,0,pScreen,0);
SDL_Flip(pScreen);

Anyone have any ideas/pointers?

Thanks!

A: 

This was fixed by adding the custom resolution to /etc/fb.modes like so:

mode "1280x720-59"
    # D: 172.00 MHz, H: 82.700 kHz, V: 66.00 Hz
    geometry 1280 720 1280 720 16
    timings 13000 300 70 26 3 80 5
endmode

Still no fix for the SDL_SetVideoMode hanging as referenced in my above comment...

peacemaker