Difference between revisions of "SDL Development"

From ArmadeusWiki
Jump to: navigation, search
m (Configuration)
m (Links)
Line 52: Line 52:
 
* SDL_Water
 
* SDL_Water
  
 +
==Troubleshots==
 +
* Screen/backlight goes black after SDL launch/exit: [[BackLight|use backlight driver to set backlight to a default value.]]
 
==Links==
 
==Links==
 
* [http://www.opentom.org/LibSDL SDL & Tslib page of the OpenTomTom project]
 
* [http://www.opentom.org/LibSDL SDL & Tslib page of the OpenTomTom project]

Revision as of 09:03, 14 July 2008

On this page, you will find usefull informations to setup and develop SDL based applications for your Armadeus board.

Introduction

Simple DirectMedia Layer (SDL) is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. For more informations -> http://www.libsdl.org/

Installation

  • Launch Buildroot configuration
# make menuconfig

and choose SDL package in:
Menuconfig package.png

Menuconfig package graphics.png

you can choose packages like SDL_Image too; then save your configuration

  • Regenerate your rootfs
# make

and reflash it on your board

Configuration

Our SDL version is using the FrameBuffer interface and so it's very important to have a /etc/fb.modes file up to date with the framebuffer parameters supported by your configuration (otherwise SDL try to use the VESA parameters which may misprogram the i.MXL LCD controller).

For example for the Sharp LQ057, put in /etc/fb.modes:

mode "320x240-176"
   # D: 16.000 MHz, H: 43.836 kHz, V: 176.047 Hz
   geometry 320 240 320 240 16
   timings 62500 9 27 0 7 9 2
   rgba 5/11,6/5,5/0,0/0
endmode

By default the (Microtips) LCD parameters are used in /etc/fb.modes. <-- TO BE REPLACED WITH LQ043 SOON !!

  • If you want to get the parameters for your currently running LCD, then you can do:
# fbset > /etc/fb.modes

Adding Tslib (Touchscreen library) support to SDL

SDL is by default compiled with Tslib support in current Buildroot distribution. You just have to make SDL knows the presence of Tslib when launching your application (assuming you have correct Tslib envt variables set):

export SDL_MOUSEDRV=TSLIB
export SDL_MOUSEDEV=$TSLIB_TSDEVICE
export SDL_NOMOUSE=1

Usage

  • Take a look at armadeus/target/demos/armanoid/ sources in your SVN view.
  • If SDL is complaining because it can't find any mouse (Unable to init SDL: Unable to open mouse) then, before launching the program, do:
# export SDL_NOMOUSE=1

Tested SDL applications

Troubleshots

Links

Other languages:

English Flag.svg English  •  French Flag.svg Français