~ubuntu-branches/ubuntu/natty/spring/natty

« back to all changes in this revision

Viewing changes to rts/lib/headlessStubs/README.markdown

  • Committer: Bazaar Package Importer
  • Author(s): Scott Ritchie
  • Date: 2010-09-23 18:56:03 UTC
  • mfrom: (3.1.9 experimental)
  • Revision ID: james.westby@ubuntu.com-20100923185603-st97s5chplo42y7w
Tags: 0.82.5.1+dfsg1-1ubuntu1
* Latest upstream version for online play
* debian/control: Replace (rather than conflict) spring-engine
  - spring-engine will be a dummy package (LP: #612905)
  - also set maintainer to MOTU

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# README
 
2
 
 
3
These stubs can be used to run OpenGL applications headlessly, ie without
 
4
needing X or a graphics card.
 
5
 
 
6
 
 
7
## How to use
 
8
 
 
9
To use them, instead of linking with `libGL`, `libGLU` and so on,
 
10
build the stubs into one or more libraries (eg `glstub.c` -> `libGLstub.a`).
 
11
Then link with that/those libraries, and additionally continue linking
 
12
with GLEW, but make sure to link __after__ linking with the `glewstub.c` object.
 
13
 
 
14
Then, any calls to `gl*` and so on will simply do nothing.
 
15
 
 
16
Note that the API is NOT complete, just sufficieint for Spring,
 
17
so if you use it with other applications, you may need to stub out
 
18
more functions.
 
19
 
 
20
 
 
21
## Adding new stubs
 
22
 
 
23
Ok, so let us say you link these with your application but it complains that
 
24
there is a missing symbol, like `SDL_SomeSymbol`.
 
25
What you do is:
 
26
 
 
27
* open the corresponding include, for example if it is SDL,
 
28
        it might be `/usr/include/SDL/SDL.h`
 
29
* search for the appropriate missing function
 
30
* copy and paste the function declarataion into the appropriate stub file,
 
31
        eg if it is an SDL function, paste it into `sdlstub.c`
 
32
* add an empty body for it.
 
33
 
 
34
        So you will end up with something like:
 
35
 
 
36
                int SDL_SomeSymbol(int some param ){
 
37
                   return 0;
 
38
                }
 
39
 
 
40
* Rebuild your application and hopefully it will work now.
 
41