OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio

IPB

Welcome Guest ( Log In | Register )

> Sdl With Directfb Packages, directfb-enabled SDL for ALARMZ
danboid
post Nov 8 2015, 03:54 PM
Post #1





Group: Members
Posts: 881
Joined: 26-December 05
From: England
Member No.: 8,789



There are two main reasons you may need to use SDL's directfb output. You may want to run an SDL2 program from the console or you may wish to run an SDL program such as an emulator or a game at QVGA resolution from the console. SDL1 supports fbcon output but fbcon output has been dropped from SDL2 where directfb is your only real option for displaying graphics outside of X. QVGA fbcon output doesn't seem to work for SDL1 under recent kernels. To make matters more complicated, both the SDL1 and SDL2 packages in the ALARM repositories don't include directfb support and even if you do build SDL yourself with directfb enabled (without using the patched PKGBUILD below) it still won't work properly because the display isn't aligned for the Zaurus' display and your pointers orientation will be skewed using the directfb version currently in the ALARM repos, directfb 1.7.7.

Thankfully forum member daalnroti patched the directfb code of SDL 1.2.14 so that we can use directfb and see the full screen and he also patched directfb so that you can use a pointer device correctly up/down will be up/down instead of left/right. I have built ALARM packages and PKGBUILD tarballs that integrate these patches to simplify the install process.

So far we only have the previous stable release of SDL1 (1.2.14) patched so that the directfb display works properly and an older directfb with the pointer patch applied. SDL2 apps will suffer from a misaligned display until we have a similar patch for SDL2. daal's original directfb patch was for directfb 1.4.11 but it still applied cleanly to 1.4.16 which was the oldest version I could get to build under Arch. I have not yet looked into if this patch works under the latest directfb but its a very small patch so it should be trivial to update it if required.

The SDL package here was built against the directfb 1.4.16 package below.

Installing sdl and directfb

To install the attached packages you will first need to uncompress their tarballs to get the Arch .tar.xz package as well as uninstall your existing SDL and everything that depends on SDL (if you've already installed SDL1 from the ALARM repo) like so:

CODE
pacman -Rcn sdl


After installing the attached sdl and directfb packages, you will need to add both 'sdl' and 'directfb' to your IgnorePkg statement in /etc/pacman.conf. Don't forget to uncomment the IgnorePkg line as it's commented out by default!

Configuring sdl and directfb

If you wanted directfb to default to QVGA, you would create an /etc/directfbrc file like this:

CODE
fbdev=/dev/fb0
mode=240x320
force-windowed
layer-rotate=270
no-vt-switch


You can also temporarily switch DFB settings by exporting them in a comma separated list to DFBARGS by running a command like this:
CODE
export DFBARGS="force-windowed,layer-rotate=270,mode=240x320,no-vt-switch"


Note that layer-rotate is required to use directfb in landscape display mode and it doesn't work without the force-windowed option.

You need to export your choice of video driver othewise SDL1 defaults to fbcon output:

CODE
export SDL_VIDEODRIVER=directfb


Finally you also need to export one of the following EVs to correct the displays offset:

CODE
export SDL_VIDEO_DIRECTFB_POS=qvga
export SDL_VIDEO_DIRECTFB_POS=vga
export SDL_VIDEO_DIRECTFB_POS=topleft


If you want any of these exported automatically on boot, add them to /etc/profile .
Attached File(s)
Attached File  sdl_1.2.14_directfb_PKGBUILD.tar.gz ( 20.9K ) Number of downloads: 131
Attached File  directfb_1.4.16_ALARMZ_PKGBUILD.tar.gz ( 1.04K ) Number of downloads: 125
Attached File  sdl_1.2.14_directfb_ALARMZ.tar.gz ( 320.66K ) Number of downloads: 129
Attached File  directfb_1.4.16_ALARMZ.tar.gz ( 568.67K ) Number of downloads: 140
 
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st November 2019 - 07:12 AM