Mercurial > sdl-ios-xcode
annotate src/joystick/dummy/SDL_sysjoystick.c @ 1554:0ca607a5d173
Fixed bug #84
Date: Sun, 23 Oct 2005 16:39:03 +0200
From: "A. Schmid" <sahib@phreaker.net>
Subject: [SDL] no software surfaces with svgalib driver?
Hi,
I noticed that the SDL (1.2.9) svgalib driver only makes use of linear
addressable (framebuffer) video modes. On older systems (like one of
mine), linear addressable modes are often not available.
Especially for cards with VESA VBE < 2.0 the svgalib vesa driver is
unusable, since VESA only supports framebuffering for VBE 2.0 and later.
The changes necessary to add support for software surfaces seem to be
relatively small. I only had to hack src/video/svga/SDL_svgavideo.c (see
attached patch). The code worked fine for me, but it is no more than a
proof of concept and should be reviewed (probably has a memory leak when
switching modes). It also uses the vgagl library (included in the
svgalib package) and needs to be linked against it.
-Alex
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 19 Mar 2006 12:04:40 +0000 |
parents | d910939febfa |
children | 92947e3a18db |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1167
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
0 | 4 |
5 This library is free software; you can redistribute it and/or | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1167
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
0 | 7 License as published by the Free Software Foundation; either |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1167
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
0 | 9 |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1167
diff
changeset
|
13 Lesser General Public License for more details. |
0 | 14 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1167
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1167
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1167
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 18 |
19 Sam Lantinga | |
252
e8157fcb3114
Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
1402
d910939febfa
Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents:
1361
diff
changeset
|
22 #include "SDL_config.h" |
0 | 23 |
24 /* This is the system specific header for the SDL joystick API */ | |
25 | |
26 #include "SDL_joystick.h" | |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
27 #include "../SDL_sysjoystick.h" |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
28 #include "../SDL_joystick_c.h" |
0 | 29 |
30 /* Function to scan the system for joysticks. | |
31 * This function should set SDL_numjoysticks to the number of available | |
32 * joysticks. Joystick 0 should be the system default joystick. | |
33 * It should return 0, or -1 on an unrecoverable fatal error. | |
34 */ | |
35 int SDL_SYS_JoystickInit(void) | |
36 { | |
37 SDL_numjoysticks = 0; | |
38 return(0); | |
39 } | |
40 | |
41 /* Function to get the device-dependent name of a joystick */ | |
42 const char *SDL_SYS_JoystickName(int index) | |
43 { | |
44 SDL_SetError("Logic error: No joysticks available"); | |
45 return(NULL); | |
46 } | |
47 | |
48 /* Function to open a joystick for use. | |
49 The joystick to open is specified by the index field of the joystick. | |
50 This should fill the nbuttons and naxes fields of the joystick structure. | |
51 It returns 0, or -1 if there is an error. | |
52 */ | |
53 int SDL_SYS_JoystickOpen(SDL_Joystick *joystick) | |
54 { | |
55 SDL_SetError("Logic error: No joysticks available"); | |
56 return(-1); | |
57 } | |
58 | |
59 /* Function to update the state of a joystick - called as a device poll. | |
60 * This function shouldn't update the joystick structure directly, | |
61 * but instead should call SDL_PrivateJoystick*() to deliver events | |
62 * and update joystick device state. | |
63 */ | |
64 void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) | |
65 { | |
66 return; | |
67 } | |
68 | |
69 /* Function to close a joystick after use */ | |
70 void SDL_SYS_JoystickClose(SDL_Joystick *joystick) | |
71 { | |
72 return; | |
73 } | |
74 | |
75 /* Function to perform any system-specific joystick related cleanup */ | |
76 void SDL_SYS_JoystickQuit(void) | |
77 { | |
78 return; | |
79 } | |
80 |