Mercurial > sdl-ios-xcode
annotate test/testloadso.c @ 2226:0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
From: couriersud arcor.de
To: slouken@libsdl.org
Subject: Directfb driver for SDL1.3
Hi,
the attachment contains a patch for a SDL1.3 directfb driver. It supports:
- Renderer "directfb":
Hardware acceleration as supported by the underlying directfb driver. With a
radeon X850, testsprite2 runs at 50% to 70% of OpenGL (X11, dri) performance.
Also supports hardware accelerated yuv overlays. This must be enabled by sett
ing:
export SDL_DIRECTFB_YUV_DIRECT=1
- Renderer "opengl"
Supports software opengl using mesa opengl (make linux-directfb).
Some more information may be found in README.DirectFB
There will certainly still be some bugs, and there is some debug code around.
When I find some time, I will compile against directfb-0.9.25 as distributed
with ubuntu 7.04.
The diff also contains a fix for SDL_LockYUVOverlay fixing a bug in *pixels
and pitches initialization.
Kind regards,
couriersud
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 11 Aug 2007 21:51:19 +0000 |
parents | 2c835d58faad |
children | 9de326b3099c |
rev | line source |
---|---|
2067
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
1 |
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
2 /* Test program to test dynamic loading with the loadso subsystem. |
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
3 */ |
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
4 |
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
5 #include <stdio.h> |
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
6 #include <stdlib.h> |
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
7 |
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
8 #include "SDL.h" |
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
9 |
2120 | 10 typedef int (*fntype) (const char *); |
2067
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
11 |
2120 | 12 int |
13 main(int argc, char *argv[]) | |
2067
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
14 { |
2120 | 15 int retval = 0; |
16 int hello = 0; | |
17 const char *libname = NULL; | |
18 const char *symname = NULL; | |
19 void *lib = NULL; | |
20 fntype fn = NULL; | |
2067
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
21 |
2120 | 22 if (argc != 3) { |
23 const char *app = argv[0]; | |
24 fprintf(stderr, "USAGE: %s <library> <functionname>\n", app); | |
25 fprintf(stderr, " %s --hello <lib with puts()>\n", app); | |
26 return 1; | |
27 } | |
2067
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
28 |
2120 | 29 /* Initialize SDL */ |
30 if (SDL_Init(0) < 0) { | |
31 fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); | |
32 return 2; | |
33 } | |
2067
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
34 |
2120 | 35 if (strcmp(argv[1], "--hello") == 0) { |
36 hello = 1; | |
37 libname = argv[2]; | |
38 symname = "puts"; | |
39 } else { | |
40 libname = argv[1]; | |
41 symname = argv[2]; | |
42 } | |
2067
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
43 |
2120 | 44 lib = SDL_LoadObject(libname); |
45 if (lib == NULL) { | |
46 fprintf(stderr, "SDL_LoadObject('%s') failed: %s\n", | |
47 libname, SDL_GetError()); | |
48 retval = 3; | |
49 } else { | |
50 fn = (fntype) SDL_LoadFunction(lib, symname); | |
51 if (fn == NULL) { | |
52 fprintf(stderr, "SDL_LoadFunction('%s') failed: %s\n", | |
53 symname, SDL_GetError()); | |
54 retval = 4; | |
55 } else { | |
56 printf("Found %s in %s at %p\n", symname, libname, fn); | |
57 if (hello) { | |
58 printf("Calling function...\n"); | |
59 fflush(stdout); | |
60 fn(" HELLO, WORLD!\n"); | |
61 printf("...apparently, we survived. :)\n"); | |
62 printf("Unloading library...\n"); | |
63 fflush(stdout); | |
64 } | |
65 } | |
66 SDL_UnloadObject(lib); | |
67 } | |
68 SDL_Quit(); | |
69 return (0); | |
2067
dcdb175c2829
Merged r2899:2900 from SDL-1.2 branch to trunk: testloadso program.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
70 } |