docs/README-directfb.md
author Ryan C. Gordon <icculus@icculus.org>
Mon, 29 Oct 2018 20:00:03 -0400
changeset 12369 68c87b40b434
parent 10486 5bf595c48fd4
permissions -rw-r--r--
winmain: Don't use SDL_malloc (or SDL_stack_alloc, which might be malloc).

Otherwise, we are using the allocator before the app can set up its own hooks.

Now we use VirtualAlloc, and WideCharToMultiByte (because SDL_iconv uses
SDL_malloc, too!) to get ready to call into SDL_main.

This also makes console_wmain() call into the same routines as everything
else, so we don't have to deal with those allocations, too. Hopefully we
end up with the same results from GetCommandLine() as we do in wargv.

Fixes Bugzilla #4340.
gabomdq@9023
     1
DirectFB
slouken@10486
     2
========
gabomdq@9023
     3
gabomdq@9023
     4
Supports:
gabomdq@9023
     5
gabomdq@9023
     6
- Hardware YUV overlays
gabomdq@9023
     7
- OpenGL - software only
gabomdq@9023
     8
- 2D/3D accelerations (depends on directfb driver)
gabomdq@9023
     9
- multiple displays
gabomdq@9023
    10
- windows
gabomdq@9023
    11
gabomdq@9023
    12
What you need:
gabomdq@9023
    13
philipp@9066
    14
* DirectFB 1.0.1, 1.2.x, 1.3.0
philipp@9066
    15
* Kernel-Framebuffer support: required: vesafb, radeonfb .... 
philipp@9066
    16
* Mesa 7.0.x	   - optional for OpenGL
gabomdq@9023
    17
gabomdq@9023
    18
/etc/directfbrc
gabomdq@9023
    19
gabomdq@9023
    20
This file should contain the following lines to make
gabomdq@9023
    21
your joystick work and avoid crashes:
gabomdq@9023
    22
------------------------
gabomdq@9023
    23
disable-module=joystick
gabomdq@9023
    24
disable-module=cle266
gabomdq@9023
    25
disable-module=cyber5k
gabomdq@9023
    26
no-linux-input-grab
gabomdq@9023
    27
------------------------
gabomdq@9023
    28
gabomdq@9023
    29
To disable to use x11 backend when DISPLAY variable is found use
gabomdq@9023
    30
gabomdq@9023
    31
export SDL_DIRECTFB_X11_CHECK=0
gabomdq@9023
    32
gabomdq@9023
    33
To disable the use of linux input devices, i.e. multimice/multikeyboard support,
gabomdq@9023
    34
use
gabomdq@9023
    35
gabomdq@9023
    36
export SDL_DIRECTFB_LINUX_INPUT=0
gabomdq@9023
    37
gabomdq@9023
    38
To use hardware accelerated YUV-overlays for YUV-textures, use:
gabomdq@9023
    39
gabomdq@9023
    40
export SDL_DIRECTFB_YUV_DIRECT=1
gabomdq@9023
    41
gabomdq@9023
    42
This is disabled by default. It will only support one 
gabomdq@9023
    43
YUV texture, namely the first. Every other YUV texture will be
gabomdq@9023
    44
rendered in software.
gabomdq@9023
    45
gabomdq@9023
    46
In addition, you may use (directfb-1.2.x)
gabomdq@9023
    47
gabomdq@9023
    48
export SDL_DIRECTFB_YUV_UNDERLAY=1
gabomdq@9023
    49
gabomdq@9023
    50
to make the YUV texture an underlay. This will make the cursor to
gabomdq@9023
    51
be shown.
gabomdq@9023
    52
gabomdq@9023
    53
Simple Window Manager
gabomdq@9023
    54
=====================
gabomdq@9023
    55
gabomdq@9023
    56
The driver has support for a very, very basic window manager you may
gabomdq@9023
    57
want to use when running with "wm=default". Use
gabomdq@9023
    58
gabomdq@9023
    59
export SDL_DIRECTFB_WM=1
gabomdq@9023
    60
gabomdq@9023
    61
to enable basic window borders. In order to have the window title rendered,
gabomdq@9023
    62
you need to have the following font installed:
gabomdq@9023
    63
gabomdq@9023
    64
/usr/share/fonts/truetype/freefont/FreeSans.ttf
gabomdq@9023
    65
gabomdq@9023
    66
OpenGL Support
gabomdq@9023
    67
==============
gabomdq@9023
    68
gabomdq@9023
    69
The following instructions will give you *software* OpenGL. However this
gabomdq@9023
    70
works at least on all directfb supported platforms.
gabomdq@9023
    71
gabomdq@9023
    72
As of this writing 20100802 you need to pull Mesa from git and do the following:
gabomdq@9023
    73
gabomdq@9023
    74
------------------------
gabomdq@9023
    75
git clone git://anongit.freedesktop.org/git/mesa/mesa
gabomdq@9023
    76
cd mesa 
gabomdq@9023
    77
git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a
gabomdq@9023
    78
------------------------
gabomdq@9023
    79
gabomdq@9023
    80
Edit configs/linux-directfb so that the Directories-section looks like
gabomdq@9023
    81
------------------------
gabomdq@9023
    82
# Directories
gabomdq@9023
    83
SRC_DIRS     = mesa glu 
gabomdq@9023
    84
GLU_DIRS     = sgi
gabomdq@9023
    85
DRIVER_DIRS  = directfb
gabomdq@9023
    86
PROGRAM_DIRS = 
gabomdq@9023
    87
------------------------
gabomdq@9023
    88
gabomdq@9023
    89
make linux-directfb
gabomdq@9023
    90
make
gabomdq@9023
    91
gabomdq@9023
    92
echo Installing - please enter sudo pw.
gabomdq@9023
    93
gabomdq@9023
    94
sudo make install INSTALL_DIR=/usr/local/dfb_GL
gabomdq@9023
    95
cd src/mesa/drivers/directfb
gabomdq@9023
    96
make
gabomdq@9023
    97
sudo make install INSTALL_DIR=/usr/local/dfb_GL
gabomdq@9023
    98
------------------------
gabomdq@9023
    99
gabomdq@9023
   100
To run the SDL - testprograms:
gabomdq@9023
   101
gabomdq@9023
   102
export SDL_VIDEODRIVER=directfb
gabomdq@9023
   103
export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib
gabomdq@9023
   104
export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7
gabomdq@9023
   105
gabomdq@9023
   106
./testgl
gabomdq@9023
   107