File: README.markdown

package info (click to toggle)
spring 98.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 41,928 kB
  • ctags: 60,665
  • sloc: cpp: 356,167; ansic: 39,434; python: 12,228; java: 12,203; awk: 5,856; sh: 1,719; xml: 997; perl: 405; php: 253; objc: 194; makefile: 72; sed: 2
file content (41 lines) | stat: -rw-r--r-- 1,266 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# README

These stubs can be used to run OpenGL applications headlessly, ie without
needing X or a graphics card.


## How to use

To use them, instead of linking with `libGL`, `libGLU` and so on,
build the stubs into one or more libraries (eg `glstub.c` -> `libGLstub.a`).
Then link with that/those libraries, and additionally continue linking
with GLEW, but make sure to link __after__ linking with the `glewstub.c` object.

Then, any calls to `gl*` and so on will simply do nothing.

Note that the API is NOT complete, just sufficieint for Spring,
so if you use it with other applications, you may need to stub out
more functions.


## Adding new stubs

Ok, so let us say you link these with your application but it complains that
there is a missing symbol, like `SDL_SomeSymbol`.
What you do is:

* open the corresponding include, for example if it is SDL,
	it might be `/usr/include/SDL/SDL.h`
* search for the appropriate missing function
* copy and paste the function declarataion into the appropriate stub file,
	eg if it is an SDL function, paste it into `sdlstub.c`
* add an empty body for it.

	So you will end up with something like:

		int SDL_SomeSymbol(int some param ){
		   return 0;
		}

* Rebuild your application and hopefully it will work now.