Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
598471cf
Commit
598471cf
authored
Jul 30, 2010
by
jimtla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Iphone project. Iphone multi-touch is now functional.
parent
c9b9312b
Changes
63
Hide whitespace changes
Inline
Side-by-side
Showing
63 changed files
with
24663 additions
and
6 deletions
+24663
-6
project.pbxproj
Xcode-iPhoneOS/Demos/DemosiPhoneOS.xcodeproj/project.pbxproj
+1
-1
SDL_touch_c.h
src/events/SDL_touch_c.h
+7
-0
SDL_uikitview.h
src/video/uikit/SDL_uikitview.h
+4
-1
SDL_uikitview.m
src/video/uikit/SDL_uikitview.m
+7
-4
Default.png
.../Iphone Test/touchTestIPhone2/touchTestIPhone/Default.png
+0
-0
Icon.png
...est/Iphone Test/touchTestIPhone2/touchTestIPhone/Icon.png
+0
-0
Info.plist
...t/Iphone Test/touchTestIPhone2/touchTestIPhone/Info.plist
+28
-0
SDL.h
...phone Test/touchTestIPhone2/touchTestIPhone/include/SDL.h
+165
-0
SDL_assert.h
...est/touchTestIPhone2/touchTestIPhone/include/SDL_assert.h
+241
-0
SDL_atomic.h
...est/touchTestIPhone2/touchTestIPhone/include/SDL_atomic.h
+216
-0
SDL_audio.h
...Test/touchTestIPhone2/touchTestIPhone/include/SDL_audio.h
+510
-0
SDL_clipboard.h
.../touchTestIPhone2/touchTestIPhone/include/SDL_clipboard.h
+76
-0
SDL_compat.h
...est/touchTestIPhone2/touchTestIPhone/include/SDL_compat.h
+343
-0
SDL_config.h.default
...hTestIPhone2/touchTestIPhone/include/SDL_config.h.default
+47
-0
SDL_config.h.generated
...estIPhone2/touchTestIPhone/include/SDL_config.h.generated
+313
-0
SDL_config.h.in
.../touchTestIPhone2/touchTestIPhone/include/SDL_config.h.in
+312
-0
SDL_config_iphoneos.h
...TestIPhone2/touchTestIPhone/include/SDL_config_iphoneos.h
+155
-0
SDL_config_macosx.h
...chTestIPhone2/touchTestIPhone/include/SDL_config_macosx.h
+165
-0
SDL_config_minimal.h
...hTestIPhone2/touchTestIPhone/include/SDL_config_minimal.h
+68
-0
SDL_config_nintendods.h
...stIPhone2/touchTestIPhone/include/SDL_config_nintendods.h
+121
-0
SDL_config_pandora.h
...hTestIPhone2/touchTestIPhone/include/SDL_config_pandora.h
+127
-0
SDL_config_win32.h
...uchTestIPhone2/touchTestIPhone/include/SDL_config_win32.h
+197
-0
SDL_config_wiz.h
...touchTestIPhone2/touchTestIPhone/include/SDL_config_wiz.h
+126
-0
SDL_copying.h
...st/touchTestIPhone2/touchTestIPhone/include/SDL_copying.h
+21
-0
SDL_cpuinfo.h
...st/touchTestIPhone2/touchTestIPhone/include/SDL_cpuinfo.h
+97
-0
SDL_endian.h
...est/touchTestIPhone2/touchTestIPhone/include/SDL_endian.h
+253
-0
SDL_error.h
...Test/touchTestIPhone2/touchTestIPhone/include/SDL_error.h
+78
-0
SDL_events.h
...est/touchTestIPhone2/touchTestIPhone/include/SDL_events.h
+624
-0
SDL_gesture.h
...st/touchTestIPhone2/touchTestIPhone/include/SDL_gesture.h
+90
-0
SDL_haptic.h
...est/touchTestIPhone2/touchTestIPhone/include/SDL_haptic.h
+1123
-0
SDL_input.h
...Test/touchTestIPhone2/touchTestIPhone/include/SDL_input.h
+88
-0
SDL_joystick.h
...t/touchTestIPhone2/touchTestIPhone/include/SDL_joystick.h
+209
-0
SDL_keyboard.h
...t/touchTestIPhone2/touchTestIPhone/include/SDL_keyboard.h
+170
-0
SDL_keysym.h
...est/touchTestIPhone2/touchTestIPhone/include/SDL_keysym.h
+342
-0
SDL_loadso.h
...est/touchTestIPhone2/touchTestIPhone/include/SDL_loadso.h
+86
-0
SDL_main.h
... Test/touchTestIPhone2/touchTestIPhone/include/SDL_main.h
+96
-0
SDL_mouse.h
...Test/touchTestIPhone2/touchTestIPhone/include/SDL_mouse.h
+205
-0
SDL_mutex.h
...Test/touchTestIPhone2/touchTestIPhone/include/SDL_mutex.h
+223
-0
SDL_name.h
... Test/touchTestIPhone2/touchTestIPhone/include/SDL_name.h
+11
-0
SDL_opengl.h
...est/touchTestIPhone2/touchTestIPhone/include/SDL_opengl.h
+9333
-0
SDL_opengles.h
...t/touchTestIPhone2/touchTestIPhone/include/SDL_opengles.h
+1039
-0
SDL_pixels.h
...est/touchTestIPhone2/touchTestIPhone/include/SDL_pixels.h
+398
-0
SDL_platform.h
...t/touchTestIPhone2/touchTestIPhone/include/SDL_platform.h
+154
-0
SDL_power.h
...Test/touchTestIPhone2/touchTestIPhone/include/SDL_power.h
+80
-0
SDL_quit.h
... Test/touchTestIPhone2/touchTestIPhone/include/SDL_quit.h
+59
-0
SDL_rect.h
... Test/touchTestIPhone2/touchTestIPhone/include/SDL_rect.h
+137
-0
SDL_rwops.h
...Test/touchTestIPhone2/touchTestIPhone/include/SDL_rwops.h
+206
-0
SDL_scancode.h
...t/touchTestIPhone2/touchTestIPhone/include/SDL_scancode.h
+399
-0
SDL_stdinc.h
...est/touchTestIPhone2/touchTestIPhone/include/SDL_stdinc.h
+792
-0
SDL_surface.h
...st/touchTestIPhone2/touchTestIPhone/include/SDL_surface.h
+700
-0
SDL_syswm.h
...Test/touchTestIPhone2/touchTestIPhone/include/SDL_syswm.h
+244
-0
SDL_thread.h
...est/touchTestIPhone2/touchTestIPhone/include/SDL_thread.h
+163
-0
SDL_timer.h
...Test/touchTestIPhone2/touchTestIPhone/include/SDL_timer.h
+153
-0
SDL_touch.h
...Test/touchTestIPhone2/touchTestIPhone/include/SDL_touch.h
+119
-0
SDL_types.h
...Test/touchTestIPhone2/touchTestIPhone/include/SDL_types.h
+30
-0
SDL_version.h
...st/touchTestIPhone2/touchTestIPhone/include/SDL_version.h
+158
-0
SDL_video.h
...Test/touchTestIPhone2/touchTestIPhone/include/SDL_video.h
+1458
-0
begin_code.h
...est/touchTestIPhone2/touchTestIPhone/include/begin_code.h
+136
-0
close_code.h
...est/touchTestIPhone2/touchTestIPhone/include/close_code.h
+38
-0
doxyfile
...ne Test/touchTestIPhone2/touchTestIPhone/include/doxyfile
+1229
-0
libSDLiPhoneOS.a
...est/touchTestIPhone2/touchTestIPhone/lib/libSDLiPhoneOS.a
+1
-0
main.c
...hTest/Iphone Test/touchTestIPhone2/touchTestIPhone/main.c
+422
-0
project.pbxproj
...touchTestIPhone/touchTestIPhone.xcodeproj/project.pbxproj
+270
-0
No files found.
Xcode-iPhoneOS/Demos/DemosiPhoneOS.xcodeproj/project.pbxproj
View file @
598471cf
...
@@ -109,7 +109,7 @@
...
@@ -109,7 +109,7 @@
isa
=
PBXContainerItemProxy
;
isa
=
PBXContainerItemProxy
;
containerPortal
=
FD1B48920E313154007AB34E
/* SDLiPhoneOS.xcodeproj */
;
containerPortal
=
FD1B48920E313154007AB34E
/* SDLiPhoneOS.xcodeproj */
;
proxyType
=
2
;
proxyType
=
2
;
remoteGlobalIDString
=
006E982211955059001DE610
/* testsdl.app */
;
remoteGlobalIDString
=
006E982211955059001DE610
;
remoteInfo
=
testsdl
;
remoteInfo
=
testsdl
;
};
};
FD1B489D0E313154007AB34E
/* PBXContainerItemProxy */
=
{
FD1B489D0E313154007AB34E
/* PBXContainerItemProxy */
=
{
...
...
src/events/SDL_touch_c.h
View file @
598471cf
...
@@ -58,6 +58,10 @@ extern void SDL_SetTouchFocus(long id, SDL_Window * window);
...
@@ -58,6 +58,10 @@ extern void SDL_SetTouchFocus(long id, SDL_Window * window);
extern
int
SDL_SendTouchMotion
(
long
id
,
long
fingerid
,
extern
int
SDL_SendTouchMotion
(
long
id
,
long
fingerid
,
int
relative
,
float
x
,
float
y
,
float
z
);
int
relative
,
float
x
,
float
y
,
float
z
);
/* Send a touch down/up event for a touch */
extern
int
SDL_SendFingerDown
(
long
id
,
long
fingerid
,
SDL_bool
down
,
float
x
,
float
y
,
float
pressure
);
/* Send a touch button event for a touch */
/* Send a touch button event for a touch */
extern
int
SDL_SendTouchButton
(
long
id
,
Uint8
state
,
Uint8
button
);
extern
int
SDL_SendTouchButton
(
long
id
,
Uint8
state
,
Uint8
button
);
...
@@ -67,6 +71,9 @@ extern void SDL_TouchQuit(void);
...
@@ -67,6 +71,9 @@ extern void SDL_TouchQuit(void);
/* Get the index of a touch device */
/* Get the index of a touch device */
extern
int
SDL_GetTouchIndexId
(
long
id
);
extern
int
SDL_GetTouchIndexId
(
long
id
);
/* Print a debug message for a nonexistent touch */
extern
int
SDL_TouchNotFoundError
(
long
id
);
#endif
/* _SDL_touch_c_h */
#endif
/* _SDL_touch_c_h */
/* vi: set ts=4 sw=4 expandtab: */
/* vi: set ts=4 sw=4 expandtab: */
src/video/uikit/SDL_uikitview.h
View file @
598471cf
...
@@ -23,6 +23,9 @@
...
@@ -23,6 +23,9 @@
#include "SDL_stdinc.h"
#include "SDL_stdinc.h"
#include "SDL_events.h"
#include "SDL_events.h"
#define IPHONE_TOUCH_EFFICIENT_DANGEROUS
#define FIXED_MULTITOUCH
#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
#define MAX_SIMULTANEOUS_TOUCHES 5
#define MAX_SIMULTANEOUS_TOUCHES 5
#endif
#endif
...
@@ -34,7 +37,7 @@
...
@@ -34,7 +37,7 @@
@interface
SDL_uikitview
:
UIView
{
@interface
SDL_uikitview
:
UIView
{
#endif
#endif
#if FIXED_MULTITOUCH
#if
def
FIXED_MULTITOUCH
long
touchId
;
long
touchId
;
#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
UITouch
*
finger
[
MAX_SIMULTANEOUS_TOUCHES
];
UITouch
*
finger
[
MAX_SIMULTANEOUS_TOUCHES
];
...
...
src/video/uikit/SDL_uikitview.m
View file @
598471cf
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include "../../events/SDL_keyboard_c.h"
#include "../../events/SDL_keyboard_c.h"
#include "../../events/SDL_mouse_c.h"
#include "../../events/SDL_mouse_c.h"
#include "../../events/SDL_touch_c.h"
#if SDL_IPHONE_KEYBOARD
#if SDL_IPHONE_KEYBOARD
#import "keyinfotable.h"
#import "keyinfotable.h"
...
@@ -48,7 +49,7 @@
...
@@ -48,7 +49,7 @@
[
self
initializeKeyboard
];
[
self
initializeKeyboard
];
#endif
#endif
#if FIXED_MULTITOUCH
#if
def
FIXED_MULTITOUCH
SDL_Touch
touch
;
SDL_Touch
touch
;
touch
.
id
=
0
;
//TODO: Should be -1?
touch
.
id
=
0
;
//TODO: Should be -1?
...
@@ -78,6 +79,8 @@
...
@@ -78,6 +79,8 @@
NSEnumerator
*
enumerator
=
[
touches
objectEnumerator
];
NSEnumerator
*
enumerator
=
[
touches
objectEnumerator
];
UITouch
*
touch
=
(
UITouch
*
)[
enumerator
nextObject
];
UITouch
*
touch
=
(
UITouch
*
)[
enumerator
nextObject
];
//NSLog("Click");
if
(
touch
)
{
if
(
touch
)
{
CGPoint
locationInView
=
[
touch
locationInView
:
self
];
CGPoint
locationInView
=
[
touch
locationInView
:
self
];
...
@@ -88,7 +91,7 @@
...
@@ -88,7 +91,7 @@
SDL_SendMouseButton
(
NULL
,
SDL_PRESSED
,
SDL_BUTTON_LEFT
);
SDL_SendMouseButton
(
NULL
,
SDL_PRESSED
,
SDL_BUTTON_LEFT
);
}
}
#if FIXED_MULTITOUCH
#if
def
FIXED_MULTITOUCH
while
(
touch
)
{
while
(
touch
)
{
CGPoint
locationInView
=
[
touch
locationInView
:
self
];
CGPoint
locationInView
=
[
touch
locationInView
:
self
];
...
@@ -131,7 +134,7 @@
...
@@ -131,7 +134,7 @@
SDL_SendMouseButton
(
NULL
,
SDL_RELEASED
,
SDL_BUTTON_LEFT
);
SDL_SendMouseButton
(
NULL
,
SDL_RELEASED
,
SDL_BUTTON_LEFT
);
}
}
#if FIXED_MULTITOUCH
#if
def
FIXED_MULTITOUCH
while
(
touch
)
{
while
(
touch
)
{
CGPoint
locationInView
=
[
touch
locationInView
:
self
];
CGPoint
locationInView
=
[
touch
locationInView
:
self
];
...
@@ -178,7 +181,7 @@
...
@@ -178,7 +181,7 @@
SDL_SendMouseMotion
(
NULL
,
0
,
locationInView
.
x
,
locationInView
.
y
);
SDL_SendMouseMotion
(
NULL
,
0
,
locationInView
.
x
,
locationInView
.
y
);
}
}
#if FIXED_MULTITOUCH
#if
def
FIXED_MULTITOUCH
while
(
touch
)
{
while
(
touch
)
{
CGPoint
locationInView
=
[
touch
locationInView
:
self
];
CGPoint
locationInView
=
[
touch
locationInView
:
self
];
...
...
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/Default.png
0 → 100644
View file @
598471cf
18 KB
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/Icon.png
0 → 100644
View file @
598471cf
2.35 KB
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/Info.plist
0 → 100644
View file @
598471cf
<
?xml
v
e
rsion="
1
.
0
"
e
n
c
o
d
ing="UT
F
-
8
"?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
en
<
/string
>
<
k
e
y
>
CFBundleDisplayName
<
/k
e
y
>
<
string
>
$
{
PRODUCT_NAME
}<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
$
{
EXECUTABLE_NAME
}<
/string
>
<
k
e
y
>
CFBundleIconFile
<
/k
e
y
>
<
string
>
Icon
<
/string
>
<
k
e
y
>
CFBundleIdentifier
<
/k
e
y
>
<
string
>
com.yourcompany.$
{
PRODUCT_NAME:identifier
}<
/string
>
<
k
e
y
>
CFBundleInfoDictionaryVersion
<
/k
e
y
>
<
string
>
6.0
<
/string
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
$
{
PRODUCT_NAME
}<
/string
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1.0
<
/string
>
<
k
e
y
>
LSRequiresIPhoneOS
<
/k
e
y
>
<
fa
ls
e
/
>
<
/
d
i
c
t
>
<
/plist
>
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL.h
*
* Main include header for the SDL library
*/
/**
* \mainpage Simple DirectMedia Layer (SDL)
*
* http://www.libsdl.org/
*
* \section intro_sec Introduction
*
* This is the Simple DirectMedia Layer, a general API that provides low
* level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
* and 2D framebuffer across multiple platforms.
*
* The current version supports Windows, Windows CE, Mac OS X, Linux,
* FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, and QNX. The code contains
* support for other operating systems but those are not officially supported.
*
* SDL is written in C, but works with C++ natively, and has bindings to
* several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
* Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
* Pike, Pliant, Python, Ruby, and Smalltalk.
*
* This library is distributed under GNU LGPL version 2, which can be
* found in the file "COPYING". This license allows you to use SDL
* freely in commercial programs as long as you link with the dynamic
* library.
*
* The best way to learn how to use SDL is to check out the header files in
* the "include" subdirectory and the programs in the "test" subdirectory.
* The header files and test programs are well commented and always up to date.
* More documentation is available in HTML format in "docs/index.html", and
* a documentation wiki is available online at:
* http://www.libsdl.org/cgi/docwiki.cgi
*
* The test programs in the "test" subdirectory are in the public domain.
*
* Frequently asked questions are answered online:
* http://www.libsdl.org/faq.php
*
* If you need help with the library, or just want to discuss SDL related
* issues, you can join the developers mailing list:
* http://www.libsdl.org/mailing-list.php
*
* Enjoy!
* Sam Lantinga (slouken@libsdl.org)
*/
#ifndef _SDL_H
#define _SDL_H
#include "SDL_main.h"
#include "SDL_stdinc.h"
#include "SDL_atomic.h"
#include "SDL_audio.h"
#include "SDL_clipboard.h"
#include "SDL_cpuinfo.h"
#include "SDL_endian.h"
#include "SDL_error.h"
#include "SDL_events.h"
#include "SDL_loadso.h"
#include "SDL_mutex.h"
#include "SDL_power.h"
#include "SDL_rwops.h"
#include "SDL_thread.h"
#include "SDL_timer.h"
#include "SDL_version.h"
#include "SDL_video.h"
#include "SDL_compat.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/* As of version 0.5, SDL is loaded dynamically into the application */
/**
* \name SDL_INIT_*
*
* These are the flags which may be passed to SDL_Init(). You should
* specify the subsystems which you will be using in your application.
*/
/*@{*/
#define SDL_INIT_TIMER 0x00000001
#define SDL_INIT_AUDIO 0x00000010
#define SDL_INIT_VIDEO 0x00000020
#define SDL_INIT_JOYSTICK 0x00000200
#define SDL_INIT_HAPTIC 0x00001000
#define SDL_INIT_NOPARACHUTE 0x00100000
/**< Don't catch fatal signals */
#define SDL_INIT_EVENTTHREAD 0x01000000
/**< Not supported on all OS's */
#define SDL_INIT_EVERYTHING 0x0000FFFF
/*@}*/
/**
* This function loads the SDL dynamically linked library and initializes
* the subsystems specified by \c flags (and those satisfying dependencies).
* Unless the ::SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
* signal handlers for some commonly ignored fatal signals (like SIGSEGV).
*/
extern
DECLSPEC
int
SDLCALL
SDL_Init
(
Uint32
flags
);
/**
* This function initializes specific SDL subsystems
*/
extern
DECLSPEC
int
SDLCALL
SDL_InitSubSystem
(
Uint32
flags
);
/**
* This function cleans up specific SDL subsystems
*/
extern
DECLSPEC
void
SDLCALL
SDL_QuitSubSystem
(
Uint32
flags
);
/**
* This function returns mask of the specified subsystems which have
* been initialized.
*
* If \c flags is 0, it returns a mask of all initialized subsystems.
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_WasInit
(
Uint32
flags
);
/**
* This function cleans up all initialized subsystems and unloads the
* dynamically linked library. You should call it upon all exit conditions.
*/
extern
DECLSPEC
void
SDLCALL
SDL_Quit
(
void
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_H */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_assert.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_assert_h
#define _SDL_assert_h
#include "SDL_config.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
#ifndef SDL_ASSERT_LEVEL
#ifdef SDL_DEFAULT_ASSERT_LEVEL
#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
#elif defined(_DEBUG) || defined(DEBUG) || \
(defined(__GNUC__) && !defined(__OPTIMIZE__))
#define SDL_ASSERT_LEVEL 2
#else
#define SDL_ASSERT_LEVEL 1
#endif
#endif
/* SDL_ASSERT_LEVEL */
/*
These are macros and not first class functions so that the debugger breaks
on the assertion line and not in some random guts of SDL, and so each
assert can have unique static variables associated with it.
*/
#if (defined(_MSC_VER) && ((_M_IX86) || (_M_X64)))
#define SDL_TriggerBreakpoint() __asm { int 3 }
#elif (defined(__GNUC__) && ((__i386__) || (__x86_64__)))
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
#elif defined(HAVE_SIGNAL_H)
#include <signal.h>
#define SDL_TriggerBreakpoint() raise(SIGTRAP)
#else
/* How do we trigger breakpoints on this platform? */
#define SDL_TriggerBreakpoint()
#endif
#if (__STDC_VERSION__ >= 199901L)
/* C99 supports __func__ as a standard. */
# define SDL_FUNCTION __func__
#elif ((__GNUC__ >= 2) || defined(_MSC_VER))
# define SDL_FUNCTION __FUNCTION__
#else
# define SDL_FUNCTION "???"
#endif
#define SDL_FILE __FILE__
#define SDL_LINE __LINE__
/*
sizeof (x) makes the compiler still parse the expression even without
assertions enabled, so the code is always checked at compile time, but
doesn't actually generate code for it, so there are no side effects or
expensive checks at run time, just the constant size of what x WOULD be,
which presumably gets optimized out as unused.
This also solves the problem of...
int somevalue = blah();
SDL_assert(somevalue == 1);
...which would cause compiles to complain that somevalue is unused if we
disable assertions.
*/
#define SDL_disabled_assert(condition) \
do { (void) sizeof ((condition)); } while (0)
#if (SDL_ASSERT_LEVEL > 0)
typedef
enum
{
SDL_ASSERTION_RETRY
,
/**< Retry the assert immediately. */
SDL_ASSERTION_BREAK
,
/**< Make the debugger trigger a breakpoint. */
SDL_ASSERTION_ABORT
,
/**< Terminate the program. */
SDL_ASSERTION_IGNORE
,
/**< Ignore the assert. */
SDL_ASSERTION_ALWAYS_IGNORE
,
/**< Ignore the assert from now on. */
}
SDL_assert_state
;
typedef
struct
SDL_assert_data
{
int
always_ignore
;
unsigned
int
trigger_count
;
const
char
*
condition
;
const
char
*
filename
;
int
linenum
;
const
char
*
function
;
const
struct
SDL_assert_data
*
next
;
}
SDL_assert_data
;
/* Never call this directly. Use the SDL_assert* macros. */
extern
DECLSPEC
SDL_assert_state
SDLCALL
SDL_ReportAssertion
(
SDL_assert_data
*
,
const
char
*
,
const
char
*
,
int
);
/* the do {} while(0) avoids dangling else problems:
if (x) SDL_assert(y); else blah();
... without the do/while, the "else" could attach to this macro's "if".
We try to handle just the minimum we need here in a macro...the loop,
the static vars, and break points. The heavy lifting is handled in
SDL_ReportAssertion(), in SDL_assert.c.
*/
#define SDL_enabled_assert(condition) \
do { \
while ( !(condition) ) { \
static struct SDL_assert_data assert_data = { \
0, 0, #condition, 0, 0, 0, 0 \
}; \
const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \
SDL_FUNCTION, \
SDL_FILE, \
SDL_LINE); \
if (state == SDL_ASSERTION_RETRY) { \
continue;
/* go again. */
\
} else if (state == SDL_ASSERTION_BREAK) { \
SDL_TriggerBreakpoint(); \
} \
break;
/* not retrying. */
\
} \
} while (0)
#endif
/* enabled assertions support code */
/* Enable various levels of assertions. */
#if SDL_ASSERT_LEVEL == 0
/* assertions disabled */
# define SDL_assert(condition) SDL_disabled_assert(condition)
# define SDL_assert_release(condition) SDL_disabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 1
/* release settings. */
# define SDL_assert(condition) SDL_disabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 2
/* normal settings. */
# define SDL_assert(condition) SDL_enabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 3
/* paranoid settings. */
# define SDL_assert(condition) SDL_enabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)
#else
# error Unknown assertion level.
#endif
typedef
SDL_assert_state
(
SDLCALL
*
SDL_AssertionHandler
)(
const
SDL_assert_data
*
,
void
*
userdata
);
/**
* \brief Set an application-defined assertion handler.
*
* This allows an app to show its own assertion UI and/or force the
* response to an assertion failure. If the app doesn't provide this, SDL
* will try to do the right thing, popping up a system-specific GUI dialog,
* and probably minimizing any fullscreen windows.
*
* This callback may fire from any thread, but it runs wrapped in a mutex, so
* it will only fire from one thread at a time.
*
* Setting the callback to NULL restores SDL's original internal handler.
*
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
*
* \return SDL_assert_state value of how to handle the assertion failure.
*
* \param handler Callback function, called when an assertion fails.
* \param userdata A pointer passed to the callback as-is.
*/
extern
DECLSPEC
void
SDLCALL
SDL_SetAssertionHandler
(
SDL_AssertionHandler
handler
,
void
*
userdata
);
/**
* \brief Get a list of all assertion failures.
*
* Get all assertions triggered since last call to SDL_ResetAssertionReport(),
* or the start of the program.
*
* The proper way to examine this data looks something like this:
*
* <code>
* const SDL_assert_data *item = SDL_GetAssertionReport();
* while (item->condition) {
* printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n",
* item->condition, item->function, item->filename,
* item->linenum, item->trigger_count,
* item->always_ignore ? "yes" : "no");
* item = item->next;
* }
* </code>
*
* \return List of all assertions. This never returns NULL,
* even if there are no items.
* \sa SDL_ResetAssertionReport
*/
extern
DECLSPEC
const
SDL_assert_data
*
SDLCALL
SDL_GetAssertionReport
(
void
);
/**
* \brief Reset the list of all assertion failures.
*
* Reset list of all assertions triggered.
*
* \sa SDL_GetAssertionReport
*/
extern
DECLSPEC
void
SDLCALL
SDL_ResetAssertionReport
(
void
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_assert_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_atomic.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
Contributed by Bob Pendleton, bob@pendleton.com
*/
/**
* \file SDL_atomic.h
*
* Atomic operations.
*
* These operations may, or may not, actually be implemented using
* processor specific atomic operations. When possible they are
* implemented as true processor specific atomic operations. When that
* is not possible the are implemented using locks that *do* use the
* available atomic operations.
*
* At the very minimum spin locks must be implemented. Without spin
* locks it is not possible (AFAICT) to emulate the rest of the atomic
* operations.
*/
#ifndef _SDL_atomic_h_
#define _SDL_atomic_h_
#include "SDL_stdinc.h"
#include "SDL_platform.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/* Function prototypes */
/**
* \name SDL AtomicLock
*
* The spin lock functions and type are required and can not be
* emulated because they are used in the emulation code.
*/
/*@{*/
typedef
volatile
Uint32
SDL_SpinLock
;
/**
* \brief Lock a spin lock by setting it to a none zero value.
*
* \param lock Points to the lock.
*/
extern
DECLSPEC
void
SDLCALL
SDL_AtomicLock
(
SDL_SpinLock
*
lock
);
/**
* \brief Unlock a spin lock by setting it to 0. Always returns immediately
*
* \param lock Points to the lock.
*/
extern
DECLSPEC
void
SDLCALL
SDL_AtomicUnlock
(
SDL_SpinLock
*
lock
);
/*@}*//*SDL AtomicLock*/
/**
* \name 32 bit atomic operations
*/
/*@{*/
/**
* \brief Check to see if \c *ptr == 0 and set it to 1.
*
* \return SDL_True if the value pointed to by \c ptr was zero and
* SDL_False if it was not zero
*
* \param ptr Points to the value to be tested and set.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_AtomicTestThenSet32
(
volatile
Uint32
*
ptr
);
/**
* \brief Set the value pointed to by \c ptr to be zero.
*
* \param ptr Address of the value to be set to zero
*/
extern
DECLSPEC
void
SDLCALL
SDL_AtomicClear32
(
volatile
Uint32
*
ptr
);
/**
* \brief Fetch the current value of \c *ptr and then increment that
* value in place.
*
* \return The value before it was incremented.
*
* \param ptr Address of the value to fetch and increment
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_AtomicFetchThenIncrement32
(
volatile
Uint32
*
ptr
);
/**
* \brief Fetch \c *ptr and then decrement the value in place.
*
* \return The value before it was decremented.
*
* \param ptr Address of the value to fetch and decrement
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_AtomicFetchThenDecrement32
(
volatile
Uint32
*
ptr
);
/**
* \brief Fetch the current value at \c ptr and then add \c value to \c *ptr.
*
* \return \c *ptr before the addition took place.
*
* \param ptr The address of data we are changing.
* \param value The value to add to \c *ptr.
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_AtomicFetchThenAdd32
(
volatile
Uint32
*
ptr
,
Uint32
value
);
/**
* \brief Fetch \c *ptr and then subtract \c value from it.
*
* \return \c *ptr before the subtraction took place.
*
* \param ptr The address of the data being changed.
* \param value The value to subtract from \c *ptr.
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_AtomicFetchThenSubtract32
(
volatile
Uint32
*
ptr
,
Uint32
value
);
/**
* \brief Add one to the data pointed to by \c ptr and return that value.
*
* \return The incremented value.
*
* \param ptr The address of the data to increment.
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_AtomicIncrementThenFetch32
(
volatile
Uint32
*
ptr
);
/**
* \brief Subtract one from data pointed to by \c ptr and return the new value.
*
* \return The decremented value.
*
* \param ptr The address of the data to decrement.
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_AtomicDecrementThenFetch32
(
volatile
Uint32
*
ptr
);
/**
* \brief Add \c value to the data pointed to by \c ptr and return result.
*
* \return The sum of \c *ptr and \c value.
*
* \param ptr The address of the data to be modified.
* \param value The value to be added.
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_AtomicAddThenFetch32
(
volatile
Uint32
*
ptr
,
Uint32
value
);
/**
* \brief Subtract \c value from the data pointed to by \c ptr and return the result.
*
* \return The difference between \c *ptr and \c value.
*
* \param ptr The address of the data to be modified.
* \param value The value to be subtracted.
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_AtomicSubtractThenFetch32
(
volatile
Uint32
*
ptr
,
Uint32
value
);
/*@}*//*32 bit atomic operations*/
/**
* \name 64 bit atomic operations
*/
/*@{*/
#ifdef SDL_HAS_64BIT_TYPE
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_AtomicTestThenSet64
(
volatile
Uint64
*
ptr
);
extern
DECLSPEC
void
SDLCALL
SDL_AtomicClear64
(
volatile
Uint64
*
ptr
);
extern
DECLSPEC
Uint64
SDLCALL
SDL_AtomicFetchThenIncrement64
(
volatile
Uint64
*
ptr
);
extern
DECLSPEC
Uint64
SDLCALL
SDL_AtomicFetchThenDecrement64
(
volatile
Uint64
*
ptr
);
extern
DECLSPEC
Uint64
SDLCALL
SDL_AtomicFetchThenAdd64
(
volatile
Uint64
*
ptr
,
Uint64
value
);
extern
DECLSPEC
Uint64
SDLCALL
SDL_AtomicFetchThenSubtract64
(
volatile
Uint64
*
ptr
,
Uint64
value
);
extern
DECLSPEC
Uint64
SDLCALL
SDL_AtomicIncrementThenFetch64
(
volatile
Uint64
*
ptr
);
extern
DECLSPEC
Uint64
SDLCALL
SDL_AtomicDecrementThenFetch64
(
volatile
Uint64
*
ptr
);
extern
DECLSPEC
Uint64
SDLCALL
SDL_AtomicAddThenFetch64
(
volatile
Uint64
*
ptr
,
Uint64
value
);
extern
DECLSPEC
Uint64
SDLCALL
SDL_AtomicSubtractThenFetch64
(
volatile
Uint64
*
ptr
,
Uint64
value
);
#endif
/* SDL_HAS_64BIT_TYPE */
/*@}*//*64 bit atomic operations*/
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_atomic_h_ */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_audio.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_audio.h
*
* Access to the raw audio mixing buffer for the SDL library.
*/
#ifndef _SDL_audio_h
#define _SDL_audio_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_endian.h"
#include "SDL_mutex.h"
#include "SDL_thread.h"
#include "SDL_rwops.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* \brief Audio format flags.
*
* These are what the 16 bits in SDL_AudioFormat currently mean...
* (Unspecified bits are always zero).
*
* \verbatim
++-----------------------sample is signed if set
||
|| ++-----------sample is bigendian if set
|| ||
|| || ++---sample is float if set
|| || ||
|| || || +---sample bit size---+
|| || || | |
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
\endverbatim
*
* There are macros in SDL 1.3 and later to query these bits.
*/
typedef
Uint16
SDL_AudioFormat
;
/**
* \name Audio flags
*/
/*@{*/
#define SDL_AUDIO_MASK_BITSIZE (0xFF)
#define SDL_AUDIO_MASK_DATATYPE (1<<8)
#define SDL_AUDIO_MASK_ENDIAN (1<<12)
#define SDL_AUDIO_MASK_SIGNED (1<<15)
#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE)
#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE)
#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN)
#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED)
#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x))
#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x))
#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x))
/**
* \name Audio format flags
*
* Defaults to LSB byte order.
*/
/*@{*/
#define AUDIO_U8 0x0008
/**< Unsigned 8-bit samples */
#define AUDIO_S8 0x8008
/**< Signed 8-bit samples */
#define AUDIO_U16LSB 0x0010
/**< Unsigned 16-bit samples */
#define AUDIO_S16LSB 0x8010
/**< Signed 16-bit samples */
#define AUDIO_U16MSB 0x1010
/**< As above, but big-endian byte order */
#define AUDIO_S16MSB 0x9010
/**< As above, but big-endian byte order */
#define AUDIO_U16 AUDIO_U16LSB
#define AUDIO_S16 AUDIO_S16LSB
/*@}*/
/**
* \name int32 support
*
* New to SDL 1.3.
*/
/*@{*/
#define AUDIO_S32LSB 0x8020
/**< 32-bit integer samples */
#define AUDIO_S32MSB 0x9020
/**< As above, but big-endian byte order */
#define AUDIO_S32 AUDIO_S32LSB
/*@}*/
/**
* \name float32 support
*
* New to SDL 1.3.
*/
/*@{*/
#define AUDIO_F32LSB 0x8120
/**< 32-bit floating point samples */
#define AUDIO_F32MSB 0x9120
/**< As above, but big-endian byte order */
#define AUDIO_F32 AUDIO_F32LSB
/*@}*/
/**
* \name Native audio byte ordering
*/
/*@{*/
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define AUDIO_U16SYS AUDIO_U16LSB
#define AUDIO_S16SYS AUDIO_S16LSB
#define AUDIO_S32SYS AUDIO_S32LSB
#define AUDIO_F32SYS AUDIO_F32LSB
#else
#define AUDIO_U16SYS AUDIO_U16MSB
#define AUDIO_S16SYS AUDIO_S16MSB
#define AUDIO_S32SYS AUDIO_S32MSB
#define AUDIO_F32SYS AUDIO_F32MSB
#endif
/*@}*/
/**
* \name Allow change flags
*
* Which audio format changes are allowed when opening a device.
*/
/*@{*/
#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001
#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002
#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004
#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE)
/*@}*/
/*@}*//*Audio flags*/
/**
* This function is called when the audio device needs more data.
*
* \param userdata An application-specific parameter saved in
* the SDL_AudioSpec structure
* \param stream A pointer to the audio data buffer.
* \param len The length of that buffer in bytes.
*
* Once the callback returns, the buffer will no longer be valid.
* Stereo samples are stored in a LRLRLR ordering.
*/
typedef
void
(
SDLCALL
*
SDL_AudioCallback
)
(
void
*
userdata
,
Uint8
*
stream
,
int
len
);
/**
* The calculated values in this structure are calculated by SDL_OpenAudio().
*/
typedef
struct
SDL_AudioSpec
{
int
freq
;
/**< DSP frequency -- samples per second */
SDL_AudioFormat
format
;
/**< Audio data format */
Uint8
channels
;
/**< Number of channels: 1 mono, 2 stereo */
Uint8
silence
;
/**< Audio buffer silence value (calculated) */
Uint16
samples
;
/**< Audio buffer size in samples (power of 2) */
Uint16
padding
;
/**< Necessary for some compile environments */
Uint32
size
;
/**< Audio buffer size in bytes (calculated) */
SDL_AudioCallback
callback
;
void
*
userdata
;
}
SDL_AudioSpec
;
struct
SDL_AudioCVT
;
typedef
void
(
SDLCALL
*
SDL_AudioFilter
)
(
struct
SDL_AudioCVT
*
cvt
,
SDL_AudioFormat
format
);
/**
* A structure to hold a set of audio conversion filters and buffers.
*/
typedef
struct
SDL_AudioCVT
{
int
needed
;
/**< Set to 1 if conversion possible */
SDL_AudioFormat
src_format
;
/**< Source audio format */
SDL_AudioFormat
dst_format
;
/**< Target audio format */
double
rate_incr
;
/**< Rate conversion increment */
Uint8
*
buf
;
/**< Buffer to hold entire audio data */
int
len
;
/**< Length of original audio buffer */
int
len_cvt
;
/**< Length of converted audio buffer */
int
len_mult
;
/**< buffer must be len*len_mult big */
double
len_ratio
;
/**< Given len, final size is len*len_ratio */
SDL_AudioFilter
filters
[
10
];
/**< Filter list */
int
filter_index
;
/**< Current audio conversion function */
}
SDL_AudioCVT
;
/* Function prototypes */
/**
* \name Driver discovery functions
*
* These functions return the list of built in audio drivers, in the
* order that they are normally initialized by default.
*/
/*@{*/
extern
DECLSPEC
int
SDLCALL
SDL_GetNumAudioDrivers
(
void
);
extern
DECLSPEC
const
char
*
SDLCALL
SDL_GetAudioDriver
(
int
index
);
/*@}*/
/**
* \name Initialization and cleanup
*
* \internal These functions are used internally, and should not be used unless
* you have a specific need to specify the audio driver you want to
* use. You should normally use SDL_Init() or SDL_InitSubSystem().
*/
/*@{*/
extern
DECLSPEC
int
SDLCALL
SDL_AudioInit
(
const
char
*
driver_name
);
extern
DECLSPEC
void
SDLCALL
SDL_AudioQuit
(
void
);
/*@}*/
/**
* This function returns the name of the current audio driver, or NULL
* if no driver has been initialized.
*/
extern
DECLSPEC
const
char
*
SDLCALL
SDL_GetCurrentAudioDriver
(
void
);
/**
* This function opens the audio device with the desired parameters, and
* returns 0 if successful, placing the actual hardware parameters in the
* structure pointed to by \c obtained. If \c obtained is NULL, the audio
* data passed to the callback function will be guaranteed to be in the
* requested format, and will be automatically converted to the hardware
* audio format if necessary. This function returns -1 if it failed
* to open the audio device, or couldn't set up the audio thread.
*
* When filling in the desired audio spec structure,
* - \c desired->freq should be the desired audio frequency in samples-per-
* second.
* - \c desired->format should be the desired audio format.
* - \c desired->samples is the desired size of the audio buffer, in
* samples. This number should be a power of two, and may be adjusted by
* the audio driver to a value more suitable for the hardware. Good values
* seem to range between 512 and 8096 inclusive, depending on the
* application and CPU speed. Smaller values yield faster response time,
* but can lead to underflow if the application is doing heavy processing
* and cannot fill the audio buffer in time. A stereo sample consists of
* both right and left channels in LR ordering.
* Note that the number of samples is directly related to time by the
* following formula: \code ms = (samples*1000)/freq \endcode
* - \c desired->size is the size in bytes of the audio buffer, and is
* calculated by SDL_OpenAudio().
* - \c desired->silence is the value used to set the buffer to silence,
* and is calculated by SDL_OpenAudio().
* - \c desired->callback should be set to a function that will be called
* when the audio device is ready for more data. It is passed a pointer
* to the audio buffer, and the length in bytes of the audio buffer.
* This function usually runs in a separate thread, and so you should
* protect data structures that it accesses by calling SDL_LockAudio()
* and SDL_UnlockAudio() in your code.
* - \c desired->userdata is passed as the first parameter to your callback
* function.
*
* The audio device starts out playing silence when it's opened, and should
* be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready
* for your audio callback function to be called. Since the audio driver
* may modify the requested size of the audio buffer, you should allocate
* any local mixing buffers after you open the audio device.
*/
extern
DECLSPEC
int
SDLCALL
SDL_OpenAudio
(
SDL_AudioSpec
*
desired
,
SDL_AudioSpec
*
obtained
);
/**
* SDL Audio Device IDs.
*
* A successful call to SDL_OpenAudio() is always device id 1, and legacy
* SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
* always returns devices >= 2 on success. The legacy calls are good both
* for backwards compatibility and when you don't care about multiple,
* specific, or capture devices.
*/
typedef
Uint32
SDL_AudioDeviceID
;
/**
* Get the number of available devices exposed by the current driver.
* Only valid after a successfully initializing the audio subsystem.
* Returns -1 if an explicit list of devices can't be determined; this is
* not an error. For example, if SDL is set up to talk to a remote audio
* server, it can't list every one available on the Internet, but it will
* still allow a specific host to be specified to SDL_OpenAudioDevice().
*
* In many common cases, when this function returns a value <= 0, it can still
* successfully open the default device (NULL for first argument of
* SDL_OpenAudioDevice()).
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetNumAudioDevices
(
int
iscapture
);
/**
* Get the human-readable name of a specific audio device.
* Must be a value between 0 and (number of audio devices-1).
* Only valid after a successfully initializing the audio subsystem.
* The values returned by this function reflect the latest call to
* SDL_GetNumAudioDevices(); recall that function to redetect available
* hardware.
*
* The string returned by this function is UTF-8 encoded, read-only, and
* managed internally. You are not to free it. If you need to keep the
* string for any length of time, you should make your own copy of it, as it
* will be invalid next time any of several other SDL functions is called.
*/
extern
DECLSPEC
const
char
*
SDLCALL
SDL_GetAudioDeviceName
(
int
index
,
int
iscapture
);
/**
* Open a specific audio device. Passing in a device name of NULL requests
* the most reasonable default (and is equivalent to calling SDL_OpenAudio()).
*
* The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but
* some drivers allow arbitrary and driver-specific strings, such as a
* hostname/IP address for a remote audio server, or a filename in the
* diskaudio driver.
*
* \return 0 on error, a valid device ID that is >= 2 on success.
*
* SDL_OpenAudio(), unlike this function, always acts on device ID 1.
*/
extern
DECLSPEC
SDL_AudioDeviceID
SDLCALL
SDL_OpenAudioDevice
(
const
char
*
device
,
int
iscapture
,
const
SDL_AudioSpec
*
desired
,
SDL_AudioSpec
*
obtained
,
int
allowed_changes
);
/**
* \name Audio state
*
* Get the current audio state.
*/
/*@{*/
typedef
enum
{
SDL_AUDIO_STOPPED
=
0
,
SDL_AUDIO_PLAYING
,
SDL_AUDIO_PAUSED
}
SDL_AudioStatus
;
extern
DECLSPEC
SDL_AudioStatus
SDLCALL
SDL_GetAudioStatus
(
void
);
extern
DECLSPEC
SDL_AudioStatus
SDLCALL
SDL_GetAudioDeviceStatus
(
SDL_AudioDeviceID
dev
);
/*@}*//*Audio State*/
/**
* \name Pause audio functions
*
* These functions pause and unpause the audio callback processing.
* They should be called with a parameter of 0 after opening the audio
* device to start playing sound. This is so you can safely initialize
* data for your callback function after opening the audio device.
* Silence will be written to the audio device during the pause.
*/
/*@{*/
extern
DECLSPEC
void
SDLCALL
SDL_PauseAudio
(
int
pause_on
);
extern
DECLSPEC
void
SDLCALL
SDL_PauseAudioDevice
(
SDL_AudioDeviceID
dev
,
int
pause_on
);
/*@}*//*Pause audio functions*/
/**
* This function loads a WAVE from the data source, automatically freeing
* that source if \c freesrc is non-zero. For example, to load a WAVE file,
* you could do:
* \code
* SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
* \endcode
*
* If this function succeeds, it returns the given SDL_AudioSpec,
* filled with the audio data format of the wave data, and sets
* \c *audio_buf to a malloc()'d buffer containing the audio data,
* and sets \c *audio_len to the length of that audio buffer, in bytes.
* You need to free the audio buffer with SDL_FreeWAV() when you are
* done with it.
*
* This function returns NULL and sets the SDL error message if the
* wave file cannot be opened, uses an unknown data format, or is
* corrupt. Currently raw and MS-ADPCM WAVE files are supported.
*/
extern
DECLSPEC
SDL_AudioSpec
*
SDLCALL
SDL_LoadWAV_RW
(
SDL_RWops
*
src
,
int
freesrc
,
SDL_AudioSpec
*
spec
,
Uint8
**
audio_buf
,
Uint32
*
audio_len
);
/**
* Loads a WAV from a file.
* Compatibility convenience function.
*/
#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
/**
* This function frees data previously allocated with SDL_LoadWAV_RW()
*/
extern
DECLSPEC
void
SDLCALL
SDL_FreeWAV
(
Uint8
*
audio_buf
);
/**
* This function takes a source format and rate and a destination format
* and rate, and initializes the \c cvt structure with information needed
* by SDL_ConvertAudio() to convert a buffer of audio data from one format
* to the other.
*
* \return -1 if the format conversion is not supported, 0 if there's
* no conversion needed, or 1 if the audio filter is set up.
*/
extern
DECLSPEC
int
SDLCALL
SDL_BuildAudioCVT
(
SDL_AudioCVT
*
cvt
,
SDL_AudioFormat
src_format
,
Uint8
src_channels
,
int
src_rate
,
SDL_AudioFormat
dst_format
,
Uint8
dst_channels
,
int
dst_rate
);
/**
* Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(),
* created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of
* audio data in the source format, this function will convert it in-place
* to the desired format.
*
* The data conversion may expand the size of the audio data, so the buffer
* \c cvt->buf should be allocated after the \c cvt structure is initialized by
* SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long.
*/
extern
DECLSPEC
int
SDLCALL
SDL_ConvertAudio
(
SDL_AudioCVT
*
cvt
);
#define SDL_MIX_MAXVOLUME 128
/**
* This takes two audio buffers of the playing audio format and mixes
* them, performing addition, volume adjustment, and overflow clipping.
* The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME
* for full audio volume. Note this does not change hardware volume.
* This is provided for convenience -- you can mix your own audio data.
*/
extern
DECLSPEC
void
SDLCALL
SDL_MixAudio
(
Uint8
*
dst
,
const
Uint8
*
src
,
Uint32
len
,
int
volume
);
/**
* This works like SDL_MixAudio(), but you specify the audio format instead of
* using the format of audio device 1. Thus it can be used when no audio
* device is open at all.
*/
extern
DECLSPEC
void
SDLCALL
SDL_MixAudioFormat
(
Uint8
*
dst
,
const
Uint8
*
src
,
SDL_AudioFormat
format
,
Uint32
len
,
int
volume
);
/**
* \name Audio lock functions
*
* The lock manipulated by these functions protects the callback function.
* During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that
* the callback function is not running. Do not call these from the callback
* function or you will cause deadlock.
*/
/*@{*/
extern
DECLSPEC
void
SDLCALL
SDL_LockAudio
(
void
);
extern
DECLSPEC
void
SDLCALL
SDL_LockAudioDevice
(
SDL_AudioDeviceID
dev
);
extern
DECLSPEC
void
SDLCALL
SDL_UnlockAudio
(
void
);
extern
DECLSPEC
void
SDLCALL
SDL_UnlockAudioDevice
(
SDL_AudioDeviceID
dev
);
/*@}*//*Audio lock functions*/
/**
* This function shuts down audio processing and closes the audio device.
*/
extern
DECLSPEC
void
SDLCALL
SDL_CloseAudio
(
void
);
extern
DECLSPEC
void
SDLCALL
SDL_CloseAudioDevice
(
SDL_AudioDeviceID
dev
);
/**
* \return 1 if audio device is still functioning, zero if not, -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_AudioDeviceConnected
(
SDL_AudioDeviceID
dev
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_audio_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_clipboard.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_clipboard.h
*
* Include file for SDL clipboard handling
*/
#ifndef _SDL_clipboard_h
#define _SDL_clipboard_h
#include "SDL_stdinc.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/* Function prototypes */
/**
* \brief Put UTF-8 text into the clipboard
*
* \sa SDL_GetClipboardText()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetClipboardText
(
const
char
*
text
);
/**
* \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
*
* \sa SDL_SetClipboardText()
*/
extern
DECLSPEC
char
*
SDLCALL
SDL_GetClipboardText
(
void
);
/**
* \brief Returns whether the clipboard has text
*
* \sa SDL_GetClipboardText()
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_HasClipboardText
(
void
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_clipboard_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_compat.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \defgroup Compatibility SDL 1.2 Compatibility API
*/
/*@{*/
/**
* \file SDL_compat.h
*
* This file contains functions for backwards compatibility with SDL 1.2.
*/
/**
* \def SDL_NO_COMPAT
*
* #define SDL_NO_COMPAT to prevent SDL_compat.h from being included.
* SDL_NO_COMPAT is intended to make it easier to covert SDL 1.2 code to
* SDL 1.3/2.0.
*/
/*@}*/
#ifdef SDL_NO_COMPAT
#define _SDL_compat_h
#endif
#ifndef _SDL_compat_h
#define _SDL_compat_h
#include "SDL_video.h"
#include "SDL_version.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* \addtogroup Compatibility
*/
/*@{*/
/**
* \name Surface flags
*/
/*@{*/
#define SDL_SWSURFACE 0x00000000
/**< \note Not used */
#define SDL_SRCALPHA 0x00010000
#define SDL_SRCCOLORKEY 0x00020000
#define SDL_ANYFORMAT 0x00100000
#define SDL_HWPALETTE 0x00200000
#define SDL_DOUBLEBUF 0x00400000
#define SDL_FULLSCREEN 0x00800000
#define SDL_RESIZABLE 0x01000000
#define SDL_NOFRAME 0x02000000
#define SDL_OPENGL 0x04000000
#define SDL_HWSURFACE 0x08000001
/**< \note Not used */
#define SDL_ASYNCBLIT 0x08000000
/**< \note Not used */
#define SDL_RLEACCELOK 0x08000000
/**< \note Not used */
#define SDL_HWACCEL 0x08000000
/**< \note Not used */
/*@}*//*Surface flags*/
#define SDL_APPMOUSEFOCUS 0x01
#define SDL_APPINPUTFOCUS 0x02
#define SDL_APPACTIVE 0x04
#define SDL_LOGPAL 0x01
#define SDL_PHYSPAL 0x02
#define SDL_ACTIVEEVENT SDL_EVENT_COMPAT1
#define SDL_VIDEORESIZE SDL_EVENT_COMPAT2
#define SDL_VIDEOEXPOSE SDL_EVENT_COMPAT3
#define SDL_ACTIVEEVENTMASK SDL_ACTIVEEVENT, SDL_ACTIVEEVENT
#define SDL_VIDEORESIZEMASK SDL_VIDEORESIZE, SDL_VIDEORESIZE
#define SDL_VIDEOEXPOSEMASK SDL_VIDEOEXPOSE, SDL_VIDEOEXPOSE
#define SDL_WINDOWEVENTMASK SDL_WINDOWEVENT, SDL_WINDOWEVENT
#define SDL_KEYDOWNMASK SDL_KEYDOWN, SDL_KEYDOWN
#define SDL_KEYUPMASK SDL_KEYUP, SDL_KEYUP
#define SDL_KEYEVENTMASK SDL_KEYDOWN, SDL_KEYUP
#define SDL_TEXTEDITINGMASK SDL_TEXTEDITING, SDL_TEXTEDITING
#define SDL_TEXTINPUTMASK SDL_TEXTINPUT, SDL_TEXTINPUT
#define SDL_MOUSEMOTIONMASK SDL_MOUSEMOTION, SDL_MOUSEMOTION
#define SDL_MOUSEBUTTONDOWNMASK SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONDOWN
#define SDL_MOUSEBUTTONUPMASK SDL_MOUSEBUTTONUP, SDL_MOUSEBUTTONUP
#define SDL_MOUSEWHEELMASK SDL_MOUSEWHEEL, SDL_MOUSEWHEEL
#define SDL_MOUSEEVENTMASK SDL_MOUSEMOTION, SDL_MOUSEBUTTONUP
#define SDL_JOYAXISMOTIONMASK SDL_JOYAXISMOTION, SDL_JOYAXISMOTION
#define SDL_JOYBALLMOTIONMASK SDL_JOYBALLMOTION, SDL_JOYBALLMOTION
#define SDL_JOYHATMOTIONMASK SDL_JOYHATMOTION, SDL_JOYHATMOTION
#define SDL_JOYBUTTONDOWNMASK SDL_JOYBUTTONDOWN, SDL_JOYBUTTONDOWN
#define SDL_JOYBUTTONUPMASK SDL_JOYBUTTONUP, SDL_JOYBUTTONUP
#define SDL_JOYEVENTMASK SDL_JOYAXISMOTION, SDL_JOYBUTTONUP
#define SDL_QUITMASK SDL_QUIT, SDL_QUIT
#define SDL_SYSWMEVENTMASK SDL_SYSWMEVENT, SDL_SYSWMEVENT
#define SDL_PROXIMITYINMASK SDL_PROXIMITYIN, SDL_PROXIMITYIN
#define SDL_PROXIMITYOUTMASK SDL_PROXIMITYOUT, SDL_PROXIMITYOUT
#define SDL_ALLEVENTS SDL_FIRSTEVENT, SDL_LASTEVENT
#define SDL_BUTTON_WHEELUP 4
#define SDL_BUTTON_WHEELDOWN 5
#define SDL_DEFAULT_REPEAT_DELAY 500
#define SDL_DEFAULT_REPEAT_INTERVAL 30
typedef
struct
SDL_VideoInfo
{
Uint32
hw_available
:
1
;
Uint32
wm_available
:
1
;
Uint32
UnusedBits1
:
6
;
Uint32
UnusedBits2
:
1
;
Uint32
blit_hw
:
1
;
Uint32
blit_hw_CC
:
1
;
Uint32
blit_hw_A
:
1
;
Uint32
blit_sw
:
1
;
Uint32
blit_sw_CC
:
1
;
Uint32
blit_sw_A
:
1
;
Uint32
blit_fill
:
1
;
Uint32
UnusedBits3
:
16
;
Uint32
video_mem
;
SDL_PixelFormat
*
vfmt
;
int
current_w
;
int
current_h
;
}
SDL_VideoInfo
;
/**
* \name Overlay formats
*
* The most common video overlay formats.
*
* For an explanation of these pixel formats, see:
* http://www.webartz.com/fourcc/indexyuv.htm
*
* For information on the relationship between color spaces, see:
* http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
*/
/*@{*/
#define SDL_YV12_OVERLAY 0x32315659
/**< Planar mode: Y + V + U (3 planes) */
#define SDL_IYUV_OVERLAY 0x56555949
/**< Planar mode: Y + U + V (3 planes) */
#define SDL_YUY2_OVERLAY 0x32595559
/**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
#define SDL_UYVY_OVERLAY 0x59565955
/**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
#define SDL_YVYU_OVERLAY 0x55595659
/**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
/*@}*//*Overlay formats*/
/**
* The YUV hardware video overlay.
*/
typedef
struct
SDL_Overlay
{
Uint32
format
;
/**< Read-only */
int
w
,
h
;
/**< Read-only */
int
planes
;
/**< Read-only */
Uint16
*
pitches
;
/**< Read-only */
Uint8
**
pixels
;
/**< Read-write */
/**
* \name Hardware-specific surface info
*/
/*@{*/
struct
private_yuvhwfuncs
*
hwfuncs
;
struct
private_yuvhwdata
*
hwdata
;
/*@}*//*Hardware-specific surface info*/
/**
* \name Special flags
*/
/*@{*/
Uint32
hw_overlay
:
1
;
/**< Flag: This overlay hardware accelerated? */
Uint32
UnusedBits
:
31
;
/*@}*//*Special flags*/
}
SDL_Overlay
;
typedef
enum
{
SDL_GRAB_QUERY
=
-
1
,
SDL_GRAB_OFF
=
0
,
SDL_GRAB_ON
=
1
}
SDL_GrabMode
;
struct
SDL_SysWMinfo
;
/**
* \name Obsolete or renamed key codes
*/
/*@{*/
/**
* \name Renamed keys
*
* These key constants were renamed for clarity or consistency.
*/
/*@{*/
#define SDLK_KP0 SDLK_KP_0
#define SDLK_KP1 SDLK_KP_1
#define SDLK_KP2 SDLK_KP_2
#define SDLK_KP3 SDLK_KP_3
#define SDLK_KP4 SDLK_KP_4
#define SDLK_KP5 SDLK_KP_5
#define SDLK_KP6 SDLK_KP_6
#define SDLK_KP7 SDLK_KP_7
#define SDLK_KP8 SDLK_KP_8
#define SDLK_KP9 SDLK_KP_9
#define SDLK_NUMLOCK SDLK_NUMLOCKCLEAR
#define SDLK_SCROLLOCK SDLK_SCROLLLOCK
#define SDLK_PRINT SDLK_PRINTSCREEN
#define SDLK_LMETA SDLK_LGUI
#define SDLK_RMETA SDLK_RGUI
/*@}*//*Renamed keys*/
/**
* \name META modifier
*
* The META modifier is equivalent to the GUI modifier from the USB standard.
*/
/*@{*/
#define KMOD_LMETA KMOD_LGUI
#define KMOD_RMETA KMOD_RGUI
#define KMOD_META KMOD_GUI
/*@}*//*META modifier*/
/**
* \name Not in USB
*
* These keys don't appear in the USB specification (or at least not under
* those names). I'm unsure if the following assignments make sense or if these
* codes should be defined as actual additional SDLK_ constants.
*/
/*@{*/
#define SDLK_LSUPER SDLK_LMETA
#define SDLK_RSUPER SDLK_RMETA
#define SDLK_COMPOSE SDLK_APPLICATION
#define SDLK_BREAK SDLK_STOP
#define SDLK_EURO SDLK_2
/*@}*//*Not in USB*/
/*@}*//*Obsolete or renamed key codes*/
#define SDL_SetModuleHandle(x)
#define SDL_AllocSurface SDL_CreateRGBSurface
extern
DECLSPEC
const
SDL_version
*
SDLCALL
SDL_Linked_Version
(
void
);
extern
DECLSPEC
char
*
SDLCALL
SDL_AudioDriverName
(
char
*
namebuf
,
int
maxlen
);
extern
DECLSPEC
char
*
SDLCALL
SDL_VideoDriverName
(
char
*
namebuf
,
int
maxlen
);
extern
DECLSPEC
const
SDL_VideoInfo
*
SDLCALL
SDL_GetVideoInfo
(
void
);
extern
DECLSPEC
int
SDLCALL
SDL_VideoModeOK
(
int
width
,
int
height
,
int
bpp
,
Uint32
flags
);
extern
DECLSPEC
SDL_Rect
**
SDLCALL
SDL_ListModes
(
const
SDL_PixelFormat
*
format
,
Uint32
flags
);
extern
DECLSPEC
SDL_Surface
*
SDLCALL
SDL_SetVideoMode
(
int
width
,
int
height
,
int
bpp
,
Uint32
flags
);
extern
DECLSPEC
SDL_Surface
*
SDLCALL
SDL_GetVideoSurface
(
void
);
extern
DECLSPEC
void
SDLCALL
SDL_UpdateRects
(
SDL_Surface
*
screen
,
int
numrects
,
SDL_Rect
*
rects
);
extern
DECLSPEC
void
SDLCALL
SDL_UpdateRect
(
SDL_Surface
*
screen
,
Sint32
x
,
Sint32
y
,
Uint32
w
,
Uint32
h
);
extern
DECLSPEC
int
SDLCALL
SDL_Flip
(
SDL_Surface
*
screen
);
extern
DECLSPEC
int
SDLCALL
SDL_SetAlpha
(
SDL_Surface
*
surface
,
Uint32
flag
,
Uint8
alpha
);
extern
DECLSPEC
SDL_Surface
*
SDLCALL
SDL_DisplayFormat
(
SDL_Surface
*
surface
);
extern
DECLSPEC
SDL_Surface
*
SDLCALL
SDL_DisplayFormatAlpha
(
SDL_Surface
*
surface
);
extern
DECLSPEC
void
SDLCALL
SDL_WM_SetCaption
(
const
char
*
title
,
const
char
*
icon
);
extern
DECLSPEC
void
SDLCALL
SDL_WM_GetCaption
(
const
char
**
title
,
const
char
**
icon
);
extern
DECLSPEC
void
SDLCALL
SDL_WM_SetIcon
(
SDL_Surface
*
icon
,
Uint8
*
mask
);
extern
DECLSPEC
int
SDLCALL
SDL_WM_IconifyWindow
(
void
);
extern
DECLSPEC
int
SDLCALL
SDL_WM_ToggleFullScreen
(
SDL_Surface
*
surface
);
extern
DECLSPEC
SDL_GrabMode
SDLCALL
SDL_WM_GrabInput
(
SDL_GrabMode
mode
);
extern
DECLSPEC
int
SDLCALL
SDL_SetPalette
(
SDL_Surface
*
surface
,
int
flags
,
const
SDL_Color
*
colors
,
int
firstcolor
,
int
ncolors
);
extern
DECLSPEC
int
SDLCALL
SDL_SetColors
(
SDL_Surface
*
surface
,
const
SDL_Color
*
colors
,
int
firstcolor
,
int
ncolors
);
extern
DECLSPEC
int
SDLCALL
SDL_GetWMInfo
(
struct
SDL_SysWMinfo
*
info
);
extern
DECLSPEC
Uint8
SDLCALL
SDL_GetAppState
(
void
);
extern
DECLSPEC
void
SDLCALL
SDL_WarpMouse
(
Uint16
x
,
Uint16
y
);
extern
DECLSPEC
SDL_Overlay
*
SDLCALL
SDL_CreateYUVOverlay
(
int
width
,
int
height
,
Uint32
format
,
SDL_Surface
*
display
);
extern
DECLSPEC
int
SDLCALL
SDL_LockYUVOverlay
(
SDL_Overlay
*
overlay
);
extern
DECLSPEC
void
SDLCALL
SDL_UnlockYUVOverlay
(
SDL_Overlay
*
overlay
);
extern
DECLSPEC
int
SDLCALL
SDL_DisplayYUVOverlay
(
SDL_Overlay
*
overlay
,
SDL_Rect
*
dstrect
);
extern
DECLSPEC
void
SDLCALL
SDL_FreeYUVOverlay
(
SDL_Overlay
*
overlay
);
extern
DECLSPEC
void
SDLCALL
SDL_GL_SwapBuffers
(
void
);
extern
DECLSPEC
int
SDLCALL
SDL_EnableKeyRepeat
(
int
delay
,
int
interval
);
extern
DECLSPEC
void
SDLCALL
SDL_GetKeyRepeat
(
int
*
delay
,
int
*
interval
);
extern
DECLSPEC
int
SDLCALL
SDL_EnableUNICODE
(
int
enable
);
#define SDL_TextureID SDL_Texture*
#define SDL_WindowID SDL_Window*
#define SDL_RenderPoint SDL_RenderDrawPoint
#define SDL_RenderLine SDL_RenderDrawLine
#define SDL_RenderFill(X) (X) ? SDL_RenderFillRect(X) : SDL_RenderClear()
#define SDL_KillThread(X)
extern
DECLSPEC
int
SDLCALL
SDL_putenv
(
const
char
*
variable
);
/*@}*//*Compatibility*/
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_compat_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_config.h.default
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_h
#define _SDL_config_h
#include "SDL_platform.h"
/**
* \file SDL_config.h.default
*
* SDL_config.h for any platform that doesn't build using the configure system.
*/
/* Add any platform that doesn't build using the configure system. */
#if defined(__NINTENDODS__)
#include "SDL_config_nintendods.h"
#elif defined(__IPHONEOS__)
#include "SDL_config_iphoneos.h"
#elif defined(__MACOSX__)
#include "SDL_config_macosx.h"
#elif defined(__WIN32__)
#include "SDL_config_win32.h"
#else
#include "SDL_config_minimal.h"
#endif /* platform config */
#endif /* _SDL_config_h */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_config.h.generated
0 → 100644
View file @
598471cf
/* include/SDL_config.h. Generated from SDL_config.h.in by configure. */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_h
#define _SDL_config_h
/**
* \file SDL_config.h.in
*
* This is a set of defines to configure the SDL features
*/
/* General platform specific identifiers */
#include "SDL_platform.h"
/* Make sure that this isn't included by Visual C++ */
#ifdef _MSC_VER
#error You should copy include/SDL_config.h.default to include/SDL_config.h
#endif
/* C language features */
/* #undef const */
/* #undef inline */
/* #undef volatile */
/* C datatypes */
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
/* #undef size_t */
/* #undef int8_t */
/* #undef uint8_t */
/* #undef int16_t */
/* #undef uint16_t */
/* #undef int32_t */
/* #undef uint32_t */
/* #undef int64_t */
/* #undef uint64_t */
/* #undef uintptr_t */
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
#define SIZEOF_VOIDP 8
#define SDL_HAS_64BIT_TYPE 1
/* Comment this if you want to build without any C library requirements */
#define HAVE_LIBC 1
#if HAVE_LIBC
/* Useful headers */
#define HAVE_ALLOCA_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STDLIB_H 1
#define HAVE_STDARG_H 1
/* #undef HAVE_MALLOC_H */
#define HAVE_MEMORY_H 1
#define HAVE_STRING_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_ICONV_H 1
#define HAVE_SIGNAL_H 1
/* #undef HAVE_ALTIVEC_H */
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
#define HAVE_GETENV 1
#define HAVE_SETENV 1
#define HAVE_PUTENV 1
#define HAVE_UNSETENV 1
#endif
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE_STRDUP 1
/* #undef HAVE__STRREV */
/* #undef HAVE__STRUPR */
/* #undef HAVE__STRLWR */
/* #undef HAVE_INDEX */
/* #undef HAVE_RINDEX */
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
/* #undef HAVE_ITOA */
/* #undef HAVE__LTOA */
/* #undef HAVE__UITOA */
/* #undef HAVE__ULTOA */
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
/* #undef HAVE__I64TOA */
/* #undef HAVE__UI64TOA */
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
/* #undef HAVE__STRICMP */
#define HAVE_STRCASECMP 1
/* #undef HAVE__STRNICMP */
#define HAVE_STRNCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_M_PI
#define HAVE_CEIL 1
#define HAVE_COPYSIGN 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_FABS 1
#define HAVE_FLOOR 1
#define HAVE_LOG 1
#define HAVE_POW 1
#define HAVE_SCALBN 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_SIGACTION 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
#define HAVE_SYSCONF 1
#define HAVE_SYSCTLBYNAME 1
/* #undef HAVE_CLOCK_GETTIME */
/* #undef HAVE_GETPAGESIZE */
#define HAVE_MPROTECT 1
#else
/* We may need some replacement for stdarg.h here */
#include <stdarg.h>
#endif /* HAVE_LIBC */
/* SDL internal assertion support */
/* #undef SDL_DEFAULT_ASSERT_LEVEL */
/* Allow disabling of core subsystems */
/* #undef SDL_AUDIO_DISABLED */
/* #undef SDL_CPUINFO_DISABLED */
/* #undef SDL_EVENTS_DISABLED */
/* #undef SDL_FILE_DISABLED */
/* #undef SDL_JOYSTICK_DISABLED */
/* #undef SDL_HAPTIC_DISABLED */
/* #undef SDL_LOADSO_DISABLED */
/* #undef SDL_THREADS_DISABLED */
/* #undef SDL_TIMERS_DISABLED */
/* #undef SDL_VIDEO_DISABLED */
/* #undef SDL_POWER_DISABLED */
/* Enable various audio drivers */
/* #undef SDL_AUDIO_DRIVER_ALSA */
/* #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC */
/* #undef SDL_AUDIO_DRIVER_ARTS */
/* #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC */
/* #undef SDL_AUDIO_DRIVER_PULSEAUDIO */
/* #undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC */
/* #undef SDL_AUDIO_DRIVER_BEOSAUDIO */
/* #undef SDL_AUDIO_DRIVER_BSD */
#define SDL_AUDIO_DRIVER_COREAUDIO 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* #undef SDL_AUDIO_DRIVER_DMEDIA */
/* #undef SDL_AUDIO_DRIVER_DSOUND */
/* #undef SDL_AUDIO_DRIVER_ESD */
/* #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC */
/* #undef SDL_AUDIO_DRIVER_MMEAUDIO */
/* #undef SDL_AUDIO_DRIVER_NAS */
/* #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC */
/* #undef SDL_AUDIO_DRIVER_NDS */
/* #undef SDL_AUDIO_DRIVER_OSS */
/* #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H */
/* #undef SDL_AUDIO_DRIVER_PAUDIO */
/* #undef SDL_AUDIO_DRIVER_QSA */
/* #undef SDL_AUDIO_DRIVER_SUNAUDIO */
/* #undef SDL_AUDIO_DRIVER_WINWAVEOUT */
/* #undef SDL_AUDIO_DRIVER_FUSIONSOUND */
/* #undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */
/* Enable various input drivers */
/* #undef SDL_INPUT_LINUXEV */
/* #undef SDL_INPUT_TSLIB */
/* #undef SDL_JOYSTICK_BEOS */
/* #undef SDL_JOYSTICK_DINPUT */
/* #undef SDL_JOYSTICK_DUMMY */
#define SDL_JOYSTICK_IOKIT 1
/* #undef SDL_JOYSTICK_LINUX */
/* #undef SDL_JOYSTICK_NDS */
/* #undef SDL_JOYSTICK_RISCOS */
/* #undef SDL_JOYSTICK_WINMM */
/* #undef SDL_JOYSTICK_USBHID */
/* #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */
/* #undef SDL_HAPTIC_DUMMY */
/* #undef SDL_HAPTIC_LINUX */
#define SDL_HAPTIC_IOKIT 1
/* #undef SDL_HAPTIC_DINPUT */
/* Enable various shared object loading systems */
/* #undef SDL_LOADSO_BEOS */
/* #undef SDL_LOADSO_DLCOMPAT */
#define SDL_LOADSO_DLOPEN 1
/* #undef SDL_LOADSO_DUMMY */
/* #undef SDL_LOADSO_LDG */
/* #undef SDL_LOADSO_WIN32 */
/* Enable various threading systems */
/* #undef SDL_THREAD_BEOS */
/* #undef SDL_THREAD_NDS */
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */
/* #undef SDL_THREAD_SPROC */
/* #undef SDL_THREAD_WIN32 */
/* Enable various timer systems */
/* #undef SDL_TIMER_BEOS */
/* #undef SDL_TIMER_DUMMY */
/* #undef SDL_TIMER_NDS */
/* #undef SDL_TIMER_RISCOS */
#define SDL_TIMER_UNIX 1
/* #undef SDL_TIMER_WIN32 */
/* #undef SDL_TIMER_WINCE */
/* Enable various video drivers */
/* #undef SDL_VIDEO_DRIVER_BWINDOW */
#define SDL_VIDEO_DRIVER_COCOA 1
/* #undef SDL_VIDEO_DRIVER_DIRECTFB */
/* #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC */
#define SDL_VIDEO_DRIVER_DUMMY 1
/* #undef SDL_VIDEO_DRIVER_FBCON */
/* #undef SDL_VIDEO_DRIVER_NDS */
/* #undef SDL_VIDEO_DRIVER_PHOTON */
/* #undef SDL_VIDEO_DRIVER_QNXGF */
/* #undef SDL_VIDEO_DRIVER_PS3 */
/* #undef SDL_VIDEO_DRIVER_RISCOS */
/* #undef SDL_VIDEO_DRIVER_SVGALIB */
/* #undef SDL_VIDEO_DRIVER_WIN32 */
#define SDL_VIDEO_DRIVER_X11 1
#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT "/usr/X11R6/lib/libXi.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.6.dylib"
#define SDL_VIDEO_DRIVER_X11_VIDMODE 1
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
#define SDL_VIDEO_DRIVER_X11_XRANDR 1
#define SDL_VIDEO_DRIVER_X11_XINPUT 1
#define SDL_VIDEO_DRIVER_X11_SCRNSAVER 1
#define SDL_VIDEO_DRIVER_X11_XV 1
/* #undef SDL_VIDEO_RENDER_D3D */
/* #undef SDL_VIDEO_RENDER_GDI */
#define SDL_VIDEO_RENDER_OGL 1
/* #undef SDL_VIDEO_RENDER_OGL_ES */
#define SDL_VIDEO_RENDER_X11 1
/* #undef SDL_VIDEO_RENDER_GAPI */
/* #undef SDL_VIDEO_RENDER_DDRAW */
/* Enable OpenGL support */
#define SDL_VIDEO_OPENGL 1
/* #undef SDL_VIDEO_OPENGL_ES */
/* #undef SDL_VIDEO_OPENGL_BGL */
#define SDL_VIDEO_OPENGL_CGL 1
#define SDL_VIDEO_OPENGL_GLX 1
/* #undef SDL_VIDEO_OPENGL_WGL */
/* #undef SDL_VIDEO_OPENGL_OSMESA */
/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */
/* Enable system power support */
/* #undef SDL_POWER_LINUX */
/* #undef SDL_POWER_WINDOWS */
#define SDL_POWER_MACOSX 1
/* #undef SDL_POWER_BEOS */
/* #undef SDL_POWER_NINTENDODS */
/* #undef SDL_POWER_HARDWIRED */
/* Enable assembly routines */
#define SDL_ASSEMBLY_ROUTINES 1
/* #undef SDL_ALTIVEC_BLITTERS */
#endif /* _SDL_config_h */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_config.h.in
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_h
#define _SDL_config_h
/**
* \file SDL_config.h.in
*
* This is a set of defines to configure the SDL features
*/
/* General platform specific identifiers */
#include "SDL_platform.h"
/* Make sure that this isn't included by Visual C++ */
#ifdef _MSC_VER
#error You should copy include/SDL_config.h.default to include/SDL_config.h
#endif
/* C language features */
#undef const
#undef inline
#undef volatile
/* C datatypes */
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
#undef size_t
#undef int8_t
#undef uint8_t
#undef int16_t
#undef uint16_t
#undef int32_t
#undef uint32_t
#undef int64_t
#undef uint64_t
#undef uintptr_t
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
#undef SIZEOF_VOIDP
#undef SDL_HAS_64BIT_TYPE
/* Comment this if you want to build without any C library requirements */
#undef HAVE_LIBC
#if HAVE_LIBC
/* Useful headers */
#undef HAVE_ALLOCA_H
#undef HAVE_SYS_TYPES_H
#undef HAVE_STDIO_H
#undef STDC_HEADERS
#undef HAVE_STDLIB_H
#undef HAVE_STDARG_H
#undef HAVE_MALLOC_H
#undef HAVE_MEMORY_H
#undef HAVE_STRING_H
#undef HAVE_STRINGS_H
#undef HAVE_INTTYPES_H
#undef HAVE_STDINT_H
#undef HAVE_CTYPE_H
#undef HAVE_MATH_H
#undef HAVE_ICONV_H
#undef HAVE_SIGNAL_H
#undef HAVE_ALTIVEC_H
/* C library functions */
#undef HAVE_MALLOC
#undef HAVE_CALLOC
#undef HAVE_REALLOC
#undef HAVE_FREE
#undef HAVE_ALLOCA
#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
#undef HAVE_GETENV
#undef HAVE_SETENV
#undef HAVE_PUTENV
#undef HAVE_UNSETENV
#endif
#undef HAVE_QSORT
#undef HAVE_ABS
#undef HAVE_BCOPY
#undef HAVE_MEMSET
#undef HAVE_MEMCPY
#undef HAVE_MEMMOVE
#undef HAVE_MEMCMP
#undef HAVE_STRLEN
#undef HAVE_STRLCPY
#undef HAVE_STRLCAT
#undef HAVE_STRDUP
#undef HAVE__STRREV
#undef HAVE__STRUPR
#undef HAVE__STRLWR
#undef HAVE_INDEX
#undef HAVE_RINDEX
#undef HAVE_STRCHR
#undef HAVE_STRRCHR
#undef HAVE_STRSTR
#undef HAVE_ITOA
#undef HAVE__LTOA
#undef HAVE__UITOA
#undef HAVE__ULTOA
#undef HAVE_STRTOL
#undef HAVE_STRTOUL
#undef HAVE__I64TOA
#undef HAVE__UI64TOA
#undef HAVE_STRTOLL
#undef HAVE_STRTOULL
#undef HAVE_STRTOD
#undef HAVE_ATOI
#undef HAVE_ATOF
#undef HAVE_STRCMP
#undef HAVE_STRNCMP
#undef HAVE__STRICMP
#undef HAVE_STRCASECMP
#undef HAVE__STRNICMP
#undef HAVE_STRNCASECMP
#undef HAVE_SSCANF
#undef HAVE_SNPRINTF
#undef HAVE_VSNPRINTF
#undef HAVE_M_PI
#undef HAVE_CEIL
#undef HAVE_COPYSIGN
#undef HAVE_COS
#undef HAVE_COSF
#undef HAVE_FABS
#undef HAVE_FLOOR
#undef HAVE_LOG
#undef HAVE_POW
#undef HAVE_SCALBN
#undef HAVE_SIN
#undef HAVE_SINF
#undef HAVE_SQRT
#undef HAVE_SIGACTION
#undef HAVE_SETJMP
#undef HAVE_NANOSLEEP
#undef HAVE_SYSCONF
#undef HAVE_SYSCTLBYNAME
#undef HAVE_CLOCK_GETTIME
#undef HAVE_GETPAGESIZE
#undef HAVE_MPROTECT
#else
/* We may need some replacement for stdarg.h here */
#include <stdarg.h>
#endif /* HAVE_LIBC */
/* SDL internal assertion support */
#undef SDL_DEFAULT_ASSERT_LEVEL
/* Allow disabling of core subsystems */
#undef SDL_AUDIO_DISABLED
#undef SDL_CPUINFO_DISABLED
#undef SDL_EVENTS_DISABLED
#undef SDL_FILE_DISABLED
#undef SDL_JOYSTICK_DISABLED
#undef SDL_HAPTIC_DISABLED
#undef SDL_LOADSO_DISABLED
#undef SDL_THREADS_DISABLED
#undef SDL_TIMERS_DISABLED
#undef SDL_VIDEO_DISABLED
#undef SDL_POWER_DISABLED
/* Enable various audio drivers */
#undef SDL_AUDIO_DRIVER_ALSA
#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
#undef SDL_AUDIO_DRIVER_ARTS
#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
#undef SDL_AUDIO_DRIVER_PULSEAUDIO
#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
#undef SDL_AUDIO_DRIVER_BEOSAUDIO
#undef SDL_AUDIO_DRIVER_BSD
#undef SDL_AUDIO_DRIVER_COREAUDIO
#undef SDL_AUDIO_DRIVER_DISK
#undef SDL_AUDIO_DRIVER_DUMMY
#undef SDL_AUDIO_DRIVER_DMEDIA
#undef SDL_AUDIO_DRIVER_DSOUND
#undef SDL_AUDIO_DRIVER_ESD
#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
#undef SDL_AUDIO_DRIVER_MMEAUDIO
#undef SDL_AUDIO_DRIVER_NAS
#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC
#undef SDL_AUDIO_DRIVER_NDS
#undef SDL_AUDIO_DRIVER_OSS
#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
#undef SDL_AUDIO_DRIVER_PAUDIO
#undef SDL_AUDIO_DRIVER_QSA
#undef SDL_AUDIO_DRIVER_SUNAUDIO
#undef SDL_AUDIO_DRIVER_WINWAVEOUT
#undef SDL_AUDIO_DRIVER_FUSIONSOUND
#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
/* Enable various input drivers */
#undef SDL_INPUT_LINUXEV
#undef SDL_INPUT_TSLIB
#undef SDL_JOYSTICK_BEOS
#undef SDL_JOYSTICK_DINPUT
#undef SDL_JOYSTICK_DUMMY
#undef SDL_JOYSTICK_IOKIT
#undef SDL_JOYSTICK_LINUX
#undef SDL_JOYSTICK_NDS
#undef SDL_JOYSTICK_RISCOS
#undef SDL_JOYSTICK_WINMM
#undef SDL_JOYSTICK_USBHID
#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
#undef SDL_HAPTIC_DUMMY
#undef SDL_HAPTIC_LINUX
#undef SDL_HAPTIC_IOKIT
#undef SDL_HAPTIC_DINPUT
/* Enable various shared object loading systems */
#undef SDL_LOADSO_BEOS
#undef SDL_LOADSO_DLCOMPAT
#undef SDL_LOADSO_DLOPEN
#undef SDL_LOADSO_DUMMY
#undef SDL_LOADSO_LDG
#undef SDL_LOADSO_WIN32
/* Enable various threading systems */
#undef SDL_THREAD_BEOS
#undef SDL_THREAD_NDS
#undef SDL_THREAD_PTHREAD
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
#undef SDL_THREAD_SPROC
#undef SDL_THREAD_WIN32
/* Enable various timer systems */
#undef SDL_TIMER_BEOS
#undef SDL_TIMER_DUMMY
#undef SDL_TIMER_NDS
#undef SDL_TIMER_RISCOS
#undef SDL_TIMER_UNIX
#undef SDL_TIMER_WIN32
#undef SDL_TIMER_WINCE
/* Enable various video drivers */
#undef SDL_VIDEO_DRIVER_BWINDOW
#undef SDL_VIDEO_DRIVER_COCOA
#undef SDL_VIDEO_DRIVER_DIRECTFB
#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
#undef SDL_VIDEO_DRIVER_DUMMY
#undef SDL_VIDEO_DRIVER_FBCON
#undef SDL_VIDEO_DRIVER_NDS
#undef SDL_VIDEO_DRIVER_PHOTON
#undef SDL_VIDEO_DRIVER_QNXGF
#undef SDL_VIDEO_DRIVER_PS3
#undef SDL_VIDEO_DRIVER_RISCOS
#undef SDL_VIDEO_DRIVER_SVGALIB
#undef SDL_VIDEO_DRIVER_WIN32
#undef SDL_VIDEO_DRIVER_X11
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS
#undef SDL_VIDEO_DRIVER_X11_VIDMODE
#undef SDL_VIDEO_DRIVER_X11_XINERAMA
#undef SDL_VIDEO_DRIVER_X11_XRANDR
#undef SDL_VIDEO_DRIVER_X11_XINPUT
#undef SDL_VIDEO_DRIVER_X11_SCRNSAVER
#undef SDL_VIDEO_DRIVER_X11_XV
#undef SDL_VIDEO_RENDER_D3D
#undef SDL_VIDEO_RENDER_GDI
#undef SDL_VIDEO_RENDER_OGL
#undef SDL_VIDEO_RENDER_OGL_ES
#undef SDL_VIDEO_RENDER_X11
#undef SDL_VIDEO_RENDER_GAPI
#undef SDL_VIDEO_RENDER_DDRAW
/* Enable OpenGL support */
#undef SDL_VIDEO_OPENGL
#undef SDL_VIDEO_OPENGL_ES
#undef SDL_VIDEO_OPENGL_BGL
#undef SDL_VIDEO_OPENGL_CGL
#undef SDL_VIDEO_OPENGL_GLX
#undef SDL_VIDEO_OPENGL_WGL
#undef SDL_VIDEO_OPENGL_OSMESA
#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
/* Enable system power support */
#undef SDL_POWER_LINUX
#undef SDL_POWER_WINDOWS
#undef SDL_POWER_MACOSX
#undef SDL_POWER_BEOS
#undef SDL_POWER_NINTENDODS
#undef SDL_POWER_HARDWIRED
/* Enable assembly routines */
#undef SDL_ASSEMBLY_ROUTINES
#undef SDL_ALTIVEC_BLITTERS
#endif /* _SDL_config_h */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_config_iphoneos.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_iphoneos_h
#define _SDL_config_iphoneos_h
#include "SDL_platform.h"
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
typedef
signed
char
int8_t
;
typedef
unsigned
char
uint8_t
;
typedef
signed
short
int16_t
;
typedef
unsigned
short
uint16_t
;
typedef
signed
int
int32_t
;
typedef
unsigned
int
uint32_t
;
typedef
unsigned
long
uintptr_t
;
#endif
/* !_STDINT_H_ && !HAVE_STDINT_H */
#ifdef __LP64__
#define SIZEOF_VOIDP 8
#else
#define SIZEOF_VOIDP 4
#endif
#define SDL_HAS_64BIT_TYPE 1
#define HAVE_ALLOCA_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_SETENV 1
#define HAVE_PUTENV 1
#define HAVE_SETENV 1
#define HAVE_UNSETENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_CEIL 1
#define HAVE_COPYSIGN 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_FABS 1
#define HAVE_FLOOR 1
#define HAVE_LOG 1
#define HAVE_POW 1
#define HAVE_SCALBN 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_SIGACTION 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
#define HAVE_SYSCONF 1
#define HAVE_SYSCTLBYNAME 1
/* enable iPhone version of Core Audio driver */
#define SDL_AUDIO_DRIVER_COREAUDIOIPHONE 1
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
#define SDL_HAPTIC_DISABLED 1
/* Enable Unix style SO loading */
/* Technically this works, but it violates the iPhone developer agreement */
/* #define SDL_LOADSO_DLOPEN 1 */
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
#define SDL_LOADSO_DISABLED 1
/* Enable various threading systems */
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
/* Enable various timer systems */
#define SDL_TIMER_UNIX 1
/* Supported video drivers */
#define SDL_VIDEO_DRIVER_UIKIT 1
#define SDL_VIDEO_DRIVER_DUMMY 1
/* enable OpenGL ES */
#define SDL_VIDEO_OPENGL_ES 1
#define SDL_VIDEO_RENDER_OGL_ES 1
/* Enable system power support */
#define SDL_POWER_UIKIT 1
/* enable iPhone keyboard support */
#define SDL_IPHONE_KEYBOARD 1
/* Set max recognized G-force from accelerometer
See src/joystick/uikit/SDLUIAccelerationDelegate.m for notes on why this is needed
*/
#define SDL_IPHONE_MAX_GFORCE 5.0
#endif
/* _SDL_config_iphoneos_h */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_config_macosx.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_macosx_h
#define _SDL_config_macosx_h
#include "SDL_platform.h"
/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
#include <AvailabilityMacros.h>
/* This is a set of defines to configure the SDL features */
#ifdef __LP64__
#define SIZEOF_VOIDP 8
#else
#define SIZEOF_VOIDP 4
#endif
#define SDL_HAS_64BIT_TYPE 1
/* Useful headers */
/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */
#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) )
#define HAVE_ALLOCA_H 1
#endif
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_SETENV 1
#define HAVE_PUTENV 1
#define HAVE_UNSETENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_CEIL 1
#define HAVE_COPYSIGN 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_FABS 1
#define HAVE_FLOOR 1
#define HAVE_LOG 1
#define HAVE_POW 1
#define HAVE_SCALBN 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_SIGACTION 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
#define HAVE_SYSCONF 1
#define HAVE_SYSCTLBYNAME 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_COREAUDIO 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various input drivers */
#define SDL_JOYSTICK_IOKIT 1
#define SDL_HAPTIC_IOKIT 1
/* Enable various shared object loading systems */
#define SDL_LOADSO_DLOPEN 1
/* Enable various threading systems */
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
/* Enable various timer systems */
#define SDL_TIMER_UNIX 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_COCOA 1
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_X11 1
#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT "/usr/X11R6/lib/libXi.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.6.dylib"
#define SDL_VIDEO_DRIVER_X11_VIDMODE 1
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
#define SDL_VIDEO_DRIVER_X11_XRANDR 1
#define SDL_VIDEO_DRIVER_X11_XINPUT 1
#define SDL_VIDEO_DRIVER_X11_SCRNSAVER 1
#define SDL_VIDEO_DRIVER_X11_XV 1
#define SDL_VIDEO_RENDER_OGL 1
#define SDL_VIDEO_RENDER_X11 1
/* Enable OpenGL support */
#define SDL_VIDEO_OPENGL 1
#define SDL_VIDEO_OPENGL_CGL 1
#define SDL_VIDEO_OPENGL_GLX 1
/* Enable system power support */
#define SDL_POWER_MACOSX 1
/* Enable assembly routines */
#define SDL_ASSEMBLY_ROUTINES 1
#ifdef __ppc__
#define SDL_ALTIVEC_BLITTERS 1
#endif
#endif
/* _SDL_config_macosx_h */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_config_minimal.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_minimal_h
#define _SDL_config_minimal_h
#include "SDL_platform.h"
/**
* \file SDL_config_minimal.h
*
* This is the minimal configuration that can be used to build SDL.
*/
#include <stdarg.h>
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
typedef
signed
char
int8_t
;
typedef
unsigned
char
uint8_t
;
typedef
signed
short
int16_t
;
typedef
unsigned
short
uint16_t
;
typedef
signed
int
int32_t
;
typedef
unsigned
int
uint32_t
;
typedef
unsigned
int
size_t
;
typedef
unsigned
long
uintptr_t
;
#endif
/* !_STDINT_H_ && !HAVE_STDINT_H */
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
#define SDL_JOYSTICK_DISABLED 1
/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
#define SDL_HAPTIC_DISABLED 1
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
#define SDL_LOADSO_DISABLED 1
/* Enable the stub thread support (src/thread/generic/\*.c) */
#define SDL_THREADS_DISABLED 1
/* Enable the stub timer support (src/timer/dummy/\*.c) */
#define SDL_TIMERS_DISABLED 1
/* Enable the dummy video driver (src/video/dummy/\*.c) */
#define SDL_VIDEO_DRIVER_DUMMY 1
#endif
/* _SDL_config_minimal_h */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_config_nintendods.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_nintendods_h
#define _SDL_config_nintendods_h
#include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
typedef
signed
char
int8_t
;
typedef
unsigned
char
uint8_t
;
typedef
signed
short
int16_t
;
typedef
unsigned
short
uint16_t
;
typedef
signed
int
int32_t
;
typedef
unsigned
int
uint32_t
;
typedef
signed
long
long
int64_t
;
typedef
unsigned
long
long
uint64_t
;
/* LiF: __PTRDIFF_TYPE__ was causing errors of conflicting typedefs with the
<stdint.h> shipping with devkitARM. copied a similar ifdef from it. */
#ifndef __PTRDIFF_TYPE__
typedef
unsigned
long
uintptr_t
;
#else
typedef
unsigned
__PTRDIFF_TYPE__
uintptr_t
;
#endif
#endif
/* !_STDINT_H_ && !HAVE_STDINT_H */
#define SDL_HAS_64BIT_TYPE 1
/* Useful headers */
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_SETENV 1
#define HAVE_PUTENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRDUP 1
#define HAVE_INDEX 1
#define HAVE_RINDEX 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRICMP 1
#define HAVE_STRCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
/* DS isn't that sophisticated */
#define LACKS_SYS_MMAN_H 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_NDS 1
/*#define SDL_AUDIO_DRIVER_DUMMY 1 TODO: uncomment this later*/
/* Enable various input drivers */
#define SDL_JOYSTICK_NDS 1
/*#define SDL_JOYSTICK_DUMMY 1 TODO: uncomment this later*/
/* DS has no dynamic linking afaik */
#define SDL_LOADSO_DISABLED 1
/* Enable various threading systems */
/*#define SDL_THREAD_NDS 1*/
#define SDL_THREADS_DISABLED 1
/* Enable various timer systems */
#define SDL_TIMER_NDS 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_NDS 1
/*#define SDL_VIDEO_DRIVER_DUMMY 1 TODO: uncomment this later*/
/* Enable system power support */
#define SDL_POWER_NINTENDODS 1
#endif
/* _SDL_config_nintendods_h */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_config_pandora.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_h
#define _SDL_config_h
/* This is a set of defines to configure the SDL features */
/* General platform specific identifiers */
#include "SDL_platform.h"
#ifdef __LP64__
#define SIZEOF_VOIDP 8
#else
#define SIZEOF_VOIDP 4
#endif
#define SDL_HAS_64BIT_TYPE 1
#define SDL_BYTEORDER 1234
#define HAVE_ALLOCA_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STDLIB_H 1
#define HAVE_STDARG_H 1
#define HAVE_MALLOC_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRING_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_ICONV_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_SETENV 1
#define HAVE_PUTENV 1
#define HAVE_UNSETENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_STRLEN 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_M_PI 1
#define HAVE_CEIL 1
#define HAVE_COPYSIGN 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_FABS 1
#define HAVE_FLOOR 1
#define HAVE_LOG 1
#define HAVE_SCALBN 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_SIGACTION 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
#define SDL_AUDIO_DRIVER_DUMMY 1
#define SDL_AUDIO_DRIVER_OSS 1
#define SDL_INPUT_LINUXEV 1
#define SDL_INPUT_TSLIB 1
#define SDL_JOYSTICK_LINUX 1
#define SDL_HAPTIC_LINUX 1
#define SDL_LOADSO_DLOPEN 1
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1
#define SDL_TIMER_UNIX 1
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_X11 1
#define SDL_VIDEO_DRIVER_X11_XINPUT 1
#define SDL_VIDEO_DRIVER_PANDORA 1
#define SDL_VIDEO_RENDER_OGL_ES 1
#define SDL_VIDEO_OPENGL_ES 1
#endif
/* _SDL_config_h */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_config_win32.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_win32_h
#define _SDL_config_win32_h
#include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
#define HAVE_STDINT_H 1
#elif defined(_MSC_VER)
typedef
signed
__int8
int8_t
;
typedef
unsigned
__int8
uint8_t
;
typedef
signed
__int16
int16_t
;
typedef
unsigned
__int16
uint16_t
;
typedef
signed
__int32
int32_t
;
typedef
unsigned
__int32
uint32_t
;
typedef
signed
__int64
int64_t
;
typedef
unsigned
__int64
uint64_t
;
#ifndef _UINTPTR_T_DEFINED
#ifdef _WIN64
typedef
unsigned
__int64
uintptr_t
;
#else
typedef
unsigned
int
uintptr_t
;
#endif
#define _UINTPTR_T_DEFINED
#endif
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
#define DWORD_PTR DWORD
#endif
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
#define LONG_PTR LONG
#endif
#else
/* !__GNUC__ && !_MSC_VER */
typedef
signed
char
int8_t
;
typedef
unsigned
char
uint8_t
;
typedef
signed
short
int16_t
;
typedef
unsigned
short
uint16_t
;
typedef
signed
int
int32_t
;
typedef
unsigned
int
uint32_t
;
typedef
signed
long
long
int64_t
;
typedef
unsigned
long
long
uint64_t
;
#ifndef _SIZE_T_DEFINED_
#define _SIZE_T_DEFINED_
typedef
unsigned
int
size_t
;
#endif
typedef
unsigned
int
uintptr_t
;
#endif
/* __GNUC__ || _MSC_VER */
#endif
/* !_STDINT_H_ && !HAVE_STDINT_H */
#ifdef _WIN64
# define SIZEOF_VOIDP 8
#else
# define SIZEOF_VOIDP 4
#endif
#define SDL_HAS_64BIT_TYPE 1
/* Enabled for SDL 1.2 (binary compatibility) */
//#define HAVE_LIBC 1
#ifdef HAVE_LIBC
/* Useful headers */
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#ifndef _WIN32_WCE
#define HAVE_SIGNAL_H 1
#endif
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE__STRREV 1
#define HAVE__STRUPR 1
#define HAVE__STRLWR 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_ITOA 1
#define HAVE__LTOA 1
#define HAVE__ULTOA 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE__STRICMP 1
#define HAVE__STRNICMP 1
#define HAVE_SSCANF 1
#define HAVE_M_PI 1
#define HAVE_CEIL 1
#define HAVE_COPYSIGN 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_FABS 1
#define HAVE_FLOOR 1
#define HAVE_LOG 1
#define HAVE_POW 1
#define HAVE_SCALBN 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#else
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
#endif
/* Enable various audio drivers */
#ifndef _WIN32_WCE
#define SDL_AUDIO_DRIVER_DSOUND 1
#endif
#define SDL_AUDIO_DRIVER_WINWAVEOUT 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various input drivers */
#ifdef _WIN32_WCE
#define SDL_JOYSTICK_DISABLED 1
#define SDL_HAPTIC_DUMMY 1
#else
#define SDL_JOYSTICK_DINPUT 1
#define SDL_HAPTIC_DINPUT 1
#endif
/* Enable various shared object loading systems */
#define SDL_LOADSO_WIN32 1
/* Enable various threading systems */
#define SDL_THREAD_WIN32 1
/* Enable various timer systems */
#ifdef _WIN32_WCE
#define SDL_TIMER_WINCE 1
#else
#define SDL_TIMER_WIN32 1
#endif
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_WIN32 1
#define SDL_VIDEO_RENDER_D3D 1
#define SDL_VIDEO_RENDER_GDI 1
/* Enable OpenGL support */
#ifndef _WIN32_WCE
#define SDL_VIDEO_OPENGL 1
#define SDL_VIDEO_OPENGL_WGL 1
#define SDL_VIDEO_RENDER_OGL 1
#endif
/* Enable system power support */
#define SDL_POWER_WINDOWS 1
/* Enable assembly routines (Win64 doesn't have inline asm) */
#ifndef _WIN64
#define SDL_ASSEMBLY_ROUTINES 1
#endif
#endif
/* _SDL_config_win32_h */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_config_wiz.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_h
#define _SDL_config_h
/* This is a set of defines to configure the SDL features */
/* General platform specific identifiers */
#include "SDL_platform.h"
/* Make sure that this isn't included by Visual C++ */
#ifdef _MSC_VER
#error You should copy include/SDL_config.h.default to include/SDL_config.h
#endif
#define SDL_HAS_64BIT_TYPE 1
#define SDL_BYTEORDER 1234
#define HAVE_ALLOCA_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STDLIB_H 1
#define HAVE_STDARG_H 1
#define HAVE_MALLOC_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRING_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_ICONV_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_SETENV 1
#define HAVE_PUTENV 1
#define HAVE_UNSETENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_STRLEN 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_M_PI 1
#define HAVE_CEIL 1
#define HAVE_COPYSIGN 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_FABS 1
#define HAVE_FLOOR 1
#define HAVE_LOG 1
#define HAVE_SCALBN 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_SIGACTION 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
#define HAVE_POW 1
#define SDL_CDROM_DISABLED 1
#define SDL_AUDIO_DRIVER_DUMMY 1
#define SDL_AUDIO_DRIVER_OSS 1
#define SDL_INPUT_LINUXEV 1
#define SDL_INPUT_TSLIB 1
#define SDL_JOYSTICK_LINUX 1
#define SDL_HAPTIC_LINUX 1
#define SDL_LOADSO_DLOPEN 1
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1
#define SDL_TIMER_UNIX 1
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_PANDORA 1
#define SDL_VIDEO_RENDER_OGL_ES 1
#define SDL_VIDEO_OPENGL_ES 1
#endif
/* _SDL_config_h */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_copying.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_cpuinfo.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_cpuinfo.h
*
* CPU feature detection for SDL.
*/
#ifndef _SDL_cpuinfo_h
#define _SDL_cpuinfo_h
#include "SDL_stdinc.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* This function returns the number of CPU cores available.
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetCPUCount
(
void
);
/**
* This function returns true if the CPU has the RDTSC instruction.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_HasRDTSC
(
void
);
/**
* This function returns true if the CPU has MMX features.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_HasMMX
(
void
);
/**
* This function returns true if the CPU has MMX Ext.\ features.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_HasMMXExt
(
void
);
/**
* This function returns true if the CPU has 3DNow!\ features.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_Has3DNow
(
void
);
/**
* This function returns true if the CPU has 3DNow!\ Ext.\ features.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_Has3DNowExt
(
void
);
/**
* This function returns true if the CPU has SSE features.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_HasSSE
(
void
);
/**
* This function returns true if the CPU has SSE2 features.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_HasSSE2
(
void
);
/**
* This function returns true if the CPU has AltiVec features.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_HasAltiVec
(
void
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_cpuinfo_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_endian.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_endian.h
*
* Functions for reading and writing endian-specific values
*/
#ifndef _SDL_endian_h
#define _SDL_endian_h
#include "SDL_stdinc.h"
/**
* \name The two types of endianness
*/
/*@{*/
#define SDL_LIL_ENDIAN 1234
#define SDL_BIG_ENDIAN 4321
/*@}*/
#ifndef SDL_BYTEORDER
/* Not defined in SDL_config.h? */
#if defined(__hppa__) || \
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
(defined(__MIPS__) && defined(__MISPEB__)) || \
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
defined(__sparc__)
#define SDL_BYTEORDER SDL_BIG_ENDIAN
#else
#define SDL_BYTEORDER SDL_LIL_ENDIAN
#endif
#endif
/* !SDL_BYTEORDER */
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* \file SDL_endian.h
*
* Uses inline functions for compilers that support them, and static
* functions for those that do not. Because these functions become
* static for compilers that do not support inline functions, this
* header should only be included in files that actually use them.
*/
#if defined(__GNUC__) && defined(__i386__) && \
!(__GNUC__ == 2 && __GNUC_MINOR__ == 95
/* broken gcc version */
)
static
__inline__
Uint16
SDL_Swap16
(
Uint16
x
)
{
__asm__
(
"xchgb %b0,%h0"
:
"=q"
(
x
)
:
"0"
(
x
));
return
x
;
}
#elif defined(__GNUC__) && defined(__x86_64__)
static
__inline__
Uint16
SDL_Swap16
(
Uint16
x
)
{
__asm__
(
"xchgb %b0,%h0"
:
"=Q"
(
x
)
:
"0"
(
x
));
return
x
;
}
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
static
__inline__
Uint16
SDL_Swap16
(
Uint16
x
)
{
Uint16
result
;
__asm__
(
"rlwimi %0,%2,8,16,23"
:
"=&r"
(
result
)
:
"0"
(
x
>>
8
),
"r"
(
x
));
return
result
;
}
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
static
__inline__
Uint16
SDL_Swap16
(
Uint16
x
)
{
__asm__
(
"rorw #8,%0"
:
"=d"
(
x
)
:
"0"
(
x
)
:
"cc"
);
return
x
;
}
#else
static
__inline__
Uint16
SDL_Swap16
(
Uint16
x
)
{
return
SDL_static_cast
(
Uint16
,
((
x
<<
8
)
|
(
x
>>
8
)));
}
#endif
#if defined(__GNUC__) && defined(__i386__)
static
__inline__
Uint32
SDL_Swap32
(
Uint32
x
)
{
__asm__
(
"bswap %0"
:
"=r"
(
x
)
:
"0"
(
x
));
return
x
;
}
#elif defined(__GNUC__) && defined(__x86_64__)
static
__inline__
Uint32
SDL_Swap32
(
Uint32
x
)
{
__asm__
(
"bswapl %0"
:
"=r"
(
x
)
:
"0"
(
x
));
return
x
;
}
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
static
__inline__
Uint32
SDL_Swap32
(
Uint32
x
)
{
Uint32
result
;
__asm__
(
"rlwimi %0,%2,24,16,23"
:
"=&r"
(
result
)
:
"0"
(
x
>>
24
),
"r"
(
x
));
__asm__
(
"rlwimi %0,%2,8,8,15"
:
"=&r"
(
result
)
:
"0"
(
result
),
"r"
(
x
));
__asm__
(
"rlwimi %0,%2,24,0,7"
:
"=&r"
(
result
)
:
"0"
(
result
),
"r"
(
x
));
return
result
;
}
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
static
__inline__
Uint32
SDL_Swap32
(
Uint32
x
)
{
__asm__
(
"rorw #8,%0
\n\t
swap %0
\n\t
rorw #8,%0"
:
"=d"
(
x
)
:
"0"
(
x
)
:
"cc"
);
return
x
;
}
#else
static
__inline__
Uint32
SDL_Swap32
(
Uint32
x
)
{
return
SDL_static_cast
(
Uint32
,
((
x
<<
24
)
|
((
x
<<
8
)
&
0x00FF0000
)
|
((
x
>>
8
)
&
0x0000FF00
)
|
(
x
>>
24
)));
}
#endif
#ifdef SDL_HAS_64BIT_TYPE
#if defined(__GNUC__) && defined(__i386__)
static
__inline__
Uint64
SDL_Swap64
(
Uint64
x
)
{
union
{
struct
{
Uint32
a
,
b
;
}
s
;
Uint64
u
;
}
v
;
v
.
u
=
x
;
__asm__
(
"bswapl %0 ; bswapl %1 ; xchgl %0,%1"
:
"=r"
(
v
.
s
.
a
),
"=r"
(
v
.
s
.
b
)
:
"0"
(
v
.
s
.
a
),
"1"
(
v
.
s
.
b
));
return
v
.
u
;
}
#elif defined(__GNUC__) && defined(__x86_64__)
static
__inline__
Uint64
SDL_Swap64
(
Uint64
x
)
{
__asm__
(
"bswapq %0"
:
"=r"
(
x
)
:
"0"
(
x
));
return
x
;
}
#else
static
__inline__
Uint64
SDL_Swap64
(
Uint64
x
)
{
Uint32
hi
,
lo
;
/* Separate into high and low 32-bit values and swap them */
lo
=
SDL_static_cast
(
Uint32
,
x
&
0xFFFFFFFF
);
x
>>=
32
;
hi
=
SDL_static_cast
(
Uint32
,
x
&
0xFFFFFFFF
);
x
=
SDL_Swap32
(
lo
);
x
<<=
32
;
x
|=
SDL_Swap32
(
hi
);
return
(
x
);
}
#endif
#else
/**
* This is mainly to keep compilers from complaining in SDL code.
* If there is no real 64-bit datatype, then compilers will complain about
* the fake 64-bit datatype that SDL provides when it compiles user code.
*/
#define SDL_Swap64(X) (X)
#endif
/* SDL_HAS_64BIT_TYPE */
static
__inline__
float
SDL_SwapFloat
(
float
x
)
{
union
{
float
f
;
Uint32
ui32
;
}
swapper
;
swapper
.
f
=
x
;
swapper
.
ui32
=
SDL_Swap32
(
swapper
.
ui32
);
return
swapper
.
f
;
}
/**
* \name Swap to native
* Byteswap item from the specified endianness to the native endianness.
*/
/*@{*/
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define SDL_SwapLE16(X) (X)
#define SDL_SwapLE32(X) (X)
#define SDL_SwapLE64(X) (X)
#define SDL_SwapFloatLE(X) (X)
#define SDL_SwapBE16(X) SDL_Swap16(X)
#define SDL_SwapBE32(X) SDL_Swap32(X)
#define SDL_SwapBE64(X) SDL_Swap64(X)
#define SDL_SwapFloatBE(X) SDL_SwapFloat(X)
#else
#define SDL_SwapLE16(X) SDL_Swap16(X)
#define SDL_SwapLE32(X) SDL_Swap32(X)
#define SDL_SwapLE64(X) SDL_Swap64(X)
#define SDL_SwapFloatLE(X) SDL_SwapFloat(X)
#define SDL_SwapBE16(X) (X)
#define SDL_SwapBE32(X) (X)
#define SDL_SwapBE64(X) (X)
#define SDL_SwapFloatBE(X) (X)
#endif
/*@}*//*Swap to native*/
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_endian_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_error.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_error.h
*
* Simple error message routines for SDL.
*/
#ifndef _SDL_error_h
#define _SDL_error_h
#include "SDL_stdinc.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/* Public functions */
extern
DECLSPEC
void
SDLCALL
SDL_SetError
(
const
char
*
fmt
,
...);
extern
DECLSPEC
char
*
SDLCALL
SDL_GetError
(
void
);
extern
DECLSPEC
void
SDLCALL
SDL_ClearError
(
void
);
/**
* \name Internal error functions
*
* \internal
* Private error message function - used internally.
*/
/*@{*/
#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
typedef
enum
{
SDL_ENOMEM
,
SDL_EFREAD
,
SDL_EFWRITE
,
SDL_EFSEEK
,
SDL_UNSUPPORTED
,
SDL_LASTERROR
}
SDL_errorcode
;
extern
DECLSPEC
void
SDLCALL
SDL_Error
(
SDL_errorcode
code
);
/*@}*//*Internal error functions*/
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_error_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_events.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_events.h
*
* Include file for SDL event handling.
*/
#ifndef _SDL_events_h
#define _SDL_events_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_video.h"
#include "SDL_keyboard.h"
#include "SDL_mouse.h"
#include "SDL_joystick.h"
#include "SDL_quit.h"
#include "SDL_gesture.h"
#include "SDL_touch.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/* General keyboard/mouse state definitions */
#define SDL_RELEASED 0
#define SDL_PRESSED 1
/**
* \brief The types of events that can be delivered.
*/
typedef
enum
{
SDL_FIRSTEVENT
=
0
,
/**< Unused (do not remove) */
/* Application events */
SDL_QUIT
=
0x100
,
/**< User-requested quit */
/* Window events */
SDL_WINDOWEVENT
=
0x200
,
/**< Window state change */
SDL_SYSWMEVENT
,
/**< System specific event */
/* Keyboard events */
SDL_KEYDOWN
=
0x300
,
/**< Keys pressed */
SDL_KEYUP
,
/**< Keys released */
SDL_TEXTEDITING
,
/**< Keyboard text editing (composition) */
SDL_TEXTINPUT
,
/**< Keyboard text input */
/* Mouse events */
SDL_MOUSEMOTION
=
0x400
,
/**< Mouse moved */
SDL_MOUSEBUTTONDOWN
,
/**< Mouse button pressed */
SDL_MOUSEBUTTONUP
,
/**< Mouse button released */
SDL_MOUSEWHEEL
,
/**< Mouse wheel motion */
/* Tablet or multiple mice input device events */
SDL_INPUTMOTION
=
0x500
,
/**< Input moved */
SDL_INPUTBUTTONDOWN
,
/**< Input button pressed */
SDL_INPUTBUTTONUP
,
/**< Input button released */
SDL_INPUTWHEEL
,
/**< Input wheel motion */
SDL_INPUTPROXIMITYIN
,
/**< Input pen entered proximity */
SDL_INPUTPROXIMITYOUT
,
/**< Input pen left proximity */
/* Joystick events */
SDL_JOYAXISMOTION
=
0x600
,
/**< Joystick axis motion */
SDL_JOYBALLMOTION
,
/**< Joystick trackball motion */
SDL_JOYHATMOTION
,
/**< Joystick hat position change */
SDL_JOYBUTTONDOWN
,
/**< Joystick button pressed */
SDL_JOYBUTTONUP
,
/**< Joystick button released */
/* Touch events */
SDL_FINGERDOWN
=
0x700
,
SDL_FINGERUP
,
SDL_FINGERMOTION
,
SDL_TOUCHBUTTONDOWN
,
SDL_TOUCHBUTTONUP
,
/* Gesture events */
SDL_DOLLARGESTURE
=
0x800
,
SDL_DOLLARRECORD
,
SDL_MULTIGESTURE
,
/* Clipboard events */
SDL_CLIPBOARDUPDATE
=
0x900
,
/**< The clipboard changed */
/* Obsolete events */
SDL_EVENT_COMPAT1
=
0x7000
,
/**< SDL 1.2 events for compatibility */
SDL_EVENT_COMPAT2
,
SDL_EVENT_COMPAT3
,
/** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
* and should be allocated with SDL_RegisterEvents()
*/
SDL_USEREVENT
=
0x8000
,
/**
* This last event is only for bounding internal arrays
*/
SDL_LASTEVENT
=
0xFFFF
}
SDL_EventType
;
/**
* \brief Window state change event data (event.window.*)
*/
typedef
struct
SDL_WindowEvent
{
Uint32
type
;
/**< ::SDL_WINDOWEVENT */
Uint32
windowID
;
/**< The associated window */
Uint8
event
;
/**< ::SDL_WindowEventID */
Uint8
padding1
;
Uint8
padding2
;
Uint8
padding3
;
int
data1
;
/**< event dependent data */
int
data2
;
/**< event dependent data */
}
SDL_WindowEvent
;
/**
* \brief Keyboard button event structure (event.key.*)
*/
typedef
struct
SDL_KeyboardEvent
{
Uint32
type
;
/**< ::SDL_KEYDOWN or ::SDL_KEYUP */
Uint32
windowID
;
/**< The window with keyboard focus, if any */
Uint8
state
;
/**< ::SDL_PRESSED or ::SDL_RELEASED */
Uint8
padding1
;
Uint8
padding2
;
Uint8
padding3
;
SDL_keysym
keysym
;
/**< The key that was pressed or released */
}
SDL_KeyboardEvent
;
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
/**
* \brief Keyboard text editing event structure (event.edit.*)
*/
typedef
struct
SDL_TextEditingEvent
{
Uint32
type
;
/**< ::SDL_TEXTEDITING */
Uint32
windowID
;
/**< The window with keyboard focus, if any */
char
text
[
SDL_TEXTEDITINGEVENT_TEXT_SIZE
];
/**< The editing text */
int
start
;
/**< The start cursor of selected editing text */
int
length
;
/**< The length of selected editing text */
}
SDL_TextEditingEvent
;
#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
/**
* \brief Keyboard text input event structure (event.text.*)
*/
typedef
struct
SDL_TextInputEvent
{
Uint32
type
;
/**< ::SDL_TEXTINPUT */
Uint32
windowID
;
/**< The window with keyboard focus, if any */
char
text
[
SDL_TEXTINPUTEVENT_TEXT_SIZE
];
/**< The input text */
}
SDL_TextInputEvent
;
/**
* \brief Mouse motion event structure (event.motion.*)
*/
typedef
struct
SDL_MouseMotionEvent
{
Uint32
type
;
/**< ::SDL_MOUSEMOTION */
Uint32
windowID
;
/**< The window with mouse focus, if any */
Uint8
state
;
/**< The current button state */
Uint8
padding1
;
Uint8
padding2
;
Uint8
padding3
;
int
x
;
/**< X coordinate, relative to window */
int
y
;
/**< Y coordinate, relative to window */
int
xrel
;
/**< The relative motion in the X direction */
int
yrel
;
/**< The relative motion in the Y direction */
}
SDL_MouseMotionEvent
;
/**
* \brief Mouse button event structure (event.button.*)
*/
typedef
struct
SDL_MouseButtonEvent
{
Uint32
type
;
/**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
Uint32
windowID
;
/**< The window with mouse focus, if any */
Uint8
button
;
/**< The mouse button index */
Uint8
state
;
/**< ::SDL_PRESSED or ::SDL_RELEASED */
Uint8
padding1
;
Uint8
padding2
;
int
x
;
/**< X coordinate, relative to window */
int
y
;
/**< Y coordinate, relative to window */
}
SDL_MouseButtonEvent
;
/**
* \brief Mouse wheel event structure (event.wheel.*)
*/
typedef
struct
SDL_MouseWheelEvent
{
Uint32
type
;
/**< ::SDL_MOUSEWHEEL */
Uint32
windowID
;
/**< The window with mouse focus, if any */
int
x
;
/**< The amount scrolled horizontally */
int
y
;
/**< The amount scrolled vertically */
}
SDL_MouseWheelEvent
;
/**
* \brief Joystick axis motion event structure (event.jaxis.*)
*/
typedef
struct
SDL_JoyAxisEvent
{
Uint32
type
;
/**< ::SDL_JOYAXISMOTION */
Uint8
which
;
/**< The joystick device index */
Uint8
axis
;
/**< The joystick axis index */
Uint8
padding1
;
Uint8
padding2
;
int
value
;
/**< The axis value (range: -32768 to 32767) */
}
SDL_JoyAxisEvent
;
/**
* \brief Joystick trackball motion event structure (event.jball.*)
*/
typedef
struct
SDL_JoyBallEvent
{
Uint32
type
;
/**< ::SDL_JOYBALLMOTION */
Uint8
which
;
/**< The joystick device index */
Uint8
ball
;
/**< The joystick trackball index */
Uint8
padding1
;
Uint8
padding2
;
int
xrel
;
/**< The relative motion in the X direction */
int
yrel
;
/**< The relative motion in the Y direction */
}
SDL_JoyBallEvent
;
/**
* \brief Joystick hat position change event structure (event.jhat.*)
*/
typedef
struct
SDL_JoyHatEvent
{
Uint32
type
;
/**< ::SDL_JOYHATMOTION */
Uint8
which
;
/**< The joystick device index */
Uint8
hat
;
/**< The joystick hat index */
Uint8
value
;
/**< The hat position value.
* \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
* \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
* \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
*
* Note that zero means the POV is centered.
*/
Uint8
padding1
;
}
SDL_JoyHatEvent
;
/**
* \brief Joystick button event structure (event.jbutton.*)
*/
typedef
struct
SDL_JoyButtonEvent
{
Uint32
type
;
/**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
Uint8
which
;
/**< The joystick device index */
Uint8
button
;
/**< The joystick button index */
Uint8
state
;
/**< ::SDL_PRESSED or ::SDL_RELEASED */
Uint8
padding1
;
}
SDL_JoyButtonEvent
;
/**
* \brief Touch finger motion/finger event structure (event.tmotion.*)
*/
typedef
struct
SDL_TouchFingerEvent
{
Uint32
type
;
/**< ::SDL_FINGERMOTION OR
SDL_FINGERDOWN OR SDL_FINGERUP*/
Uint32
windowID
;
/**< The window with mouse focus, if any */
long
touchId
;
/**< The touch device id */
long
fingerId
;
Uint8
state
;
/**< The current button state */
Uint8
padding1
;
Uint8
padding2
;
Uint8
padding3
;
float
x
;
float
y
;
int
pressure
;
}
SDL_TouchFingerEvent
;
/**
* \brief Touch finger motion/finger event structure (event.tmotion.*)
*/
typedef
struct
SDL_TouchButtonEvent
{
Uint32
type
;
/**< ::SDL_TOUCHBUTTONUP OR SDL_TOUCHBUTTONDOWN */
Uint32
windowID
;
/**< The window with mouse focus, if any */
long
touchId
;
/**< The touch device index */
Uint8
state
;
/**< The current button state */
Uint8
button
;
/**< The button changing state */
Uint8
padding1
;
Uint8
padding2
;
}
SDL_TouchButtonEvent
;
/**
* \brief Multiple Finger Gesture Event
*/
typedef
struct
SDL_MultiGestureEvent
{
Uint32
type
;
/**< ::SDL_MULTIGESTURE */
Uint32
windowID
;
/**< The window with mouse focus, if any */
long
touchId
;
/**< The touch device index */
float
dTheta
;
float
dDist
;
float
x
;
//currently 0...1. Change to screen coords?
float
y
;
}
SDL_MultiGestureEvent
;
typedef
struct
SDL_DollarGestureEvent
{
Uint32
type
;
/**< ::SDL_DOLLARGESTURE */
Uint32
windowID
;
/**< The window with mouse focus, if any */
long
touchId
;
/**< The touch device index */
unsigned
long
gestureId
;
float
error
;
/*
//TODO: Enable to give location?
float x; //currently 0...1. Change to screen coords?
float y;
*/
}
SDL_DollarGestureEvent
;
/**
* \brief The "quit requested" event
*/
typedef
struct
SDL_QuitEvent
{
Uint32
type
;
/**< ::SDL_QUIT */
}
SDL_QuitEvent
;
/**
* \brief A user-defined event type (event.user.*)
*/
typedef
struct
SDL_UserEvent
{
Uint32
type
;
/**< ::SDL_USEREVENT through ::SDL_NUMEVENTS-1 */
Uint32
windowID
;
/**< The associated window if any */
int
code
;
/**< User defined event code */
void
*
data1
;
/**< User defined data pointer */
void
*
data2
;
/**< User defined data pointer */
}
SDL_UserEvent
;
struct
SDL_SysWMmsg
;
typedef
struct
SDL_SysWMmsg
SDL_SysWMmsg
;
/**
* \brief A video driver dependent system event (event.syswm.*)
*
* \note If you want to use this event, you should include SDL_syswm.h.
*/
typedef
struct
SDL_SysWMEvent
{
Uint32
type
;
/**< ::SDL_SYSWMEVENT */
SDL_SysWMmsg
*
msg
;
/**< driver dependent data, defined in SDL_syswm.h */
}
SDL_SysWMEvent
;
#ifndef SDL_NO_COMPAT
/**
* \addtogroup Compatibility
*/
/*@{*/
/**
* \name Typedefs for backwards compatibility
*/
/*@{*/
typedef
struct
SDL_ActiveEvent
{
Uint32
type
;
Uint8
gain
;
Uint8
state
;
}
SDL_ActiveEvent
;
typedef
struct
SDL_ResizeEvent
{
Uint32
type
;
int
w
;
int
h
;
}
SDL_ResizeEvent
;
/*@}*/
/*@}*//*Compatibility*/
#endif
/**
* \brief General event structure
*/
typedef
union
SDL_Event
{
Uint32
type
;
/**< Event type, shared with all events */
SDL_WindowEvent
window
;
/**< Window event data */
SDL_KeyboardEvent
key
;
/**< Keyboard event data */
SDL_TextEditingEvent
edit
;
/**< Text editing event data */
SDL_TextInputEvent
text
;
/**< Text input event data */
SDL_MouseMotionEvent
motion
;
/**< Mouse motion event data */
SDL_MouseButtonEvent
button
;
/**< Mouse button event data */
SDL_MouseWheelEvent
wheel
;
/**< Mouse wheel event data */
SDL_JoyAxisEvent
jaxis
;
/**< Joystick axis event data */
SDL_JoyBallEvent
jball
;
/**< Joystick ball event data */
SDL_JoyHatEvent
jhat
;
/**< Joystick hat event data */
SDL_JoyButtonEvent
jbutton
;
/**< Joystick button event data */
SDL_QuitEvent
quit
;
/**< Quit request event data */
SDL_UserEvent
user
;
/**< Custom event data */
SDL_SysWMEvent
syswm
;
/**< System dependent window event data */
SDL_TouchFingerEvent
tfinger
;
/**< Touch finger event data */
SDL_TouchButtonEvent
tbutton
;
/**< Touch button event data */
SDL_MultiGestureEvent
mgesture
;
/**< Multi Finger Gesture data*/
SDL_DollarGestureEvent
dgesture
;
/**< Multi Finger Gesture data*/
/** Temporarily here for backwards compatibility */
/*@{*/
#ifndef SDL_NO_COMPAT
SDL_ActiveEvent
active
;
SDL_ResizeEvent
resize
;
#endif
/*@}*/
}
SDL_Event
;
/* Function prototypes */
/**
* Pumps the event loop, gathering events from the input devices.
*
* This function updates the event queue and internal input device state.
*
* This should only be run in the thread that sets the video mode.
*/
extern
DECLSPEC
void
SDLCALL
SDL_PumpEvents
(
void
);
/*@{*/
typedef
enum
{
SDL_ADDEVENT
,
SDL_PEEKEVENT
,
SDL_GETEVENT
}
SDL_eventaction
;
/**
* Checks the event queue for messages and optionally returns them.
*
* If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to
* the back of the event queue.
*
* If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
* of the event queue, matching \c mask, will be returned and will not
* be removed from the queue.
*
* If \c action is ::SDL_GETEVENT, up to \c numevents events at the front
* of the event queue, matching \c mask, will be returned and will be
* removed from the queue.
*
* \return The number of events actually stored, or -1 if there was an error.
*
* This function is thread-safe.
*/
extern
DECLSPEC
int
SDLCALL
SDL_PeepEvents
(
SDL_Event
*
events
,
int
numevents
,
SDL_eventaction
action
,
Uint32
minType
,
Uint32
maxType
);
/*@}*/
/**
* Checks to see if certain event types are in the event queue.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_HasEvent
(
Uint32
type
);
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_HasEvents
(
Uint32
minType
,
Uint32
maxType
);
/**
* This function clears events from the event queue
*/
extern
DECLSPEC
void
SDLCALL
SDL_FlushEvent
(
Uint32
type
);
extern
DECLSPEC
void
SDLCALL
SDL_FlushEvents
(
Uint32
minType
,
Uint32
maxType
);
/**
* \brief Polls for currently pending events.
*
* \return 1 if there are any pending events, or 0 if there are none available.
*
* \param event If not NULL, the next event is removed from the queue and
* stored in that area.
*/
extern
DECLSPEC
int
SDLCALL
SDL_PollEvent
(
SDL_Event
*
event
);
/**
* \brief Waits indefinitely for the next available event.
*
* \return 1, or 0 if there was an error while waiting for events.
*
* \param event If not NULL, the next event is removed from the queue and
* stored in that area.
*/
extern
DECLSPEC
int
SDLCALL
SDL_WaitEvent
(
SDL_Event
*
event
);
/**
* \brief Waits until the specified timeout (in milliseconds) for the next
* available event.
*
* \return 1, or 0 if there was an error while waiting for events.
*
* \param event If not NULL, the next event is removed from the queue and
* stored in that area.
*/
extern
DECLSPEC
int
SDLCALL
SDL_WaitEventTimeout
(
SDL_Event
*
event
,
int
timeout
);
/**
* \brief Add an event to the event queue.
*
* \return 1 on success, 0 if the event was filtered, or -1 if the event queue
* was full or there was some other error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_PushEvent
(
SDL_Event
*
event
);
typedef
int
(
SDLCALL
*
SDL_EventFilter
)
(
void
*
userdata
,
SDL_Event
*
event
);
/**
* Sets up a filter to process all events before they change internal state and
* are posted to the internal event queue.
*
* The filter is protypted as:
* \code
* int SDL_EventFilter(void *userdata, SDL_Event * event);
* \endcode
*
* If the filter returns 1, then the event will be added to the internal queue.
* If it returns 0, then the event will be dropped from the queue, but the
* internal state will still be updated. This allows selective filtering of
* dynamically arriving events.
*
* \warning Be very careful of what you do in the event filter function, as
* it may run in a different thread!
*
* There is one caveat when dealing with the ::SDL_QUITEVENT event type. The
* event filter is only called when the window manager desires to close the
* application window. If the event filter returns 1, then the window will
* be closed, otherwise the window will remain open if possible.
*
* If the quit event is generated by an interrupt signal, it will bypass the
* internal queue and be delivered to the application at the next event poll.
*/
extern
DECLSPEC
void
SDLCALL
SDL_SetEventFilter
(
SDL_EventFilter
filter
,
void
*
userdata
);
/**
* Return the current event filter - can be used to "chain" filters.
* If there is no event filter set, this function returns SDL_FALSE.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_GetEventFilter
(
SDL_EventFilter
*
filter
,
void
**
userdata
);
/**
* Run the filter function on the current event queue, removing any
* events for which the filter returns 0.
*/
extern
DECLSPEC
void
SDLCALL
SDL_FilterEvents
(
SDL_EventFilter
filter
,
void
*
userdata
);
/*@{*/
#define SDL_QUERY -1
#define SDL_IGNORE 0
#define SDL_DISABLE 0
#define SDL_ENABLE 1
/**
* This function allows you to set the state of processing certain events.
* - If \c state is set to ::SDL_IGNORE, that event will be automatically
* dropped from the event queue and will not event be filtered.
* - If \c state is set to ::SDL_ENABLE, that event will be processed
* normally.
* - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
* current processing state of the specified event.
*/
extern
DECLSPEC
Uint8
SDLCALL
SDL_EventState
(
Uint32
type
,
int
state
);
/*@}*/
#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
/**
* This function allocates a set of user-defined events, and returns
* the beginning event number for that set of events.
*
* If there aren't enough user-defined events left, this function
* returns (Uint32)-1
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_RegisterEvents
(
int
numevents
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_events_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_gesture.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_gesture.h
*
* Include file for SDL gesture event handling.
*/
#ifndef _SDL_gesture_h
#define _SDL_gesture_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_video.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/* Function prototypes */
/**
* \brief Begin Recording a gesture on the specified touch, or all touches (-1)
*
*
*/
extern
DECLSPEC
int
SDLCALL
SDL_RecordGesture
(
int
touchId
);
/**
* \brief Save all currently loaded Dollar Gesture templates
*
*
*/
extern
DECLSPEC
int
SDLCALL
SDL_SaveAllDollarTemplates
(
SDL_RWops
*
src
);
/**
* \brief Save a currently loaded Dollar Gesture template
*
*
*/
extern
DECLSPEC
int
SDLCALL
SDL_SaveDollarTemplate
(
unsigned
long
gestureId
,
SDL_RWops
*
src
);
/**
* \brief Load Dollar Gesture templates from a file
*
*
*/
extern
DECLSPEC
int
SDLCALL
SDL_LoadDollarTemplates
(
int
touchId
,
SDL_RWops
*
src
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_gesture_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_haptic.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 2008 Edgar Simo
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_haptic.h
*
* \brief The SDL Haptic subsystem allows you to control haptic (force feedback)
* devices.
*
* The basic usage is as follows:
* - Initialize the Subsystem (::SDL_INIT_HAPTIC).
* - Open a Haptic Device.
* - SDL_HapticOpen() to open from index.
* - SDL_HapticOpenFromJoystick() to open from an existing joystick.
* - Create an effect (::SDL_HapticEffect).
* - Upload the effect with SDL_HapticNewEffect().
* - Run the effect with SDL_HapticRunEffect().
* - (optional) Free the effect with SDL_HapticDestroyEffect().
* - Close the haptic device with SDL_HapticClose().
*
* \par Example:
* \code
* int test_haptic( SDL_Joystick * joystick ) {
* SDL_Haptic *haptic;
* SDL_HapticEffect effect;
* int effect_id;
*
* // Open the device
* haptic = SDL_HapticOpenFromJoystick( joystick );
* if (haptic == NULL) return -1; // Most likely joystick isn't haptic
*
* // See if it can do sine waves
* if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) {
* SDL_HapticClose(haptic); // No sine effect
* return -1;
* }
*
* // Create the effect
* memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default
* effect.type = SDL_HAPTIC_SINE;
* effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates
* effect.periodic.direction.dir[0] = 18000; // Force comes from south
* effect.periodic.period = 1000; // 1000 ms
* effect.periodic.magnitude = 20000; // 20000/32767 strength
* effect.periodic.length = 5000; // 5 seconds long
* effect.periodic.attack_length = 1000; // Takes 1 second to get max strength
* effect.periodic.fade_length = 1000; // Takes 1 second to fade away
*
* // Upload the effect
* effect_id = SDL_HapticNewEffect( haptic, &effect );
*
* // Test the effect
* SDL_HapticRunEffect( haptic, effect_id, 1 );
* SDL_Delay( 5000); // Wait for the effect to finish
*
* // We destroy the effect, although closing the device also does this
* SDL_HapticDestroyEffect( haptic, effect_id );
*
* // Close the device
* SDL_HapticClose(haptic);
*
* return 0; // Success
* }
* \endcode
* \author Edgar Simo Serra
*/
#ifndef _SDL_haptic_h
#define _SDL_haptic_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_joystick.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/* __cplusplus */
/**
* \typedef SDL_Haptic
*
* \brief The haptic structure used to identify an SDL haptic.
*
* \sa SDL_HapticOpen
* \sa SDL_HapticOpenFromJoystick
* \sa SDL_HapticClose
*/
struct
_SDL_Haptic
;
typedef
struct
_SDL_Haptic
SDL_Haptic
;
/**
* \name Haptic features
*
* Different haptic features a device can have.
*/
/*@{*/
/**
* \name Haptic effects
*/
/*@{*/
/**
* \brief Constant effect supported.
*
* Constant haptic effect.
*
* \sa SDL_HapticCondition
*/
#define SDL_HAPTIC_CONSTANT (1<<0)
/**
* \brief Sine wave effect supported.
*
* Periodic haptic effect that simulates sine waves.
*
* \sa SDL_HapticPeriodic
*/
#define SDL_HAPTIC_SINE (1<<1)
/**
* \brief Square wave effect supported.
*
* Periodic haptic effect that simulates square waves.
*
* \sa SDL_HapticPeriodic
*/
#define SDL_HAPTIC_SQUARE (1<<2)
/**
* \brief Triangle wave effect supported.
*
* Periodic haptic effect that simulates triangular waves.
*
* \sa SDL_HapticPeriodic
*/
#define SDL_HAPTIC_TRIANGLE (1<<3)
/**
* \brief Sawtoothup wave effect supported.
*
* Periodic haptic effect that simulates saw tooth up waves.
*
* \sa SDL_HapticPeriodic
*/
#define SDL_HAPTIC_SAWTOOTHUP (1<<4)
/**
* \brief Sawtoothdown wave effect supported.
*
* Periodic haptic effect that simulates saw tooth down waves.
*
* \sa SDL_HapticPeriodic
*/
#define SDL_HAPTIC_SAWTOOTHDOWN (1<<5)
/**
* \brief Ramp effect supported.
*
* Ramp haptic effect.
*
* \sa SDL_HapticRamp
*/
#define SDL_HAPTIC_RAMP (1<<6)
/**
* \brief Spring effect supported - uses axes position.
*
* Condition haptic effect that simulates a spring. Effect is based on the
* axes position.
*
* \sa SDL_HapticCondition
*/
#define SDL_HAPTIC_SPRING (1<<7)
/**
* \brief Damper effect supported - uses axes velocity.
*
* Condition haptic effect that simulates dampening. Effect is based on the
* axes velocity.
*
* \sa SDL_HapticCondition
*/
#define SDL_HAPTIC_DAMPER (1<<8)
/**
* \brief Inertia effect supported - uses axes acceleration.
*
* Condition haptic effect that simulates inertia. Effect is based on the axes
* acceleration.
*
* \sa SDL_HapticCondition
*/
#define SDL_HAPTIC_INERTIA (1<<9)
/**
* \brief Friction effect supported - uses axes movement.
*
* Condition haptic effect that simulates friction. Effect is based on the
* axes movement.
*
* \sa SDL_HapticCondition
*/
#define SDL_HAPTIC_FRICTION (1<<10)
/**
* \brief Custom effect is supported.
*
* User defined custom haptic effect.
*/
#define SDL_HAPTIC_CUSTOM (1<<11)
/*@}*//*Haptic effects*/
/* These last few are features the device has, not effects */
/**
* \brief Device can set global gain.
*
* Device supports setting the global gain.
*
* \sa SDL_HapticSetGain
*/
#define SDL_HAPTIC_GAIN (1<<12)
/**
* \brief Device can set autocenter.
*
* Device supports setting autocenter.
*
* \sa SDL_HapticSetAutocenter
*/
#define SDL_HAPTIC_AUTOCENTER (1<<13)
/**
* \brief Device can be queried for effect status.
*
* Device can be queried for effect status.
*
* \sa SDL_HapticGetEffectStatus
*/
#define SDL_HAPTIC_STATUS (1<<14)
/**
* \brief Device can be paused.
*
* \sa SDL_HapticPause
* \sa SDL_HapticUnpause
*/
#define SDL_HAPTIC_PAUSE (1<<15)
/**
* \name Direction encodings
*/
/*@{*/
/**
* \brief Uses polar coordinates for the direction.
*
* \sa SDL_HapticDirection
*/
#define SDL_HAPTIC_POLAR 0
/**
* \brief Uses cartesian coordinates for the direction.
*
* \sa SDL_HapticDirection
*/
#define SDL_HAPTIC_CARTESIAN 1
/**
* \brief Uses spherical coordinates for the direction.
*
* \sa SDL_HapticDirection
*/
#define SDL_HAPTIC_SPHERICAL 2
/*@}*//*Direction encodings*/
/*@}*//*Haptic features*/
/*
* Misc defines.
*/
/**
* \brief Used to play a device an infinite number of times.
*
* \sa SDL_HapticRunEffect
*/
#define SDL_HAPTIC_INFINITY 4294967295U
/**
* \brief Structure that represents a haptic direction.
*
* Directions can be specified by:
* - ::SDL_HAPTIC_POLAR : Specified by polar coordinates.
* - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates.
* - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates.
*
* Cardinal directions of the haptic device are relative to the positioning
* of the device. North is considered to be away from the user.
*
* The following diagram represents the cardinal directions:
* \verbatim
.--.
|__| .-------.
|=.| |.-----.|
|--| || ||
| | |'-----'|
|__|~')_____('
[ COMPUTER ]
North (0,-1)
^
|
|
(1,0) West <----[ HAPTIC ]----> East (-1,0)
|
|
v
South (0,1)
[ USER ]
\|||/
(o o)
---ooO-(_)-Ooo---
\endverbatim
*
* If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a
* degree starting north and turning clockwise. ::SDL_HAPTIC_POLAR only uses
* the first \c dir parameter. The cardinal directions would be:
* - North: 0 (0 degrees)
* - East: 9000 (90 degrees)
* - South: 18000 (180 degrees)
* - West: 27000 (270 degrees)
*
* If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions
* (X axis, Y axis and Z axis (with 3 axes)). ::SDL_HAPTIC_CARTESIAN uses
* the first three \c dir parameters. The cardinal directions would be:
* - North: 0,-1, 0
* - East: -1, 0, 0
* - South: 0, 1, 0
* - West: 1, 0, 0
*
* The Z axis represents the height of the effect if supported, otherwise
* it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you
* can use any multiple you want, only the direction matters.
*
* If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations.
* The first two \c dir parameters are used. The \c dir parameters are as
* follows (all values are in hundredths of degrees):
* - Degrees from (1, 0) rotated towards (0, 1).
* - Degrees towards (0, 0, 1) (device needs at least 3 axes).
*
*
* Example of force coming from the south with all encodings (force coming
* from the south means the user will have to pull the stick to counteract):
* \code
* SDL_HapticDirection direction;
*
* // Cartesian directions
* direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding.
* direction.dir[0] = 0; // X position
* direction.dir[1] = 1; // Y position
* // Assuming the device has 2 axes, we don't need to specify third parameter.
*
* // Polar directions
* direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding.
* direction.dir[0] = 18000; // Polar only uses first parameter
*
* // Spherical coordinates
* direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding
* direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters.
* \endcode
*
* \sa SDL_HAPTIC_POLAR
* \sa SDL_HAPTIC_CARTESIAN
* \sa SDL_HAPTIC_SPHERICAL
* \sa SDL_HapticEffect
* \sa SDL_HapticNumAxes
*/
typedef
struct
SDL_HapticDirection
{
Uint8
type
;
/**< The type of encoding. */
Sint32
dir
[
3
];
/**< The encoded direction. */
}
SDL_HapticDirection
;
/**
* \brief A structure containing a template for a Constant effect.
*
* The struct is exclusive to the ::SDL_HAPTIC_CONSTANT effect.
*
* A constant effect applies a constant force in the specified direction
* to the joystick.
*
* \sa SDL_HAPTIC_CONSTANT
* \sa SDL_HapticEffect
*/
typedef
struct
SDL_HapticConstant
{
/* Header */
Uint16
type
;
/**< ::SDL_HAPTIC_CONSTANT */
SDL_HapticDirection
direction
;
/**< Direction of the effect. */
/* Replay */
Uint32
length
;
/**< Duration of the effect. */
Uint16
delay
;
/**< Delay before starting the effect. */
/* Trigger */
Uint16
button
;
/**< Button that triggers the effect. */
Uint16
interval
;
/**< How soon it can be triggered again after button. */
/* Constant */
Sint16
level
;
/**< Strength of the constant effect. */
/* Envelope */
Uint16
attack_length
;
/**< Duration of the attack. */
Uint16
attack_level
;
/**< Level at the start of the attack. */
Uint16
fade_length
;
/**< Duration of the fade. */
Uint16
fade_level
;
/**< Level at the end of the fade. */
}
SDL_HapticConstant
;
/**
* \brief A structure containing a template for a Periodic effect.
*
* The struct handles the following effects:
* - ::SDL_HAPTIC_SINE
* - ::SDL_HAPTIC_SQUARE
* - ::SDL_HAPTIC_TRIANGLE
* - ::SDL_HAPTIC_SAWTOOTHUP
* - ::SDL_HAPTIC_SAWTOOTHDOWN
*
* A periodic effect consists in a wave-shaped effect that repeats itself
* over time. The type determines the shape of the wave and the parameters
* determine the dimensions of the wave.
*
* Phase is given by hundredth of a cyle meaning that giving the phase a value
* of 9000 will displace it 25% of it's period. Here are sample values:
* - 0: No phase displacement.
* - 9000: Displaced 25% of it's period.
* - 18000: Displaced 50% of it's period.
* - 27000: Displaced 75% of it's period.
* - 36000: Displaced 100% of it's period, same as 0, but 0 is preffered.
*
* Examples:
* \verbatim
SDL_HAPTIC_SINE
__ __ __ __
/ \ / \ / \ /
/ \__/ \__/ \__/
SDL_HAPTIC_SQUARE
__ __ __ __ __
| | | | | | | | | |
| |__| |__| |__| |__| |
SDL_HAPTIC_TRIANGLE
/\ /\ /\ /\ /\
/ \ / \ / \ / \ /
/ \/ \/ \/ \/
SDL_HAPTIC_SAWTOOTHUP
/| /| /| /| /| /| /|
/ | / | / | / | / | / | / |
/ |/ |/ |/ |/ |/ |/ |
SDL_HAPTIC_SAWTOOTHDOWN
\ |\ |\ |\ |\ |\ |\ |
\ | \ | \ | \ | \ | \ | \ |
\| \| \| \| \| \| \|
\endverbatim
*
* \sa SDL_HAPTIC_SINE
* \sa SDL_HAPTIC_SQUARE
* \sa SDL_HAPTIC_TRIANGLE
* \sa SDL_HAPTIC_SAWTOOTHUP
* \sa SDL_HAPTIC_SAWTOOTHDOWN
* \sa SDL_HapticEffect
*/
typedef
struct
SDL_HapticPeriodic
{
/* Header */
Uint16
type
;
/**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_SQUARE,
::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or
::SDL_HAPTIC_SAWTOOTHDOWN */
SDL_HapticDirection
direction
;
/**< Direction of the effect. */
/* Replay */
Uint32
length
;
/**< Duration of the effect. */
Uint16
delay
;
/**< Delay before starting the effect. */
/* Trigger */
Uint16
button
;
/**< Button that triggers the effect. */
Uint16
interval
;
/**< How soon it can be triggered again after button. */
/* Periodic */
Uint16
period
;
/**< Period of the wave. */
Sint16
magnitude
;
/**< Peak value. */
Sint16
offset
;
/**< Mean value of the wave. */
Uint16
phase
;
/**< Horizontal shift given by hundredth of a cycle. */
/* Envelope */
Uint16
attack_length
;
/**< Duration of the attack. */
Uint16
attack_level
;
/**< Level at the start of the attack. */
Uint16
fade_length
;
/**< Duration of the fade. */
Uint16
fade_level
;
/**< Level at the end of the fade. */
}
SDL_HapticPeriodic
;
/**
* \brief A structure containing a template for a Condition effect.
*
* The struct handles the following effects:
* - ::SDL_HAPTIC_SPRING: Effect based on axes position.
* - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity.
* - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration.
* - ::SDL_HAPTIC_FRICTION: Effect based on axes movement.
*
* Direction is handled by condition internals instead of a direction member.
* The condition effect specific members have three parameters. The first
* refers to the X axis, the second refers to the Y axis and the third
* refers to the Z axis. The right terms refer to the positive side of the
* axis and the left terms refer to the negative side of the axis. Please
* refer to the ::SDL_HapticDirection diagram for which side is positive and
* which is negative.
*
* \sa SDL_HapticDirection
* \sa SDL_HAPTIC_SPRING
* \sa SDL_HAPTIC_DAMPER
* \sa SDL_HAPTIC_INERTIA
* \sa SDL_HAPTIC_FRICTION
* \sa SDL_HapticEffect
*/
typedef
struct
SDL_HapticCondition
{
/* Header */
Uint16
type
;
/**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER,
::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */
SDL_HapticDirection
direction
;
/**< Direction of the effect - Not used ATM. */
/* Replay */
Uint32
length
;
/**< Duration of the effect. */
Uint16
delay
;
/**< Delay before starting the effect. */
/* Trigger */
Uint16
button
;
/**< Button that triggers the effect. */
Uint16
interval
;
/**< How soon it can be triggered again after button. */
/* Condition */
Uint16
right_sat
[
3
];
/**< Level when joystick is to the positive side. */
Uint16
left_sat
[
3
];
/**< Level when joystick is to the negative side. */
Sint16
right_coeff
[
3
];
/**< How fast to increase the force towards the positive side. */
Sint16
left_coeff
[
3
];
/**< How fast to increase the force towards the negative side. */
Uint16
deadband
[
3
];
/**< Size of the dead zone. */
Sint16
center
[
3
];
/**< Position of the dead zone. */
}
SDL_HapticCondition
;
/**
* \brief A structure containing a template for a Ramp effect.
*
* This struct is exclusively for the ::SDL_HAPTIC_RAMP effect.
*
* The ramp effect starts at start strength and ends at end strength.
* It augments in linear fashion. If you use attack and fade with a ramp
* they effects get added to the ramp effect making the effect become
* quadratic instead of linear.
*
* \sa SDL_HAPTIC_RAMP
* \sa SDL_HapticEffect
*/
typedef
struct
SDL_HapticRamp
{
/* Header */
Uint16
type
;
/**< ::SDL_HAPTIC_RAMP */
SDL_HapticDirection
direction
;
/**< Direction of the effect. */
/* Replay */
Uint32
length
;
/**< Duration of the effect. */
Uint16
delay
;
/**< Delay before starting the effect. */
/* Trigger */
Uint16
button
;
/**< Button that triggers the effect. */
Uint16
interval
;
/**< How soon it can be triggered again after button. */
/* Ramp */
Sint16
start
;
/**< Beginning strength level. */
Sint16
end
;
/**< Ending strength level. */
/* Envelope */
Uint16
attack_length
;
/**< Duration of the attack. */
Uint16
attack_level
;
/**< Level at the start of the attack. */
Uint16
fade_length
;
/**< Duration of the fade. */
Uint16
fade_level
;
/**< Level at the end of the fade. */
}
SDL_HapticRamp
;
/**
* \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect.
*
* A custom force feedback effect is much like a periodic effect, where the
* application can define it's exact shape. You will have to allocate the
* data yourself. Data should consist of channels * samples Uint16 samples.
*
* If channels is one, the effect is rotated using the defined direction.
* Otherwise it uses the samples in data for the different axes.
*
* \sa SDL_HAPTIC_CUSTOM
* \sa SDL_HapticEffect
*/
typedef
struct
SDL_HapticCustom
{
/* Header */
Uint16
type
;
/**< ::SDL_HAPTIC_CUSTOM */
SDL_HapticDirection
direction
;
/**< Direction of the effect. */
/* Replay */
Uint32
length
;
/**< Duration of the effect. */
Uint16
delay
;
/**< Delay before starting the effect. */
/* Trigger */
Uint16
button
;
/**< Button that triggers the effect. */
Uint16
interval
;
/**< How soon it can be triggered again after button. */
/* Custom */
Uint8
channels
;
/**< Axes to use, minimum of one. */
Uint16
period
;
/**< Sample periods. */
Uint16
samples
;
/**< Amount of samples. */
Uint16
*
data
;
/**< Should contain channels*samples items. */
/* Envelope */
Uint16
attack_length
;
/**< Duration of the attack. */
Uint16
attack_level
;
/**< Level at the start of the attack. */
Uint16
fade_length
;
/**< Duration of the fade. */
Uint16
fade_level
;
/**< Level at the end of the fade. */
}
SDL_HapticCustom
;
/**
* \brief The generic template for any haptic effect.
*
* All values max at 32767 (0x7FFF). Signed values also can be negative.
* Time values unless specified otherwise are in milliseconds.
*
* You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767
* value. Neither delay, interval, attack_length nor fade_length support
* ::SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends.
*
* Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of
* ::SDL_HAPTIC_INFINITY.
*
* Button triggers may not be supported on all devices, it is advised to not
* use them if possible. Buttons start at index 1 instead of index 0 like
* they joystick.
*
* If both attack_length and fade_level are 0, the envelope is not used,
* otherwise both values are used.
*
* Common parts:
* \code
* // Replay - All effects have this
* Uint32 length; // Duration of effect (ms).
* Uint16 delay; // Delay before starting effect.
*
* // Trigger - All effects have this
* Uint16 button; // Button that triggers effect.
* Uint16 interval; // How soon before effect can be triggered again.
*
* // Envelope - All effects except condition effects have this
* Uint16 attack_length; // Duration of the attack (ms).
* Uint16 attack_level; // Level at the start of the attack.
* Uint16 fade_length; // Duration of the fade out (ms).
* Uint16 fade_level; // Level at the end of the fade.
* \endcode
*
*
* Here we have an example of a constant effect evolution in time:
* \verbatim
Strength
^
|
| effect level --> _________________
| / \
| / \
| / \
| / \
| attack_level --> | \
| | | <--- fade_level
|
+--------------------------------------------------> Time
[--] [---]
attack_length fade_length
[------------------][-----------------------]
delay length
\endverbatim
*
* Note either the attack_level or the fade_level may be above the actual
* effect level.
*
* \sa SDL_HapticConstant
* \sa SDL_HapticPeriodic
* \sa SDL_HapticCondition
* \sa SDL_HapticRamp
* \sa SDL_HapticCustom
*/
typedef
union
SDL_HapticEffect
{
/* Common for all force feedback effects */
Uint16
type
;
/**< Effect type. */
SDL_HapticConstant
constant
;
/**< Constant effect. */
SDL_HapticPeriodic
periodic
;
/**< Periodic effect. */
SDL_HapticCondition
condition
;
/**< Condition effect. */
SDL_HapticRamp
ramp
;
/**< Ramp effect. */
SDL_HapticCustom
custom
;
/**< Custom effect. */
}
SDL_HapticEffect
;
/* Function prototypes */
/**
* \brief Count the number of joysticks attached to the system.
*
* \return Number of haptic devices detected on the system.
*/
extern
DECLSPEC
int
SDLCALL
SDL_NumHaptics
(
void
);
/**
* \brief Get the implementation dependent name of a Haptic device.
*
* This can be called before any joysticks are opened.
* If no name can be found, this function returns NULL.
*
* \param device_index Index of the device to get it's name.
* \return Name of the device or NULL on error.
*
* \sa SDL_NumHaptics
*/
extern
DECLSPEC
const
char
*
SDLCALL
SDL_HapticName
(
int
device_index
);
/**
* \brief Opens a Haptic device for usage.
*
* The index passed as an argument refers to the N'th Haptic device on this
* system.
*
* When opening a haptic device, it's gain will be set to maximum and
* autocenter will be disabled. To modify these values use
* SDL_HapticSetGain() and SDL_HapticSetAutocenter().
*
* \param device_index Index of the device to open.
* \return Device identifier or NULL on error.
*
* \sa SDL_HapticIndex
* \sa SDL_HapticOpenFromMouse
* \sa SDL_HapticOpenFromJoystick
* \sa SDL_HapticClose
* \sa SDL_HapticSetGain
* \sa SDL_HapticSetAutocenter
* \sa SDL_HapticPause
* \sa SDL_HapticStopAll
*/
extern
DECLSPEC
SDL_Haptic
*
SDLCALL
SDL_HapticOpen
(
int
device_index
);
/**
* \brief Checks if the haptic device at index has been opened.
*
* \param device_index Index to check to see if it has been opened.
* \return 1 if it has been opened or 0 if it hasn't.
*
* \sa SDL_HapticOpen
* \sa SDL_HapticIndex
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticOpened
(
int
device_index
);
/**
* \brief Gets the index of a haptic device.
*
* \param haptic Haptic device to get the index of.
* \return The index of the haptic device or -1 on error.
*
* \sa SDL_HapticOpen
* \sa SDL_HapticOpened
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticIndex
(
SDL_Haptic
*
haptic
);
/**
* \brief Gets whether or not the current mouse has haptic capabilities.
*
* \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't.
*
* \sa SDL_HapticOpenFromMouse
*/
extern
DECLSPEC
int
SDLCALL
SDL_MouseIsHaptic
(
void
);
/**
* \brief Tries to open a haptic device from the current mouse.
*
* \return The haptic device identifier or NULL on error.
*
* \sa SDL_MouseIsHaptic
* \sa SDL_HapticOpen
*/
extern
DECLSPEC
SDL_Haptic
*
SDLCALL
SDL_HapticOpenFromMouse
(
void
);
/**
* \brief Checks to see if a joystick has haptic features.
*
* \param joystick Joystick to test for haptic capabilities.
* \return 1 if the joystick is haptic, 0 if it isn't
* or -1 if an error ocurred.
*
* \sa SDL_HapticOpenFromJoystick
*/
extern
DECLSPEC
int
SDLCALL
SDL_JoystickIsHaptic
(
SDL_Joystick
*
joystick
);
/**
* \brief Opens a Haptic device for usage from a Joystick device.
*
* You must still close the haptic device seperately. It will not be closed
* with the joystick.
*
* When opening from a joystick you should first close the haptic device before
* closing the joystick device. If not, on some implementations the haptic
* device will also get unallocated and you'll be unable to use force feedback
* on that device.
*
* \param joystick Joystick to create a haptic device from.
* \return A valid haptic device identifier on success or NULL on error.
*
* \sa SDL_HapticOpen
* \sa SDL_HapticClose
*/
extern
DECLSPEC
SDL_Haptic
*
SDLCALL
SDL_HapticOpenFromJoystick
(
SDL_Joystick
*
joystick
);
/**
* \brief Closes a Haptic device previously opened with SDL_HapticOpen().
*
* \param haptic Haptic device to close.
*/
extern
DECLSPEC
void
SDLCALL
SDL_HapticClose
(
SDL_Haptic
*
haptic
);
/**
* \brief Returns the number of effects a haptic device can store.
*
* On some platforms this isn't fully supported, and therefore is an
* aproximation. Always check to see if your created effect was actually
* created and do not rely solely on SDL_HapticNumEffects().
*
* \param haptic The haptic device to query effect max.
* \return The number of effects the haptic device can store or
* -1 on error.
*
* \sa SDL_HapticNumEffectsPlaying
* \sa SDL_HapticQuery
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticNumEffects
(
SDL_Haptic
*
haptic
);
/**
* \brief Returns the number of effects a haptic device can play at the same
* time.
*
* This is not supported on all platforms, but will always return a value.
* Added here for the sake of completness.
*
* \param haptic The haptic device to query maximum playing effects.
* \return The number of effects the haptic device can play at the same time
* or -1 on error.
*
* \sa SDL_HapticNumEffects
* \sa SDL_HapticQuery
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticNumEffectsPlaying
(
SDL_Haptic
*
haptic
);
/**
* \brief Gets the haptic devices supported features in bitwise matter.
*
* Example:
* \code
* if (SDL_HapticQueryEffects(haptic) & SDL_HAPTIC_CONSTANT) {
* printf("We have constant haptic effect!");
* }
* \endcode
*
* \param haptic The haptic device to query.
* \return Haptic features in bitwise manner (OR'd).
*
* \sa SDL_HapticNumEffects
* \sa SDL_HapticEffectSupported
*/
extern
DECLSPEC
unsigned
int
SDLCALL
SDL_HapticQuery
(
SDL_Haptic
*
haptic
);
/**
* \brief Gets the number of haptic axes the device has.
*
* \sa SDL_HapticDirection
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticNumAxes
(
SDL_Haptic
*
haptic
);
/**
* \brief Checks to see if effect is supported by haptic.
*
* \param haptic Haptic device to check on.
* \param effect Effect to check to see if it is supported.
* \return 1 if effect is supported, 0 if it isn't or -1 on error.
*
* \sa SDL_HapticQuery
* \sa SDL_HapticNewEffect
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticEffectSupported
(
SDL_Haptic
*
haptic
,
SDL_HapticEffect
*
effect
);
/**
* \brief Creates a new haptic effect on the device.
*
* \param haptic Haptic device to create the effect on.
* \param effect Properties of the effect to create.
* \return The id of the effect on success or -1 on error.
*
* \sa SDL_HapticUpdateEffect
* \sa SDL_HapticRunEffect
* \sa SDL_HapticDestroyEffect
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticNewEffect
(
SDL_Haptic
*
haptic
,
SDL_HapticEffect
*
effect
);
/**
* \brief Updates the properties of an effect.
*
* Can be used dynamically, although behaviour when dynamically changing
* direction may be strange. Specifically the effect may reupload itself
* and start playing from the start. You cannot change the type either when
* running SDL_HapticUpdateEffect().
*
* \param haptic Haptic device that has the effect.
* \param effect Effect to update.
* \param data New effect properties to use.
* \return The id of the effect on success or -1 on error.
*
* \sa SDL_HapticNewEffect
* \sa SDL_HapticRunEffect
* \sa SDL_HapticDestroyEffect
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticUpdateEffect
(
SDL_Haptic
*
haptic
,
int
effect
,
SDL_HapticEffect
*
data
);
/**
* \brief Runs the haptic effect on it's assosciated haptic device.
*
* If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over
* repeating the envelope (attack and fade) every time. If you only want the
* effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length
* parameter.
*
* \param haptic Haptic device to run the effect on.
* \param effect Identifier of the haptic effect to run.
* \param iterations Number of iterations to run the effect. Use
* ::SDL_HAPTIC_INFINITY for infinity.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticStopEffect
* \sa SDL_HapticDestroyEffect
* \sa SDL_HapticGetEffectStatus
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticRunEffect
(
SDL_Haptic
*
haptic
,
int
effect
,
Uint32
iterations
);
/**
* \brief Stops the haptic effect on it's assosciated haptic device.
*
* \param haptic Haptic device to stop the effect on.
* \param effect Identifier of the effect to stop.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticRunEffect
* \sa SDL_HapticDestroyEffect
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticStopEffect
(
SDL_Haptic
*
haptic
,
int
effect
);
/**
* \brief Destroys a haptic effect on the device.
*
* This will stop the effect if it's running. Effects are automatically
* destroyed when the device is closed.
*
* \param haptic Device to destroy the effect on.
* \param effect Identifier of the effect to destroy.
*
* \sa SDL_HapticNewEffect
*/
extern
DECLSPEC
void
SDLCALL
SDL_HapticDestroyEffect
(
SDL_Haptic
*
haptic
,
int
effect
);
/**
* \brief Gets the status of the current effect on the haptic device.
*
* Device must support the ::SDL_HAPTIC_STATUS feature.
*
* \param haptic Haptic device to query the effect status on.
* \param effect Identifier of the effect to query it's status.
* \return 0 if it isn't playing, ::SDL_HAPTIC_PLAYING if it is playing
* or -1 on error.
*
* \sa SDL_HapticRunEffect
* \sa SDL_HapticStopEffect
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticGetEffectStatus
(
SDL_Haptic
*
haptic
,
int
effect
);
/**
* \brief Sets the global gain of the device.
*
* Device must support the ::SDL_HAPTIC_GAIN feature.
*
* The user may specify the maxmimum gain by setting the environment variable
* ::SDL_HAPTIC_GAIN_MAX which should be between 0 and 100. All calls to
* SDL_HapticSetGain() will scale linearly using ::SDL_HAPTIC_GAIN_MAX as the
* maximum.
*
* \param haptic Haptic device to set the gain on.
* \param gain Value to set the gain to, should be between 0 and 100.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticQuery
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticSetGain
(
SDL_Haptic
*
haptic
,
int
gain
);
/**
* \brief Sets the global autocenter of the device.
*
* Autocenter should be between 0 and 100. Setting it to 0 will disable
* autocentering.
*
* Device must support the ::SDL_HAPTIC_AUTOCENTER feature.
*
* \param haptic Haptic device to set autocentering on.
* \param autocenter Value to set autocenter to, 0 disables autocentering.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticQuery
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticSetAutocenter
(
SDL_Haptic
*
haptic
,
int
autocenter
);
/**
* \brief Pauses a haptic device.
*
* Device must support the ::SDL_HAPTIC_PAUSE feature. Call
* SDL_HapticUnpause() to resume playback.
*
* Do not modify the effects nor add new ones while the device is paused.
* That can cause all sorts of weird errors.
*
* \param haptic Haptic device to pause.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticUnpause
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticPause
(
SDL_Haptic
*
haptic
);
/**
* \brief Unpauses a haptic device.
*
* Call to unpause after SDL_HapticPause().
*
* \param haptic Haptic device to pause.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticPause
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticUnpause
(
SDL_Haptic
*
haptic
);
/**
* \brief Stops all the currently playing effects on a haptic device.
*
* \param haptic Haptic device to stop.
* \return 0 on success or -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_HapticStopAll
(
SDL_Haptic
*
haptic
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_haptic_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_input.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_input.h
*
* Include file for lowlevel SDL input device handling.
*
* This talks about individual devices, and not the system cursor. If you
* just want to know when the user moves the pointer somewhere in your
* window, this is NOT the API you want. This one handles things like
* multi-touch, drawing tablets, and multiple, separate mice.
*
* The other API is in SDL_mouse.h
*/
#ifndef _SDL_input_h
#define _SDL_input_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_video.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/* Function prototypes */
/* !!! FIXME: real documentation
* - Redetect devices
* - This invalidates all existing device information from previous queries!
* - There is an implicit (re)detect upon SDL_Init().
*/
extern
DECLSPEC
int
SDLCALL
SDL_RedetectInputDevices
(
void
);
/**
* \brief Get the number of mouse input devices available.
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetNumInputDevices
(
void
);
/**
* \brief Gets the name of a device with the given index.
*
* \param index is the index of the device, whose name is to be returned.
*
* \return the name of the device with the specified index
*/
extern
DECLSPEC
const
char
*
SDLCALL
SDL_GetInputDeviceName
(
int
index
);
extern
DECLSPEC
int
SDLCALL
SDL_IsDeviceDisconnected
(
int
index
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_mouse_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_joystick.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_joystick.h
*
* Include file for SDL joystick event handling
*/
#ifndef _SDL_joystick_h
#define _SDL_joystick_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* \file SDL_joystick.h
*
* In order to use these functions, SDL_Init() must have been called
* with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
* for joysticks, and load appropriate drivers.
*/
/* The joystick structure used to identify an SDL joystick */
struct
_SDL_Joystick
;
typedef
struct
_SDL_Joystick
SDL_Joystick
;
/* Function prototypes */
/**
* Count the number of joysticks attached to the system
*/
extern
DECLSPEC
int
SDLCALL
SDL_NumJoysticks
(
void
);
/**
* Get the implementation dependent name of a joystick.
* This can be called before any joysticks are opened.
* If no name can be found, this function returns NULL.
*/
extern
DECLSPEC
const
char
*
SDLCALL
SDL_JoystickName
(
int
device_index
);
/**
* Open a joystick for use.
* The index passed as an argument refers tothe N'th joystick on the system.
* This index is the value which will identify this joystick in future joystick
* events.
*
* \return A joystick identifier, or NULL if an error occurred.
*/
extern
DECLSPEC
SDL_Joystick
*
SDLCALL
SDL_JoystickOpen
(
int
device_index
);
/**
* Returns 1 if the joystick has been opened, or 0 if it has not.
*/
extern
DECLSPEC
int
SDLCALL
SDL_JoystickOpened
(
int
device_index
);
/**
* Get the device index of an opened joystick.
*/
extern
DECLSPEC
int
SDLCALL
SDL_JoystickIndex
(
SDL_Joystick
*
joystick
);
/**
* Get the number of general axis controls on a joystick.
*/
extern
DECLSPEC
int
SDLCALL
SDL_JoystickNumAxes
(
SDL_Joystick
*
joystick
);
/**
* Get the number of trackballs on a joystick.
*
* Joystick trackballs have only relative motion events associated
* with them and their state cannot be polled.
*/
extern
DECLSPEC
int
SDLCALL
SDL_JoystickNumBalls
(
SDL_Joystick
*
joystick
);
/**
* Get the number of POV hats on a joystick.
*/
extern
DECLSPEC
int
SDLCALL
SDL_JoystickNumHats
(
SDL_Joystick
*
joystick
);
/**
* Get the number of buttons on a joystick.
*/
extern
DECLSPEC
int
SDLCALL
SDL_JoystickNumButtons
(
SDL_Joystick
*
joystick
);
/**
* Update the current state of the open joysticks.
*
* This is called automatically by the event loop if any joystick
* events are enabled.
*/
extern
DECLSPEC
void
SDLCALL
SDL_JoystickUpdate
(
void
);
/**
* Enable/disable joystick event polling.
*
* If joystick events are disabled, you must call SDL_JoystickUpdate()
* yourself and check the state of the joystick when you want joystick
* information.
*
* The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
*/
extern
DECLSPEC
int
SDLCALL
SDL_JoystickEventState
(
int
state
);
/**
* Get the current state of an axis control on a joystick.
*
* The state is a value ranging from -32768 to 32767.
*
* The axis indices start at index 0.
*/
extern
DECLSPEC
Sint16
SDLCALL
SDL_JoystickGetAxis
(
SDL_Joystick
*
joystick
,
int
axis
);
/**
* \name Hat positions
*/
/*@{*/
#define SDL_HAT_CENTERED 0x00
#define SDL_HAT_UP 0x01
#define SDL_HAT_RIGHT 0x02
#define SDL_HAT_DOWN 0x04
#define SDL_HAT_LEFT 0x08
#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
/*@}*/
/**
* Get the current state of a POV hat on a joystick.
*
* The hat indices start at index 0.
*
* \return The return value is one of the following positions:
* - ::SDL_HAT_CENTERED
* - ::SDL_HAT_UP
* - ::SDL_HAT_RIGHT
* - ::SDL_HAT_DOWN
* - ::SDL_HAT_LEFT
* - ::SDL_HAT_RIGHTUP
* - ::SDL_HAT_RIGHTDOWN
* - ::SDL_HAT_LEFTUP
* - ::SDL_HAT_LEFTDOWN
*/
extern
DECLSPEC
Uint8
SDLCALL
SDL_JoystickGetHat
(
SDL_Joystick
*
joystick
,
int
hat
);
/**
* Get the ball axis change since the last poll.
*
* \return 0, or -1 if you passed it invalid parameters.
*
* The ball indices start at index 0.
*/
extern
DECLSPEC
int
SDLCALL
SDL_JoystickGetBall
(
SDL_Joystick
*
joystick
,
int
ball
,
int
*
dx
,
int
*
dy
);
/**
* Get the current state of a button on a joystick.
*
* The button indices start at index 0.
*/
extern
DECLSPEC
Uint8
SDLCALL
SDL_JoystickGetButton
(
SDL_Joystick
*
joystick
,
int
button
);
/**
* Close a joystick previously opened with SDL_JoystickOpen().
*/
extern
DECLSPEC
void
SDLCALL
SDL_JoystickClose
(
SDL_Joystick
*
joystick
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_joystick_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_keyboard.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_keyboard.h
*
* Include file for SDL keyboard event handling
*/
#ifndef _SDL_keyboard_h
#define _SDL_keyboard_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_keysym.h"
#include "SDL_video.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* \brief The SDL keysym structure, used in key events.
*/
typedef
struct
SDL_keysym
{
SDL_scancode
scancode
;
/**< SDL physical key code - see ::SDL_scancode for details */
SDLKey
sym
;
/**< SDL virtual key code - see ::SDLKey for details */
Uint16
mod
;
/**< current key modifiers */
Uint32
unicode
;
/**< \deprecated use SDL_TextInputEvent instead */
}
SDL_keysym
;
/* Function prototypes */
/**
* \brief Get the window which currently has keyboard focus.
*/
extern
DECLSPEC
SDL_Window
*
SDLCALL
SDL_GetKeyboardFocus
(
void
);
/**
* \brief Get a snapshot of the current state of the keyboard.
*
* \param numkeys if non-NULL, receives the length of the returned array.
*
* \return An array of key states. Indexes into this array are obtained by using ::SDL_scancode values.
*
* \b Example:
* \code
* Uint8 *state = SDL_GetKeyboardState(NULL);
* if ( state[SDL_SCANCODE_RETURN] ) {
* printf("<RETURN> is pressed.\n");
* }
* \endcode
*/
extern
DECLSPEC
Uint8
*
SDLCALL
SDL_GetKeyboardState
(
int
*
numkeys
);
/**
* \brief Get the current key modifier state for the keyboard.
*/
extern
DECLSPEC
SDLMod
SDLCALL
SDL_GetModState
(
void
);
/**
* \brief Set the current key modifier state for the keyboard.
*
* \note This does not change the keyboard state, only the key modifier flags.
*/
extern
DECLSPEC
void
SDLCALL
SDL_SetModState
(
SDLMod
modstate
);
/**
* \brief Get the key code corresponding to the given scancode according
* to the current keyboard layout.
*
* See ::SDLKey for details.
*
* \sa SDL_GetKeyName()
*/
extern
DECLSPEC
SDLKey
SDLCALL
SDL_GetKeyFromScancode
(
SDL_scancode
scancode
);
/**
* \brief Get the scancode corresponding to the given key code according to the
* current keyboard layout.
*
* See ::SDL_scancode for details.
*
* \sa SDL_GetScancodeName()
*/
extern
DECLSPEC
SDL_scancode
SDLCALL
SDL_GetScancodeFromKey
(
SDLKey
key
);
/**
* \brief Get a human-readable name for a scancode.
*
* \return A pointer to a UTF-8 string that stays valid at least until the next
* call to this function. If you need it around any longer, you must
* copy it. If the scancode doesn't have a name, this function returns
* an empty string ("").
*
* \sa SDL_scancode
*/
extern
DECLSPEC
const
char
*
SDLCALL
SDL_GetScancodeName
(
SDL_scancode
scancode
);
/**
* \brief Get a human-readable name for a key.
*
* \return A pointer to a UTF-8 string that stays valid at least until the next
* call to this function. If you need it around any longer, you must
* copy it. If the key doesn't have a name, this function returns an
* empty string ("").
*
* \sa SDLKey
*/
extern
DECLSPEC
const
char
*
SDLCALL
SDL_GetKeyName
(
SDLKey
key
);
/**
* \brief Start accepting Unicode text input events.
*
* \sa SDL_StopTextInput()
* \sa SDL_SetTextInputRect()
*/
extern
DECLSPEC
void
SDLCALL
SDL_StartTextInput
(
void
);
/**
* \brief Stop receiving any text input events.
*
* \sa SDL_StartTextInput()
*/
extern
DECLSPEC
void
SDLCALL
SDL_StopTextInput
(
void
);
/**
* \brief Set the rectangle used to type Unicode text inputs.
*
* \sa SDL_StartTextInput()
*/
extern
DECLSPEC
void
SDLCALL
SDL_SetTextInputRect
(
SDL_Rect
*
rect
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_keyboard_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_keysym.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_keysym.h
*
* Defines constants which identify keyboard keys and modifiers.
*/
#ifndef _SDL_keysym_h
#define _SDL_keysym_h
#include "SDL_stdinc.h"
#include "SDL_scancode.h"
/**
* \brief The SDL virtual key representation.
*
* Values of this type are used to represent keyboard keys using the current
* layout of the keyboard. These values include Unicode values representing
* the unmodified character that would be generated by pressing the key, or
* an SDLK_* constant for those keys that do not generate characters.
*/
typedef
Sint32
SDLKey
;
#define SDLK_SCANCODE_MASK (1<<30)
#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
enum
{
SDLK_UNKNOWN
=
0
,
SDLK_RETURN
=
'\r'
,
SDLK_ESCAPE
=
'\033'
,
SDLK_BACKSPACE
=
'\b'
,
SDLK_TAB
=
'\t'
,
SDLK_SPACE
=
' '
,
SDLK_EXCLAIM
=
'!'
,
SDLK_QUOTEDBL
=
'"'
,
SDLK_HASH
=
'#'
,
SDLK_PERCENT
=
'%'
,
SDLK_DOLLAR
=
'$'
,
SDLK_AMPERSAND
=
'&'
,
SDLK_QUOTE
=
'\''
,
SDLK_LEFTPAREN
=
'('
,
SDLK_RIGHTPAREN
=
')'
,
SDLK_ASTERISK
=
'*'
,
SDLK_PLUS
=
'+'
,
SDLK_COMMA
=
','
,
SDLK_MINUS
=
'-'
,
SDLK_PERIOD
=
'.'
,
SDLK_SLASH
=
'/'
,
SDLK_0
=
'0'
,
SDLK_1
=
'1'
,
SDLK_2
=
'2'
,
SDLK_3
=
'3'
,
SDLK_4
=
'4'
,
SDLK_5
=
'5'
,
SDLK_6
=
'6'
,
SDLK_7
=
'7'
,
SDLK_8
=
'8'
,
SDLK_9
=
'9'
,
SDLK_COLON
=
':'
,
SDLK_SEMICOLON
=
';'
,
SDLK_LESS
=
'<'
,
SDLK_EQUALS
=
'='
,
SDLK_GREATER
=
'>'
,
SDLK_QUESTION
=
'?'
,
SDLK_AT
=
'@'
,
/*
Skip uppercase letters
*/
SDLK_LEFTBRACKET
=
'['
,
SDLK_BACKSLASH
=
'\\'
,
SDLK_RIGHTBRACKET
=
']'
,
SDLK_CARET
=
'^'
,
SDLK_UNDERSCORE
=
'_'
,
SDLK_BACKQUOTE
=
'`'
,
SDLK_a
=
'a'
,
SDLK_b
=
'b'
,
SDLK_c
=
'c'
,
SDLK_d
=
'd'
,
SDLK_e
=
'e'
,
SDLK_f
=
'f'
,
SDLK_g
=
'g'
,
SDLK_h
=
'h'
,
SDLK_i
=
'i'
,
SDLK_j
=
'j'
,
SDLK_k
=
'k'
,
SDLK_l
=
'l'
,
SDLK_m
=
'm'
,
SDLK_n
=
'n'
,
SDLK_o
=
'o'
,
SDLK_p
=
'p'
,
SDLK_q
=
'q'
,
SDLK_r
=
'r'
,
SDLK_s
=
's'
,
SDLK_t
=
't'
,
SDLK_u
=
'u'
,
SDLK_v
=
'v'
,
SDLK_w
=
'w'
,
SDLK_x
=
'x'
,
SDLK_y
=
'y'
,
SDLK_z
=
'z'
,
SDLK_CAPSLOCK
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_CAPSLOCK
),
SDLK_F1
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F1
),
SDLK_F2
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F2
),
SDLK_F3
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F3
),
SDLK_F4
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F4
),
SDLK_F5
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F5
),
SDLK_F6
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F6
),
SDLK_F7
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F7
),
SDLK_F8
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F8
),
SDLK_F9
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F9
),
SDLK_F10
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F10
),
SDLK_F11
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F11
),
SDLK_F12
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F12
),
SDLK_PRINTSCREEN
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_PRINTSCREEN
),
SDLK_SCROLLLOCK
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_SCROLLLOCK
),
SDLK_PAUSE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_PAUSE
),
SDLK_INSERT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_INSERT
),
SDLK_HOME
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_HOME
),
SDLK_PAGEUP
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_PAGEUP
),
SDLK_DELETE
=
'\177'
,
SDLK_END
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_END
),
SDLK_PAGEDOWN
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_PAGEDOWN
),
SDLK_RIGHT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_RIGHT
),
SDLK_LEFT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_LEFT
),
SDLK_DOWN
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_DOWN
),
SDLK_UP
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_UP
),
SDLK_NUMLOCKCLEAR
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_NUMLOCKCLEAR
),
SDLK_KP_DIVIDE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_DIVIDE
),
SDLK_KP_MULTIPLY
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_MULTIPLY
),
SDLK_KP_MINUS
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_MINUS
),
SDLK_KP_PLUS
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_PLUS
),
SDLK_KP_ENTER
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_ENTER
),
SDLK_KP_1
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_1
),
SDLK_KP_2
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_2
),
SDLK_KP_3
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_3
),
SDLK_KP_4
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_4
),
SDLK_KP_5
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_5
),
SDLK_KP_6
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_6
),
SDLK_KP_7
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_7
),
SDLK_KP_8
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_8
),
SDLK_KP_9
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_9
),
SDLK_KP_0
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_0
),
SDLK_KP_PERIOD
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_PERIOD
),
SDLK_APPLICATION
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_APPLICATION
),
SDLK_POWER
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_POWER
),
SDLK_KP_EQUALS
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_EQUALS
),
SDLK_F13
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F13
),
SDLK_F14
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F14
),
SDLK_F15
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F15
),
SDLK_F16
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F16
),
SDLK_F17
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F17
),
SDLK_F18
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F18
),
SDLK_F19
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F19
),
SDLK_F20
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F20
),
SDLK_F21
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F21
),
SDLK_F22
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F22
),
SDLK_F23
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F23
),
SDLK_F24
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_F24
),
SDLK_EXECUTE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_EXECUTE
),
SDLK_HELP
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_HELP
),
SDLK_MENU
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_MENU
),
SDLK_SELECT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_SELECT
),
SDLK_STOP
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_STOP
),
SDLK_AGAIN
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_AGAIN
),
SDLK_UNDO
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_UNDO
),
SDLK_CUT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_CUT
),
SDLK_COPY
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_COPY
),
SDLK_PASTE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_PASTE
),
SDLK_FIND
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_FIND
),
SDLK_MUTE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_MUTE
),
SDLK_VOLUMEUP
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_VOLUMEUP
),
SDLK_VOLUMEDOWN
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_VOLUMEDOWN
),
SDLK_KP_COMMA
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_COMMA
),
SDLK_KP_EQUALSAS400
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_EQUALSAS400
),
SDLK_ALTERASE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_ALTERASE
),
SDLK_SYSREQ
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_SYSREQ
),
SDLK_CANCEL
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_CANCEL
),
SDLK_CLEAR
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_CLEAR
),
SDLK_PRIOR
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_PRIOR
),
SDLK_RETURN2
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_RETURN2
),
SDLK_SEPARATOR
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_SEPARATOR
),
SDLK_OUT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_OUT
),
SDLK_OPER
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_OPER
),
SDLK_CLEARAGAIN
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_CLEARAGAIN
),
SDLK_CRSEL
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_CRSEL
),
SDLK_EXSEL
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_EXSEL
),
SDLK_KP_00
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_00
),
SDLK_KP_000
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_000
),
SDLK_THOUSANDSSEPARATOR
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_THOUSANDSSEPARATOR
),
SDLK_DECIMALSEPARATOR
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_DECIMALSEPARATOR
),
SDLK_CURRENCYUNIT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_CURRENCYUNIT
),
SDLK_CURRENCYSUBUNIT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_CURRENCYSUBUNIT
),
SDLK_KP_LEFTPAREN
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_LEFTPAREN
),
SDLK_KP_RIGHTPAREN
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_RIGHTPAREN
),
SDLK_KP_LEFTBRACE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_LEFTBRACE
),
SDLK_KP_RIGHTBRACE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_RIGHTBRACE
),
SDLK_KP_TAB
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_TAB
),
SDLK_KP_BACKSPACE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_BACKSPACE
),
SDLK_KP_A
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_A
),
SDLK_KP_B
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_B
),
SDLK_KP_C
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_C
),
SDLK_KP_D
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_D
),
SDLK_KP_E
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_E
),
SDLK_KP_F
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_F
),
SDLK_KP_XOR
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_XOR
),
SDLK_KP_POWER
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_POWER
),
SDLK_KP_PERCENT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_PERCENT
),
SDLK_KP_LESS
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_LESS
),
SDLK_KP_GREATER
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_GREATER
),
SDLK_KP_AMPERSAND
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_AMPERSAND
),
SDLK_KP_DBLAMPERSAND
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_DBLAMPERSAND
),
SDLK_KP_VERTICALBAR
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_VERTICALBAR
),
SDLK_KP_DBLVERTICALBAR
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_DBLVERTICALBAR
),
SDLK_KP_COLON
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_COLON
),
SDLK_KP_HASH
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_HASH
),
SDLK_KP_SPACE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_SPACE
),
SDLK_KP_AT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_AT
),
SDLK_KP_EXCLAM
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_EXCLAM
),
SDLK_KP_MEMSTORE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_MEMSTORE
),
SDLK_KP_MEMRECALL
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_MEMRECALL
),
SDLK_KP_MEMCLEAR
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_MEMCLEAR
),
SDLK_KP_MEMADD
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_MEMADD
),
SDLK_KP_MEMSUBTRACT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_MEMSUBTRACT
),
SDLK_KP_MEMMULTIPLY
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_MEMMULTIPLY
),
SDLK_KP_MEMDIVIDE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_MEMDIVIDE
),
SDLK_KP_PLUSMINUS
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_PLUSMINUS
),
SDLK_KP_CLEAR
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_CLEAR
),
SDLK_KP_CLEARENTRY
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_CLEARENTRY
),
SDLK_KP_BINARY
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_BINARY
),
SDLK_KP_OCTAL
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_OCTAL
),
SDLK_KP_DECIMAL
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_DECIMAL
),
SDLK_KP_HEXADECIMAL
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KP_HEXADECIMAL
),
SDLK_LCTRL
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_LCTRL
),
SDLK_LSHIFT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_LSHIFT
),
SDLK_LALT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_LALT
),
SDLK_LGUI
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_LGUI
),
SDLK_RCTRL
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_RCTRL
),
SDLK_RSHIFT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_RSHIFT
),
SDLK_RALT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_RALT
),
SDLK_RGUI
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_RGUI
),
SDLK_MODE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_MODE
),
SDLK_AUDIONEXT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_AUDIONEXT
),
SDLK_AUDIOPREV
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_AUDIOPREV
),
SDLK_AUDIOSTOP
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_AUDIOSTOP
),
SDLK_AUDIOPLAY
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_AUDIOPLAY
),
SDLK_AUDIOMUTE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_AUDIOMUTE
),
SDLK_MEDIASELECT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_MEDIASELECT
),
SDLK_WWW
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_WWW
),
SDLK_MAIL
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_MAIL
),
SDLK_CALCULATOR
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_CALCULATOR
),
SDLK_COMPUTER
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_COMPUTER
),
SDLK_AC_SEARCH
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_AC_SEARCH
),
SDLK_AC_HOME
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_AC_HOME
),
SDLK_AC_BACK
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_AC_BACK
),
SDLK_AC_FORWARD
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_AC_FORWARD
),
SDLK_AC_STOP
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_AC_STOP
),
SDLK_AC_REFRESH
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_AC_REFRESH
),
SDLK_AC_BOOKMARKS
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_AC_BOOKMARKS
),
SDLK_BRIGHTNESSDOWN
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_BRIGHTNESSDOWN
),
SDLK_BRIGHTNESSUP
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_BRIGHTNESSUP
),
SDLK_DISPLAYSWITCH
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_DISPLAYSWITCH
),
SDLK_KBDILLUMTOGGLE
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KBDILLUMTOGGLE
),
SDLK_KBDILLUMDOWN
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KBDILLUMDOWN
),
SDLK_KBDILLUMUP
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_KBDILLUMUP
),
SDLK_EJECT
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_EJECT
),
SDLK_SLEEP
=
SDL_SCANCODE_TO_KEYCODE
(
SDL_SCANCODE_SLEEP
)
};
/**
* \brief Enumeration of valid key mods (possibly OR'd together).
*/
typedef
enum
{
KMOD_NONE
=
0x0000
,
KMOD_LSHIFT
=
0x0001
,
KMOD_RSHIFT
=
0x0002
,
KMOD_LCTRL
=
0x0040
,
KMOD_RCTRL
=
0x0080
,
KMOD_LALT
=
0x0100
,
KMOD_RALT
=
0x0200
,
KMOD_LGUI
=
0x0400
,
KMOD_RGUI
=
0x0800
,
KMOD_NUM
=
0x1000
,
KMOD_CAPS
=
0x2000
,
KMOD_MODE
=
0x4000
,
KMOD_RESERVED
=
0x8000
}
SDLMod
;
#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI)
#endif
/* _SDL_keysym_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_loadso.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_loadso.h
*
* System dependent library loading routines
*
* Some things to keep in mind:
* \li These functions only work on C function names. Other languages may
* have name mangling and intrinsic language support that varies from
* compiler to compiler.
* \li Make sure you declare your function pointers with the same calling
* convention as the actual library function. Your code will crash
* mysteriously if you do not do this.
* \li Avoid namespace collisions. If you load a symbol from the library,
* it is not defined whether or not it goes into the global symbol
* namespace for the application. If it does and it conflicts with
* symbols in your code or other shared libraries, you will not get
* the results you expect. :)
*/
#ifndef _SDL_loadso_h
#define _SDL_loadso_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* This function dynamically loads a shared object and returns a pointer
* to the object handle (or NULL if there was an error).
* The 'sofile' parameter is a system dependent name of the object file.
*/
extern
DECLSPEC
void
*
SDLCALL
SDL_LoadObject
(
const
char
*
sofile
);
/**
* Given an object handle, this function looks up the address of the
* named function in the shared object and returns it. This address
* is no longer valid after calling SDL_UnloadObject().
*/
extern
DECLSPEC
void
*
SDLCALL
SDL_LoadFunction
(
void
*
handle
,
const
char
*
name
);
/**
* Unload a shared object from memory.
*/
extern
DECLSPEC
void
SDLCALL
SDL_UnloadObject
(
void
*
handle
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_loadso_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_main.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_main_h
#define _SDL_main_h
#include "SDL_stdinc.h"
/**
* \file SDL_main.h
*
* Redefine main() on some platforms so that it is called by SDL.
*/
#if defined(__WIN32__) || \
(defined(__MWERKS__) && !defined(__BEOS__)) || \
defined(__SYMBIAN32__) || defined(__IPHONEOS__)
#ifdef __cplusplus
#define C_LINKAGE "C"
#else
#define C_LINKAGE
#endif
/* __cplusplus */
/**
* \file SDL_main.h
*
* The application's main() function must be called with C linkage,
* and should be declared like this:
* \code
* #ifdef __cplusplus
* extern "C"
* #endif
* int main(int argc, char *argv[])
* {
* }
* \endcode
*/
#define main SDL_main
/**
* The prototype for the application's main() function
*/
extern
C_LINKAGE
int
SDL_main
(
int
argc
,
char
*
argv
[]);
/* From the SDL library code -- needed for registering the app on Win32 */
#ifdef __WIN32__
#include "begin_code.h"
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* This can be called to set the application class at startup
*/
extern
DECLSPEC
int
SDLCALL
SDL_RegisterApp
(
char
*
name
,
Uint32
style
,
void
*
hInst
);
extern
DECLSPEC
void
SDLCALL
SDL_UnregisterApp
(
void
);
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
#endif
/* Need to redefine main()? */
#endif
/* _SDL_main_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_mouse.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_mouse.h
*
* Include file for SDL mouse event handling.
*
* Please note that this ONLY discusses "mice" with the notion of the
* desktop GUI. You (usually) have one system cursor, and the OS hides
* the hardware details from you. If you plug in 10 mice, all ten move that
* one cursor. For many applications and games, this is perfect, and this
* API has served hundreds of SDL programs well since its birth.
*
* It's not the whole picture, though. If you want more lowlevel control,
* SDL offers a different API, that gives you visibility into each input
* device, multi-touch interfaces, etc.
*
* Those two APIs are incompatible, and you usually should not use both
* at the same time. But for legacy purposes, this API refers to a "mouse"
* when it actually means the system pointer and not a physical mouse.
*
* The other API is in SDL_input.h
*/
#ifndef _SDL_mouse_h
#define _SDL_mouse_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_video.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
typedef
struct
SDL_Cursor
SDL_Cursor
;
/* Implementation dependent */
/* Function prototypes */
/**
* \brief Get the window which currently has mouse focus.
*/
extern
DECLSPEC
SDL_Window
*
SDLCALL
SDL_GetMouseFocus
(
void
);
/**
* \brief Retrieve the current state of the mouse.
*
* The current button state is returned as a button bitmask, which can
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
* mouse cursor position relative to the focus window for the currently
* selected mouse. You can pass NULL for either x or y.
*/
extern
DECLSPEC
Uint8
SDLCALL
SDL_GetMouseState
(
int
*
x
,
int
*
y
);
/**
* \brief Retrieve the relative state of the mouse.
*
* The current button state is returned as a button bitmask, which can
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
* mouse deltas since the last call to SDL_GetRelativeMouseState().
*/
extern
DECLSPEC
Uint8
SDLCALL
SDL_GetRelativeMouseState
(
int
*
x
,
int
*
y
);
/**
* \brief Moves the mouse to the given position within the window.
*
* \param window The window to move the mouse into, or NULL for the current mouse focus
* \param x The x coordinate within the window
* \param y The y coordinate within the window
*
* \note This function generates a mouse motion event
*/
extern
DECLSPEC
void
SDLCALL
SDL_WarpMouseInWindow
(
SDL_Window
*
window
,
int
x
,
int
y
);
/**
* \brief Set relative mouse mode.
*
* \param enabled Whether or not to enable relative mode
*
* \return 0 on success, or -1 if relative mode is not supported.
*
* While the mouse is in relative mode, the cursor is hidden, and the
* driver will try to report continuous motion in the current window.
* Only relative motion events will be delivered, the mouse position
* will not change.
*
* \note This function will flush any pending mouse motion.
*
* \sa SDL_GetRelativeMouseMode()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetRelativeMouseMode
(
SDL_bool
enabled
);
/**
* \brief Query whether relative mouse mode is enabled.
*
* \sa SDL_SetRelativeMouseMode()
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_GetRelativeMouseMode
(
void
);
/**
* \brief Create a cursor, using the specified bitmap data and
* mask (in MSB format).
*
* The cursor width must be a multiple of 8 bits.
*
* The cursor is created in black and white according to the following:
* <table>
* <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr>
* <tr><td> 0 </td><td> 1 </td><td> White </td></tr>
* <tr><td> 1 </td><td> 1 </td><td> Black </td></tr>
* <tr><td> 0 </td><td> 0 </td><td> Transparent </td></tr>
* <tr><td> 1 </td><td> 0 </td><td> Inverted color if possible, black
* if not. </td></tr>
* </table>
*
* \sa SDL_FreeCursor()
*/
extern
DECLSPEC
SDL_Cursor
*
SDLCALL
SDL_CreateCursor
(
const
Uint8
*
data
,
const
Uint8
*
mask
,
int
w
,
int
h
,
int
hot_x
,
int
hot_y
);
/**
* \brief Set the active cursor.
*/
extern
DECLSPEC
void
SDLCALL
SDL_SetCursor
(
SDL_Cursor
*
cursor
);
/**
* \brief Return the active cursor.
*/
extern
DECLSPEC
SDL_Cursor
*
SDLCALL
SDL_GetCursor
(
void
);
/**
* \brief Frees a cursor created with SDL_CreateCursor().
*
* \sa SDL_CreateCursor()
*/
extern
DECLSPEC
void
SDLCALL
SDL_FreeCursor
(
SDL_Cursor
*
cursor
);
/**
* \brief Toggle whether or not the cursor is shown.
*
* \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current
* state.
*
* \return 1 if the cursor is shown, or 0 if the cursor is hidden.
*/
extern
DECLSPEC
int
SDLCALL
SDL_ShowCursor
(
int
toggle
);
/**
* Used as a mask when testing buttons in buttonstate.
* - Button 1: Left mouse button
* - Button 2: Middle mouse button
* - Button 3: Right mouse button
*/
#define SDL_BUTTON(X) (1 << ((X)-1))
#define SDL_BUTTON_LEFT 1
#define SDL_BUTTON_MIDDLE 2
#define SDL_BUTTON_RIGHT 3
#define SDL_BUTTON_X1 4
#define SDL_BUTTON_X2 5
#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_mouse_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_mutex.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_mutex_h
#define _SDL_mutex_h
/**
* \file SDL_mutex.h
*
* Functions to provide thread synchronization primitives.
*/
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* Synchronization functions which can time out return this value
* if they time out.
*/
#define SDL_MUTEX_TIMEDOUT 1
/**
* This is the timeout value which corresponds to never time out.
*/
#define SDL_MUTEX_MAXWAIT (~(Uint32)0)
/**
* \name Mutex functions
*/
/*@{*/
/* The SDL mutex structure, defined in SDL_mutex.c */
struct
SDL_mutex
;
typedef
struct
SDL_mutex
SDL_mutex
;
/**
* Create a mutex, initialized unlocked.
*/
extern
DECLSPEC
SDL_mutex
*
SDLCALL
SDL_CreateMutex
(
void
);
/**
* Lock the mutex.
*
* \return 0, or -1 on error.
*/
#define SDL_LockMutex(m) SDL_mutexP(m)
extern
DECLSPEC
int
SDLCALL
SDL_mutexP
(
SDL_mutex
*
mutex
);
/**
* Unlock the mutex.
*
* \return 0, or -1 on error.
*
* \warning It is an error to unlock a mutex that has not been locked by
* the current thread, and doing so results in undefined behavior.
*/
#define SDL_UnlockMutex(m) SDL_mutexV(m)
extern
DECLSPEC
int
SDLCALL
SDL_mutexV
(
SDL_mutex
*
mutex
);
/**
* Destroy a mutex.
*/
extern
DECLSPEC
void
SDLCALL
SDL_DestroyMutex
(
SDL_mutex
*
mutex
);
/*@}*//*Mutex functions*/
/**
* \name Semaphore functions
*/
/*@{*/
/* The SDL semaphore structure, defined in SDL_sem.c */
struct
SDL_semaphore
;
typedef
struct
SDL_semaphore
SDL_sem
;
/**
* Create a semaphore, initialized with value, returns NULL on failure.
*/
extern
DECLSPEC
SDL_sem
*
SDLCALL
SDL_CreateSemaphore
(
Uint32
initial_value
);
/**
* Destroy a semaphore.
*/
extern
DECLSPEC
void
SDLCALL
SDL_DestroySemaphore
(
SDL_sem
*
sem
);
/**
* This function suspends the calling thread until the semaphore pointed
* to by \c sem has a positive count. It then atomically decreases the
* semaphore count.
*/
extern
DECLSPEC
int
SDLCALL
SDL_SemWait
(
SDL_sem
*
sem
);
/**
* Non-blocking variant of SDL_SemWait().
*
* \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would
* block, and -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_SemTryWait
(
SDL_sem
*
sem
);
/**
* Variant of SDL_SemWait() with a timeout in milliseconds.
*
* \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not
* succeed in the allotted time, and -1 on error.
*
* \warning On some platforms this function is implemented by looping with a
* delay of 1 ms, and so should be avoided if possible.
*/
extern
DECLSPEC
int
SDLCALL
SDL_SemWaitTimeout
(
SDL_sem
*
sem
,
Uint32
ms
);
/**
* Atomically increases the semaphore's count (not blocking).
*
* \return 0, or -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_SemPost
(
SDL_sem
*
sem
);
/**
* Returns the current count of the semaphore.
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_SemValue
(
SDL_sem
*
sem
);
/*@}*//*Semaphore functions*/
/**
* \name Condition variable functions
*/
/*@{*/
/* The SDL condition variable structure, defined in SDL_cond.c */
struct
SDL_cond
;
typedef
struct
SDL_cond
SDL_cond
;
/**
* Create a condition variable.
*/
extern
DECLSPEC
SDL_cond
*
SDLCALL
SDL_CreateCond
(
void
);
/**
* Destroy a condition variable.
*/
extern
DECLSPEC
void
SDLCALL
SDL_DestroyCond
(
SDL_cond
*
cond
);
/**
* Restart one of the threads that are waiting on the condition variable.
*
* \return 0 or -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_CondSignal
(
SDL_cond
*
cond
);
/**
* Restart all threads that are waiting on the condition variable.
* \return 0 or -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_CondBroadcast
(
SDL_cond
*
cond
);
/**
* Wait on the condition variable, unlocking the provided mutex.
*
* \warning The mutex must be locked before entering this function!
*
* The mutex is re-locked once the condition variable is signaled.
*
* \return 0 when it is signaled, or -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_CondWait
(
SDL_cond
*
cond
,
SDL_mutex
*
mutex
);
/**
* Waits for at most \c ms milliseconds, and returns 0 if the condition
* variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not
* signaled in the allotted time, and -1 on error.
*
* \warning On some platforms this function is implemented by looping with a
* delay of 1 ms, and so should be avoided if possible.
*/
extern
DECLSPEC
int
SDLCALL
SDL_CondWaitTimeout
(
SDL_cond
*
cond
,
SDL_mutex
*
mutex
,
Uint32
ms
);
/*@}*//*Condition variable functions*/
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_mutex_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_name.h
0 → 100644
View file @
598471cf
#ifndef _SDLname_h_
#define _SDLname_h_
#if defined(__STDC__) || defined(__cplusplus)
#define NeedFunctionPrototypes 1
#endif
#define SDL_NAME(X) SDL_##X
#endif
/* _SDLname_h_ */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_opengl.h
0 → 100644
View file @
598471cf
This source diff could not be displayed because it is too large. You can
view the blob
instead.
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_opengles.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_opengles.h
*
* This is a simple file to encapsulate the OpenGL ES API headers.
*
* Headers copied from The Kronos Group website.
* http://www.khronos.org/opengles/
*/
#ifndef __gles_h_
#define __gles_h_
/* $Id: gl.h 4533 2007-11-26 11:19:35Z markc $ */
#ifdef __cplusplus
extern
"C"
{
#endif
#ifdef __IPHONEOS__
#include <OpenGLES/ES1/gl.h>
/* Header File For The OpenGL ES Library */
#endif
#ifndef APIENTRY
#define APIENTRY
#endif
#ifndef GL_APIENTRY
#define GL_APIENTRY
#endif
#ifndef GL_API
#define GL_API
#endif
/* GL_API */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.0 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
*/
typedef
unsigned
int
GLenum
;
typedef
unsigned
char
GLboolean
;
typedef
unsigned
int
GLbitfield
;
typedef
signed
char
GLbyte
;
typedef
short
GLshort
;
typedef
int
GLint
;
typedef
int
GLsizei
;
typedef
unsigned
char
GLubyte
;
typedef
unsigned
short
GLushort
;
typedef
unsigned
int
GLuint
;
typedef
float
GLfloat
;
typedef
float
GLclampf
;
typedef
void
GLvoid
;
typedef
int
GLfixed
;
typedef
int
GLclampx
;
typedef
int
GLintptr
;
typedef
int
GLsizeiptr
;
/*************************************************************/
/* OpenGL ES core versions */
#define GL_VERSION_ES_CM_1_0 1
#define GL_VERSION_ES_CL_1_0 1
#define GL_VERSION_ES_CM_1_1 1
#define GL_VERSION_ES_CL_1_1 1
/* ClearBufferMask */
#define GL_DEPTH_BUFFER_BIT 0x00000100
#define GL_STENCIL_BUFFER_BIT 0x00000400
#define GL_COLOR_BUFFER_BIT 0x00004000
/* Boolean */
#define GL_FALSE 0
#define GL_TRUE 1
/* BeginMode */
#define GL_POINTS 0x0000
#define GL_LINES 0x0001
#define GL_LINE_LOOP 0x0002
#define GL_LINE_STRIP 0x0003
#define GL_TRIANGLES 0x0004
#define GL_TRIANGLE_STRIP 0x0005
#define GL_TRIANGLE_FAN 0x0006
/* AlphaFunction */
#define GL_NEVER 0x0200
#define GL_LESS 0x0201
#define GL_EQUAL 0x0202
#define GL_LEQUAL 0x0203
#define GL_GREATER 0x0204
#define GL_NOTEQUAL 0x0205
#define GL_GEQUAL 0x0206
#define GL_ALWAYS 0x0207
/* BlendingFactorDest */
#define GL_ZERO 0
#define GL_ONE 1
#define GL_SRC_COLOR 0x0300
#define GL_ONE_MINUS_SRC_COLOR 0x0301
#define GL_SRC_ALPHA 0x0302
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
#define GL_DST_ALPHA 0x0304
#define GL_ONE_MINUS_DST_ALPHA 0x0305
/* BlendingFactorSrc */
/* GL_ZERO */
/* GL_ONE */
#define GL_DST_COLOR 0x0306
#define GL_ONE_MINUS_DST_COLOR 0x0307
#define GL_SRC_ALPHA_SATURATE 0x0308
/* GL_SRC_ALPHA */
/* GL_ONE_MINUS_SRC_ALPHA */
/* GL_DST_ALPHA */
/* GL_ONE_MINUS_DST_ALPHA */
/* ClipPlaneName */
#define GL_CLIP_PLANE0 0x3000
#define GL_CLIP_PLANE1 0x3001
#define GL_CLIP_PLANE2 0x3002
#define GL_CLIP_PLANE3 0x3003
#define GL_CLIP_PLANE4 0x3004
#define GL_CLIP_PLANE5 0x3005
/* ColorMaterialFace */
/* GL_FRONT_AND_BACK */
/* ColorMaterialParameter */
/* GL_AMBIENT_AND_DIFFUSE */
/* ColorPointerType */
/* GL_UNSIGNED_BYTE */
/* GL_FLOAT */
/* GL_FIXED */
/* CullFaceMode */
#define GL_FRONT 0x0404
#define GL_BACK 0x0405
#define GL_FRONT_AND_BACK 0x0408
/* DepthFunction */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* EnableCap */
#define GL_FOG 0x0B60
#define GL_LIGHTING 0x0B50
#define GL_TEXTURE_2D 0x0DE1
#define GL_CULL_FACE 0x0B44
#define GL_ALPHA_TEST 0x0BC0
#define GL_BLEND 0x0BE2
#define GL_COLOR_LOGIC_OP 0x0BF2
#define GL_DITHER 0x0BD0
#define GL_STENCIL_TEST 0x0B90
#define GL_DEPTH_TEST 0x0B71
/* GL_LIGHT0 */
/* GL_LIGHT1 */
/* GL_LIGHT2 */
/* GL_LIGHT3 */
/* GL_LIGHT4 */
/* GL_LIGHT5 */
/* GL_LIGHT6 */
/* GL_LIGHT7 */
#define GL_POINT_SMOOTH 0x0B10
#define GL_LINE_SMOOTH 0x0B20
#define GL_SCISSOR_TEST 0x0C11
#define GL_COLOR_MATERIAL 0x0B57
#define GL_NORMALIZE 0x0BA1
#define GL_RESCALE_NORMAL 0x803A
#define GL_POLYGON_OFFSET_FILL 0x8037
#define GL_VERTEX_ARRAY 0x8074
#define GL_NORMAL_ARRAY 0x8075
#define GL_COLOR_ARRAY 0x8076
#define GL_TEXTURE_COORD_ARRAY 0x8078
#define GL_MULTISAMPLE 0x809D
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
#define GL_SAMPLE_COVERAGE 0x80A0
/* ErrorCode */
#define GL_NO_ERROR 0
#define GL_INVALID_ENUM 0x0500
#define GL_INVALID_VALUE 0x0501
#define GL_INVALID_OPERATION 0x0502
#define GL_STACK_OVERFLOW 0x0503
#define GL_STACK_UNDERFLOW 0x0504
#define GL_OUT_OF_MEMORY 0x0505
/* FogMode */
/* GL_LINEAR */
#define GL_EXP 0x0800
#define GL_EXP2 0x0801
/* FogParameter */
#define GL_FOG_DENSITY 0x0B62
#define GL_FOG_START 0x0B63
#define GL_FOG_END 0x0B64
#define GL_FOG_MODE 0x0B65
#define GL_FOG_COLOR 0x0B66
/* FrontFaceDirection */
#define GL_CW 0x0900
#define GL_CCW 0x0901
/* GetPName */
#define GL_CURRENT_COLOR 0x0B00
#define GL_CURRENT_NORMAL 0x0B02
#define GL_CURRENT_TEXTURE_COORDS 0x0B03
#define GL_POINT_SIZE 0x0B11
#define GL_POINT_SIZE_MIN 0x8126
#define GL_POINT_SIZE_MAX 0x8127
#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
#define GL_POINT_DISTANCE_ATTENUATION 0x8129
#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
#define GL_LINE_WIDTH 0x0B21
#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
#define GL_CULL_FACE_MODE 0x0B45
#define GL_FRONT_FACE 0x0B46
#define GL_SHADE_MODEL 0x0B54
#define GL_DEPTH_RANGE 0x0B70
#define GL_DEPTH_WRITEMASK 0x0B72
#define GL_DEPTH_CLEAR_VALUE 0x0B73
#define GL_DEPTH_FUNC 0x0B74
#define GL_STENCIL_CLEAR_VALUE 0x0B91
#define GL_STENCIL_FUNC 0x0B92
#define GL_STENCIL_VALUE_MASK 0x0B93
#define GL_STENCIL_FAIL 0x0B94
#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
#define GL_STENCIL_REF 0x0B97
#define GL_STENCIL_WRITEMASK 0x0B98
#define GL_MATRIX_MODE 0x0BA0
#define GL_VIEWPORT 0x0BA2
#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
#define GL_PROJECTION_STACK_DEPTH 0x0BA4
#define GL_TEXTURE_STACK_DEPTH 0x0BA5
#define GL_MODELVIEW_MATRIX 0x0BA6
#define GL_PROJECTION_MATRIX 0x0BA7
#define GL_TEXTURE_MATRIX 0x0BA8
#define GL_ALPHA_TEST_FUNC 0x0BC1
#define GL_ALPHA_TEST_REF 0x0BC2
#define GL_BLEND_DST 0x0BE0
#define GL_BLEND_SRC 0x0BE1
#define GL_LOGIC_OP_MODE 0x0BF0
#define GL_SCISSOR_BOX 0x0C10
#define GL_SCISSOR_TEST 0x0C11
#define GL_COLOR_CLEAR_VALUE 0x0C22
#define GL_COLOR_WRITEMASK 0x0C23
#define GL_UNPACK_ALIGNMENT 0x0CF5
#define GL_PACK_ALIGNMENT 0x0D05
#define GL_MAX_LIGHTS 0x0D31
#define GL_MAX_CLIP_PLANES 0x0D32
#define GL_MAX_TEXTURE_SIZE 0x0D33
#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
#define GL_MAX_VIEWPORT_DIMS 0x0D3A
#define GL_MAX_TEXTURE_UNITS 0x84E2
#define GL_SUBPIXEL_BITS 0x0D50
#define GL_RED_BITS 0x0D52
#define GL_GREEN_BITS 0x0D53
#define GL_BLUE_BITS 0x0D54
#define GL_ALPHA_BITS 0x0D55
#define GL_DEPTH_BITS 0x0D56
#define GL_STENCIL_BITS 0x0D57
#define GL_POLYGON_OFFSET_UNITS 0x2A00
#define GL_POLYGON_OFFSET_FILL 0x8037
#define GL_POLYGON_OFFSET_FACTOR 0x8038
#define GL_TEXTURE_BINDING_2D 0x8069
#define GL_VERTEX_ARRAY_SIZE 0x807A
#define GL_VERTEX_ARRAY_TYPE 0x807B
#define GL_VERTEX_ARRAY_STRIDE 0x807C
#define GL_NORMAL_ARRAY_TYPE 0x807E
#define GL_NORMAL_ARRAY_STRIDE 0x807F
#define GL_COLOR_ARRAY_SIZE 0x8081
#define GL_COLOR_ARRAY_TYPE 0x8082
#define GL_COLOR_ARRAY_STRIDE 0x8083
#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
#define GL_VERTEX_ARRAY_POINTER 0x808E
#define GL_NORMAL_ARRAY_POINTER 0x808F
#define GL_COLOR_ARRAY_POINTER 0x8090
#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
#define GL_SAMPLE_BUFFERS 0x80A8
#define GL_SAMPLES 0x80A9
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
/* OpenGL ES 1.0 defines, they gone in 1.1 and 2.0 */
#ifndef GL_MAX_ELEMENTS_VERTICES
#define GL_MAX_ELEMENTS_VERTICES 0x80E8
#endif
/* GL_MAX_ELEMENTS_VERTICES */
#ifndef GL_MAX_ELEMENTS_INDICES
#define GL_MAX_ELEMENTS_INDICES 0x80E9
#endif
/* GL_MAX_ELEMENTS_INDICES */
/* GetTextureParameter */
/* GL_TEXTURE_MAG_FILTER */
/* GL_TEXTURE_MIN_FILTER */
/* GL_TEXTURE_WRAP_S */
/* GL_TEXTURE_WRAP_T */
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
/* HintMode */
#define GL_DONT_CARE 0x1100
#define GL_FASTEST 0x1101
#define GL_NICEST 0x1102
/* HintTarget */
#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
#define GL_POINT_SMOOTH_HINT 0x0C51
#define GL_LINE_SMOOTH_HINT 0x0C52
#define GL_FOG_HINT 0x0C54
#define GL_GENERATE_MIPMAP_HINT 0x8192
/* LightModelParameter */
#define GL_LIGHT_MODEL_AMBIENT 0x0B53
#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
/* LightParameter */
#define GL_AMBIENT 0x1200
#define GL_DIFFUSE 0x1201
#define GL_SPECULAR 0x1202
#define GL_POSITION 0x1203
#define GL_SPOT_DIRECTION 0x1204
#define GL_SPOT_EXPONENT 0x1205
#define GL_SPOT_CUTOFF 0x1206
#define GL_CONSTANT_ATTENUATION 0x1207
#define GL_LINEAR_ATTENUATION 0x1208
#define GL_QUADRATIC_ATTENUATION 0x1209
/* DataType */
#define GL_BYTE 0x1400
#define GL_UNSIGNED_BYTE 0x1401
#define GL_SHORT 0x1402
#define GL_UNSIGNED_SHORT 0x1403
#define GL_FLOAT 0x1406
#define GL_FIXED 0x140C
/* LogicOp */
#define GL_CLEAR 0x1500
#define GL_AND 0x1501
#define GL_AND_REVERSE 0x1502
#define GL_COPY 0x1503
#define GL_AND_INVERTED 0x1504
#define GL_NOOP 0x1505
#define GL_XOR 0x1506
#define GL_OR 0x1507
#define GL_NOR 0x1508
#define GL_EQUIV 0x1509
#define GL_INVERT 0x150A
#define GL_OR_REVERSE 0x150B
#define GL_COPY_INVERTED 0x150C
#define GL_OR_INVERTED 0x150D
#define GL_NAND 0x150E
#define GL_SET 0x150F
/* MaterialFace */
/* GL_FRONT_AND_BACK */
/* MaterialParameter */
#define GL_EMISSION 0x1600
#define GL_SHININESS 0x1601
#define GL_AMBIENT_AND_DIFFUSE 0x1602
/* GL_AMBIENT */
/* GL_DIFFUSE */
/* GL_SPECULAR */
/* MatrixMode */
#define GL_MODELVIEW 0x1700
#define GL_PROJECTION 0x1701
#define GL_TEXTURE 0x1702
/* NormalPointerType */
/* GL_BYTE */
/* GL_SHORT */
/* GL_FLOAT */
/* GL_FIXED */
/* PixelFormat */
#define GL_ALPHA 0x1906
#define GL_RGB 0x1907
#define GL_RGBA 0x1908
#define GL_LUMINANCE 0x1909
#define GL_LUMINANCE_ALPHA 0x190A
/* PixelStoreParameter */
#define GL_UNPACK_ALIGNMENT 0x0CF5
#define GL_PACK_ALIGNMENT 0x0D05
/* PixelType */
/* GL_UNSIGNED_BYTE */
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
/* ShadingModel */
#define GL_FLAT 0x1D00
#define GL_SMOOTH 0x1D01
/* StencilFunction */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* StencilOp */
/* GL_ZERO */
#define GL_KEEP 0x1E00
#define GL_REPLACE 0x1E01
#define GL_INCR 0x1E02
#define GL_DECR 0x1E03
/* GL_INVERT */
/* StringName */
#define GL_VENDOR 0x1F00
#define GL_RENDERER 0x1F01
#define GL_VERSION 0x1F02
#define GL_EXTENSIONS 0x1F03
/* TexCoordPointerType */
/* GL_SHORT */
/* GL_FLOAT */
/* GL_FIXED */
/* GL_BYTE */
/* TextureEnvMode */
#define GL_MODULATE 0x2100
#define GL_DECAL 0x2101
/* GL_BLEND */
#define GL_ADD 0x0104
/* GL_REPLACE */
/* TextureEnvParameter */
#define GL_TEXTURE_ENV_MODE 0x2200
#define GL_TEXTURE_ENV_COLOR 0x2201
/* TextureEnvTarget */
#define GL_TEXTURE_ENV 0x2300
/* TextureMagFilter */
#define GL_NEAREST 0x2600
#define GL_LINEAR 0x2601
/* TextureMinFilter */
/* GL_NEAREST */
/* GL_LINEAR */
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
/* TextureParameterName */
#define GL_TEXTURE_MAG_FILTER 0x2800
#define GL_TEXTURE_MIN_FILTER 0x2801
#define GL_TEXTURE_WRAP_S 0x2802
#define GL_TEXTURE_WRAP_T 0x2803
#define GL_GENERATE_MIPMAP 0x8191
/* TextureTarget */
/* GL_TEXTURE_2D */
/* TextureUnit */
#define GL_TEXTURE0 0x84C0
#define GL_TEXTURE1 0x84C1
#define GL_TEXTURE2 0x84C2
#define GL_TEXTURE3 0x84C3
#define GL_TEXTURE4 0x84C4
#define GL_TEXTURE5 0x84C5
#define GL_TEXTURE6 0x84C6
#define GL_TEXTURE7 0x84C7
#define GL_TEXTURE8 0x84C8
#define GL_TEXTURE9 0x84C9
#define GL_TEXTURE10 0x84CA
#define GL_TEXTURE11 0x84CB
#define GL_TEXTURE12 0x84CC
#define GL_TEXTURE13 0x84CD
#define GL_TEXTURE14 0x84CE
#define GL_TEXTURE15 0x84CF
#define GL_TEXTURE16 0x84D0
#define GL_TEXTURE17 0x84D1
#define GL_TEXTURE18 0x84D2
#define GL_TEXTURE19 0x84D3
#define GL_TEXTURE20 0x84D4
#define GL_TEXTURE21 0x84D5
#define GL_TEXTURE22 0x84D6
#define GL_TEXTURE23 0x84D7
#define GL_TEXTURE24 0x84D8
#define GL_TEXTURE25 0x84D9
#define GL_TEXTURE26 0x84DA
#define GL_TEXTURE27 0x84DB
#define GL_TEXTURE28 0x84DC
#define GL_TEXTURE29 0x84DD
#define GL_TEXTURE30 0x84DE
#define GL_TEXTURE31 0x84DF
#define GL_ACTIVE_TEXTURE 0x84E0
#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
/* TextureWrapMode */
#define GL_REPEAT 0x2901
#define GL_CLAMP_TO_EDGE 0x812F
/* VertexPointerType */
/* GL_SHORT */
/* GL_FLOAT */
/* GL_FIXED */
/* GL_BYTE */
/* LightName */
#define GL_LIGHT0 0x4000
#define GL_LIGHT1 0x4001
#define GL_LIGHT2 0x4002
#define GL_LIGHT3 0x4003
#define GL_LIGHT4 0x4004
#define GL_LIGHT5 0x4005
#define GL_LIGHT6 0x4006
#define GL_LIGHT7 0x4007
/* Buffer Objects */
#define GL_ARRAY_BUFFER 0x8892
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
#define GL_ARRAY_BUFFER_BINDING 0x8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
#define GL_STATIC_DRAW 0x88E4
#define GL_DYNAMIC_DRAW 0x88E8
#define GL_BUFFER_SIZE 0x8764
#define GL_BUFFER_USAGE 0x8765
/* Texture combine + dot3 */
#define GL_SUBTRACT 0x84E7
#define GL_COMBINE 0x8570
#define GL_COMBINE_RGB 0x8571
#define GL_COMBINE_ALPHA 0x8572
#define GL_RGB_SCALE 0x8573
#define GL_ADD_SIGNED 0x8574
#define GL_INTERPOLATE 0x8575
#define GL_CONSTANT 0x8576
#define GL_PRIMARY_COLOR 0x8577
#define GL_PREVIOUS 0x8578
#define GL_OPERAND0_RGB 0x8590
#define GL_OPERAND1_RGB 0x8591
#define GL_OPERAND2_RGB 0x8592
#define GL_OPERAND0_ALPHA 0x8598
#define GL_OPERAND1_ALPHA 0x8599
#define GL_OPERAND2_ALPHA 0x859A
#define GL_ALPHA_SCALE 0x0D1C
#define GL_SRC0_RGB 0x8580
#define GL_SRC1_RGB 0x8581
#define GL_SRC2_RGB 0x8582
#define GL_SRC0_ALPHA 0x8588
#define GL_SRC1_ALPHA 0x8589
#define GL_SRC2_ALPHA 0x858A
#define GL_DOT3_RGB 0x86AE
#define GL_DOT3_RGBA 0x86AF
/*------------------------------------------------------------------------*
* required OES extension tokens
*------------------------------------------------------------------------*/
/* OES_read_format */
#ifndef GL_OES_read_format
#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
#endif
/* GL_OES_compressed_paletted_texture */
#ifndef GL_OES_compressed_paletted_texture
#define GL_PALETTE4_RGB8_OES 0x8B90
#define GL_PALETTE4_RGBA8_OES 0x8B91
#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
#define GL_PALETTE4_RGBA4_OES 0x8B93
#define GL_PALETTE4_RGB5_A1_OES 0x8B94
#define GL_PALETTE8_RGB8_OES 0x8B95
#define GL_PALETTE8_RGBA8_OES 0x8B96
#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
#define GL_PALETTE8_RGBA4_OES 0x8B98
#define GL_PALETTE8_RGB5_A1_OES 0x8B99
#endif
/* OES_point_size_array */
#ifndef GL_OES_point_size_array
#define GL_POINT_SIZE_ARRAY_OES 0x8B9C
#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A
#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B
#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C
#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F
#endif
/* GL_OES_point_sprite */
#ifndef GL_OES_point_sprite
#define GL_POINT_SPRITE_OES 0x8861
#define GL_COORD_REPLACE_OES 0x8862
#endif
/* GL_OES_draw_texture */
#ifndef GL_OES_draw_texture
#define GL_TEXTURE_CROP_RECT_OES 0x8B9D
#endif
/* GL_OES_draw_texture */
/* GL_OES_vertex_buffer_object */
#ifndef GL_OES_vertex_buffer_object
#define GL_ARRAY_BUFFER_OES 0x8892
#define GL_ELEMENT_ARRAY_BUFFER_OES 0x8893
#define GL_ARRAY_BUFFER_BINDING_OES 0x8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING_OES 0x8895
#define GL_VERTEX_ARRAY_BUFFER_BINDING_OES 0x8896
#define GL_NORMAL_ARRAY_BUFFER_BINDING_OES 0x8897
#define GL_COLOR_ARRAY_BUFFER_BINDING_OES 0x8898
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_OES 0x889A
#define GL_STATIC_DRAW_OES 0x88E4
#define GL_DYNAMIC_DRAW_OES 0x88E8
#define GL_WRITE_ONLY_OES 0x88B9
#define GL_BUFFER_SIZE_OES 0x8764
#define GL_BUFFER_USAGE_OES 0x8765
#define GL_BUFFER_ACCESS_OES 0x88BB
#endif
/* GL_OES_vertex_buffer_object */
/*************************************************************/
/* Available only in Common profile */
GL_API
void
GL_APIENTRY
glAlphaFunc
(
GLenum
func
,
GLclampf
ref
);
GL_API
void
GL_APIENTRY
glClearColor
(
GLclampf
red
,
GLclampf
green
,
GLclampf
blue
,
GLclampf
alpha
);
GL_API
void
GL_APIENTRY
glClearDepthf
(
GLclampf
depth
);
GL_API
void
GL_APIENTRY
glClipPlanef
(
GLenum
plane
,
const
GLfloat
*
equation
);
GL_API
void
GL_APIENTRY
glColor4f
(
GLfloat
red
,
GLfloat
green
,
GLfloat
blue
,
GLfloat
alpha
);
GL_API
void
GL_APIENTRY
glDepthRangef
(
GLclampf
zNear
,
GLclampf
zFar
);
GL_API
void
GL_APIENTRY
glFogf
(
GLenum
pname
,
GLfloat
param
);
GL_API
void
GL_APIENTRY
glFogfv
(
GLenum
pname
,
const
GLfloat
*
params
);
GL_API
void
GL_APIENTRY
glFrustumf
(
GLfloat
left
,
GLfloat
right
,
GLfloat
bottom
,
GLfloat
top
,
GLfloat
zNear
,
GLfloat
zFar
);
GL_API
void
GL_APIENTRY
glGetClipPlanef
(
GLenum
pname
,
GLfloat
eqn
[
4
]);
GL_API
void
GL_APIENTRY
glGetFloatv
(
GLenum
pname
,
GLfloat
*
params
);
GL_API
void
GL_APIENTRY
glGetLightfv
(
GLenum
light
,
GLenum
pname
,
GLfloat
*
params
);
GL_API
void
GL_APIENTRY
glGetMaterialfv
(
GLenum
face
,
GLenum
pname
,
GLfloat
*
params
);
GL_API
void
GL_APIENTRY
glGetTexEnvfv
(
GLenum
env
,
GLenum
pname
,
GLfloat
*
params
);
GL_API
void
GL_APIENTRY
glGetTexParameterfv
(
GLenum
target
,
GLenum
pname
,
GLfloat
*
params
);
GL_API
void
GL_APIENTRY
glLightModelf
(
GLenum
pname
,
GLfloat
param
);
GL_API
void
GL_APIENTRY
glLightModelfv
(
GLenum
pname
,
const
GLfloat
*
params
);
GL_API
void
GL_APIENTRY
glLightf
(
GLenum
light
,
GLenum
pname
,
GLfloat
param
);
GL_API
void
GL_APIENTRY
glLightfv
(
GLenum
light
,
GLenum
pname
,
const
GLfloat
*
params
);
GL_API
void
GL_APIENTRY
glLineWidth
(
GLfloat
width
);
GL_API
void
GL_APIENTRY
glLoadMatrixf
(
const
GLfloat
*
m
);
GL_API
void
GL_APIENTRY
glMaterialf
(
GLenum
face
,
GLenum
pname
,
GLfloat
param
);
GL_API
void
GL_APIENTRY
glMaterialfv
(
GLenum
face
,
GLenum
pname
,
const
GLfloat
*
params
);
GL_API
void
GL_APIENTRY
glMultMatrixf
(
const
GLfloat
*
m
);
GL_API
void
GL_APIENTRY
glMultiTexCoord4f
(
GLenum
target
,
GLfloat
s
,
GLfloat
t
,
GLfloat
r
,
GLfloat
q
);
GL_API
void
GL_APIENTRY
glNormal3f
(
GLfloat
nx
,
GLfloat
ny
,
GLfloat
nz
);
GL_API
void
GL_APIENTRY
glOrthof
(
GLfloat
left
,
GLfloat
right
,
GLfloat
bottom
,
GLfloat
top
,
GLfloat
zNear
,
GLfloat
zFar
);
GL_API
void
GL_APIENTRY
glPointParameterf
(
GLenum
pname
,
GLfloat
param
);
GL_API
void
GL_APIENTRY
glPointParameterfv
(
GLenum
pname
,
const
GLfloat
*
params
);
GL_API
void
GL_APIENTRY
glPointSize
(
GLfloat
size
);
GL_API
void
GL_APIENTRY
glPolygonOffset
(
GLfloat
factor
,
GLfloat
units
);
GL_API
void
GL_APIENTRY
glRotatef
(
GLfloat
angle
,
GLfloat
x
,
GLfloat
y
,
GLfloat
z
);
GL_API
void
GL_APIENTRY
glScalef
(
GLfloat
x
,
GLfloat
y
,
GLfloat
z
);
GL_API
void
GL_APIENTRY
glTexEnvf
(
GLenum
target
,
GLenum
pname
,
GLfloat
param
);
GL_API
void
GL_APIENTRY
glTexEnvfv
(
GLenum
target
,
GLenum
pname
,
const
GLfloat
*
params
);
GL_API
void
GL_APIENTRY
glTexParameterf
(
GLenum
target
,
GLenum
pname
,
GLfloat
param
);
GL_API
void
GL_APIENTRY
glTexParameterfv
(
GLenum
target
,
GLenum
pname
,
const
GLfloat
*
params
);
GL_API
void
GL_APIENTRY
glTranslatef
(
GLfloat
x
,
GLfloat
y
,
GLfloat
z
);
/* Available in both Common and Common-Lite profiles */
GL_API
void
GL_APIENTRY
glActiveTexture
(
GLenum
texture
);
GL_API
void
GL_APIENTRY
glAlphaFuncx
(
GLenum
func
,
GLclampx
ref
);
GL_API
void
GL_APIENTRY
glBindBuffer
(
GLenum
target
,
GLuint
buffer
);
GL_API
void
GL_APIENTRY
glBindTexture
(
GLenum
target
,
GLuint
texture
);
GL_API
void
GL_APIENTRY
glBlendFunc
(
GLenum
sfactor
,
GLenum
dfactor
);
GL_API
void
GL_APIENTRY
glBufferData
(
GLenum
target
,
GLsizeiptr
size
,
const
GLvoid
*
data
,
GLenum
usage
);
GL_API
void
GL_APIENTRY
glBufferSubData
(
GLenum
target
,
GLintptr
offset
,
GLsizeiptr
size
,
const
GLvoid
*
data
);
GL_API
void
GL_APIENTRY
glClear
(
GLbitfield
mask
);
GL_API
void
GL_APIENTRY
glClearColorx
(
GLclampx
red
,
GLclampx
green
,
GLclampx
blue
,
GLclampx
alpha
);
GL_API
void
GL_APIENTRY
glClearDepthx
(
GLclampx
depth
);
GL_API
void
GL_APIENTRY
glClearStencil
(
GLint
s
);
GL_API
void
GL_APIENTRY
glClientActiveTexture
(
GLenum
texture
);
GL_API
void
GL_APIENTRY
glClipPlanex
(
GLenum
plane
,
const
GLfixed
*
equation
);
GL_API
void
GL_APIENTRY
glColor4ub
(
GLubyte
red
,
GLubyte
green
,
GLubyte
blue
,
GLubyte
alpha
);
GL_API
void
GL_APIENTRY
glColor4x
(
GLfixed
red
,
GLfixed
green
,
GLfixed
blue
,
GLfixed
alpha
);
GL_API
void
GL_APIENTRY
glColorMask
(
GLboolean
red
,
GLboolean
green
,
GLboolean
blue
,
GLboolean
alpha
);
GL_API
void
GL_APIENTRY
glColorPointer
(
GLint
size
,
GLenum
type
,
GLsizei
stride
,
const
GLvoid
*
pointer
);
GL_API
void
GL_APIENTRY
glCompressedTexImage2D
(
GLenum
target
,
GLint
level
,
GLenum
internalformat
,
GLsizei
width
,
GLsizei
height
,
GLint
border
,
GLsizei
imageSize
,
const
GLvoid
*
data
);
GL_API
void
GL_APIENTRY
glCompressedTexSubImage2D
(
GLenum
target
,
GLint
level
,
GLint
xoffset
,
GLint
yoffset
,
GLsizei
width
,
GLsizei
height
,
GLenum
format
,
GLsizei
imageSize
,
const
GLvoid
*
data
);
GL_API
void
GL_APIENTRY
glCopyTexImage2D
(
GLenum
target
,
GLint
level
,
GLenum
internalformat
,
GLint
x
,
GLint
y
,
GLsizei
width
,
GLsizei
height
,
GLint
border
);
GL_API
void
GL_APIENTRY
glCopyTexSubImage2D
(
GLenum
target
,
GLint
level
,
GLint
xoffset
,
GLint
yoffset
,
GLint
x
,
GLint
y
,
GLsizei
width
,
GLsizei
height
);
GL_API
void
GL_APIENTRY
glCullFace
(
GLenum
mode
);
GL_API
void
GL_APIENTRY
glDeleteBuffers
(
GLsizei
n
,
const
GLuint
*
buffers
);
GL_API
void
GL_APIENTRY
glDeleteTextures
(
GLsizei
n
,
const
GLuint
*
textures
);
GL_API
void
GL_APIENTRY
glDepthFunc
(
GLenum
func
);
GL_API
void
GL_APIENTRY
glDepthMask
(
GLboolean
flag
);
GL_API
void
GL_APIENTRY
glDepthRangex
(
GLclampx
zNear
,
GLclampx
zFar
);
GL_API
void
GL_APIENTRY
glDisable
(
GLenum
cap
);
GL_API
void
GL_APIENTRY
glDisableClientState
(
GLenum
array
);
GL_API
void
GL_APIENTRY
glDrawArrays
(
GLenum
mode
,
GLint
first
,
GLsizei
count
);
GL_API
void
GL_APIENTRY
glDrawElements
(
GLenum
mode
,
GLsizei
count
,
GLenum
type
,
const
GLvoid
*
indices
);
GL_API
void
GL_APIENTRY
glEnable
(
GLenum
cap
);
GL_API
void
GL_APIENTRY
glEnableClientState
(
GLenum
array
);
GL_API
void
GL_APIENTRY
glFinish
(
void
);
GL_API
void
GL_APIENTRY
glFlush
(
void
);
GL_API
void
GL_APIENTRY
glFogx
(
GLenum
pname
,
GLfixed
param
);
GL_API
void
GL_APIENTRY
glFogxv
(
GLenum
pname
,
const
GLfixed
*
params
);
GL_API
void
GL_APIENTRY
glFrontFace
(
GLenum
mode
);
GL_API
void
GL_APIENTRY
glFrustumx
(
GLfixed
left
,
GLfixed
right
,
GLfixed
bottom
,
GLfixed
top
,
GLfixed
zNear
,
GLfixed
zFar
);
GL_API
void
GL_APIENTRY
glGetBooleanv
(
GLenum
pname
,
GLboolean
*
params
);
GL_API
void
GL_APIENTRY
glGetBufferParameteriv
(
GLenum
target
,
GLenum
pname
,
GLint
*
params
);
GL_API
void
GL_APIENTRY
glGetClipPlanex
(
GLenum
pname
,
GLfixed
eqn
[
4
]);
GL_API
void
GL_APIENTRY
glGenBuffers
(
GLsizei
n
,
GLuint
*
buffers
);
GL_API
void
GL_APIENTRY
glGenTextures
(
GLsizei
n
,
GLuint
*
textures
);
GL_API
GLenum
GL_APIENTRY
glGetError
(
void
);
GL_API
void
GL_APIENTRY
glGetFixedv
(
GLenum
pname
,
GLfixed
*
params
);
GL_API
void
GL_APIENTRY
glGetIntegerv
(
GLenum
pname
,
GLint
*
params
);
GL_API
void
GL_APIENTRY
glGetLightxv
(
GLenum
light
,
GLenum
pname
,
GLfixed
*
params
);
GL_API
void
GL_APIENTRY
glGetMaterialxv
(
GLenum
face
,
GLenum
pname
,
GLfixed
*
params
);
GL_API
void
GL_APIENTRY
glGetPointerv
(
GLenum
pname
,
void
**
params
);
GL_API
const
GLubyte
*
GL_APIENTRY
glGetString
(
GLenum
name
);
GL_API
void
GL_APIENTRY
glGetTexEnviv
(
GLenum
env
,
GLenum
pname
,
GLint
*
params
);
GL_API
void
GL_APIENTRY
glGetTexEnvxv
(
GLenum
env
,
GLenum
pname
,
GLfixed
*
params
);
GL_API
void
GL_APIENTRY
glGetTexParameteriv
(
GLenum
target
,
GLenum
pname
,
GLint
*
params
);
GL_API
void
GL_APIENTRY
glGetTexParameterxv
(
GLenum
target
,
GLenum
pname
,
GLfixed
*
params
);
GL_API
void
GL_APIENTRY
glHint
(
GLenum
target
,
GLenum
mode
);
GL_API
GLboolean
GL_APIENTRY
glIsBuffer
(
GLuint
buffer
);
GL_API
GLboolean
GL_APIENTRY
glIsEnabled
(
GLenum
cap
);
GL_API
GLboolean
GL_APIENTRY
glIsTexture
(
GLuint
texture
);
GL_API
void
GL_APIENTRY
glLightModelx
(
GLenum
pname
,
GLfixed
param
);
GL_API
void
GL_APIENTRY
glLightModelxv
(
GLenum
pname
,
const
GLfixed
*
params
);
GL_API
void
GL_APIENTRY
glLightx
(
GLenum
light
,
GLenum
pname
,
GLfixed
param
);
GL_API
void
GL_APIENTRY
glLightxv
(
GLenum
light
,
GLenum
pname
,
const
GLfixed
*
params
);
GL_API
void
GL_APIENTRY
glLineWidthx
(
GLfixed
width
);
GL_API
void
GL_APIENTRY
glLoadIdentity
(
void
);
GL_API
void
GL_APIENTRY
glLoadMatrixx
(
const
GLfixed
*
m
);
GL_API
void
GL_APIENTRY
glLogicOp
(
GLenum
opcode
);
GL_API
void
GL_APIENTRY
glMaterialx
(
GLenum
face
,
GLenum
pname
,
GLfixed
param
);
GL_API
void
GL_APIENTRY
glMaterialxv
(
GLenum
face
,
GLenum
pname
,
const
GLfixed
*
params
);
GL_API
void
GL_APIENTRY
glMatrixMode
(
GLenum
mode
);
GL_API
void
GL_APIENTRY
glMultMatrixx
(
const
GLfixed
*
m
);
GL_API
void
GL_APIENTRY
glMultiTexCoord4x
(
GLenum
target
,
GLfixed
s
,
GLfixed
t
,
GLfixed
r
,
GLfixed
q
);
GL_API
void
GL_APIENTRY
glNormal3x
(
GLfixed
nx
,
GLfixed
ny
,
GLfixed
nz
);
GL_API
void
GL_APIENTRY
glNormalPointer
(
GLenum
type
,
GLsizei
stride
,
const
GLvoid
*
pointer
);
GL_API
void
GL_APIENTRY
glOrthox
(
GLfixed
left
,
GLfixed
right
,
GLfixed
bottom
,
GLfixed
top
,
GLfixed
zNear
,
GLfixed
zFar
);
GL_API
void
GL_APIENTRY
glPixelStorei
(
GLenum
pname
,
GLint
param
);
GL_API
void
GL_APIENTRY
glPointParameterx
(
GLenum
pname
,
GLfixed
param
);
GL_API
void
GL_APIENTRY
glPointParameterxv
(
GLenum
pname
,
const
GLfixed
*
params
);
GL_API
void
GL_APIENTRY
glPointSizex
(
GLfixed
size
);
GL_API
void
GL_APIENTRY
glPolygonOffsetx
(
GLfixed
factor
,
GLfixed
units
);
GL_API
void
GL_APIENTRY
glPopMatrix
(
void
);
GL_API
void
GL_APIENTRY
glPushMatrix
(
void
);
GL_API
void
GL_APIENTRY
glReadPixels
(
GLint
x
,
GLint
y
,
GLsizei
width
,
GLsizei
height
,
GLenum
format
,
GLenum
type
,
GLvoid
*
pixels
);
GL_API
void
GL_APIENTRY
glRotatex
(
GLfixed
angle
,
GLfixed
x
,
GLfixed
y
,
GLfixed
z
);
GL_API
void
GL_APIENTRY
glSampleCoverage
(
GLclampf
value
,
GLboolean
invert
);
GL_API
void
GL_APIENTRY
glSampleCoveragex
(
GLclampx
value
,
GLboolean
invert
);
GL_API
void
GL_APIENTRY
glScalex
(
GLfixed
x
,
GLfixed
y
,
GLfixed
z
);
GL_API
void
GL_APIENTRY
glScissor
(
GLint
x
,
GLint
y
,
GLsizei
width
,
GLsizei
height
);
GL_API
void
GL_APIENTRY
glShadeModel
(
GLenum
mode
);
GL_API
void
GL_APIENTRY
glStencilFunc
(
GLenum
func
,
GLint
ref
,
GLuint
mask
);
GL_API
void
GL_APIENTRY
glStencilMask
(
GLuint
mask
);
GL_API
void
GL_APIENTRY
glStencilOp
(
GLenum
fail
,
GLenum
zfail
,
GLenum
zpass
);
GL_API
void
GL_APIENTRY
glTexCoordPointer
(
GLint
size
,
GLenum
type
,
GLsizei
stride
,
const
GLvoid
*
pointer
);
GL_API
void
GL_APIENTRY
glTexEnvi
(
GLenum
target
,
GLenum
pname
,
GLint
param
);
GL_API
void
GL_APIENTRY
glTexEnvx
(
GLenum
target
,
GLenum
pname
,
GLfixed
param
);
GL_API
void
GL_APIENTRY
glTexEnviv
(
GLenum
target
,
GLenum
pname
,
const
GLint
*
params
);
GL_API
void
GL_APIENTRY
glTexEnvxv
(
GLenum
target
,
GLenum
pname
,
const
GLfixed
*
params
);
GL_API
void
GL_APIENTRY
glTexImage2D
(
GLenum
target
,
GLint
level
,
GLint
internalformat
,
GLsizei
width
,
GLsizei
height
,
GLint
border
,
GLenum
format
,
GLenum
type
,
const
GLvoid
*
pixels
);
GL_API
void
GL_APIENTRY
glTexParameteri
(
GLenum
target
,
GLenum
pname
,
GLint
param
);
GL_API
void
GL_APIENTRY
glTexParameterx
(
GLenum
target
,
GLenum
pname
,
GLfixed
param
);
GL_API
void
GL_APIENTRY
glTexParameteriv
(
GLenum
target
,
GLenum
pname
,
const
GLint
*
params
);
GL_API
void
GL_APIENTRY
glTexParameterxv
(
GLenum
target
,
GLenum
pname
,
const
GLfixed
*
params
);
GL_API
void
GL_APIENTRY
glTexSubImage2D
(
GLenum
target
,
GLint
level
,
GLint
xoffset
,
GLint
yoffset
,
GLsizei
width
,
GLsizei
height
,
GLenum
format
,
GLenum
type
,
const
GLvoid
*
pixels
);
GL_API
void
GL_APIENTRY
glTranslatex
(
GLfixed
x
,
GLfixed
y
,
GLfixed
z
);
GL_API
void
GL_APIENTRY
glVertexPointer
(
GLint
size
,
GLenum
type
,
GLsizei
stride
,
const
GLvoid
*
pointer
);
GL_API
void
GL_APIENTRY
glViewport
(
GLint
x
,
GLint
y
,
GLsizei
width
,
GLsizei
height
);
/*------------------------------------------------------------------------*
* Required OES extension functions
*------------------------------------------------------------------------*/
/* GL_OES_read_format */
#ifndef GL_OES_read_format
#define GL_OES_read_format 1
#endif
/* GL_OES_compressed_paletted_texture */
#ifndef GL_OES_compressed_paletted_texture
#define GL_OES_compressed_paletted_texture 1
#endif
/* GL_OES_point_size_array */
#ifndef GL_OES_point_size_array
#define GL_OES_point_size_array 1
GL_API
void
GL_APIENTRY
glPointSizePointerOES
(
GLenum
type
,
GLsizei
stride
,
const
GLvoid
*
pointer
);
#endif
/* GL_OES_query_matrix */
#ifndef GL_OES_query_matrix
#define GL_OES_query_matrix 1
GL_API
GLbitfield
GL_APIENTRY
glQueryMatrixxOES
(
GLfixed
mantissa
[
16
],
GLint
exponent
[
16
]);
#endif
/* GL_OES_query_matrix */
/* GL_OES_point_sprite */
#ifndef GL_OES_point_sprite
#define GL_OES_point_sprite 1
#endif
/* GL_OES_draw_texture */
#ifndef GL_OES_draw_texture
#define GL_OES_draw_texture 1
GL_API
void
GL_APIENTRY
glDrawTexsOES
(
GLshort
x
,
GLshort
y
,
GLshort
z
,
GLshort
width
,
GLshort
height
);
GL_API
void
GL_APIENTRY
glDrawTexiOES
(
GLint
x
,
GLint
y
,
GLint
z
,
GLint
width
,
GLint
height
);
GL_API
void
GL_APIENTRY
glDrawTexxOES
(
GLfixed
x
,
GLfixed
y
,
GLfixed
z
,
GLfixed
width
,
GLfixed
height
);
GL_API
void
GL_APIENTRY
glDrawTexsvOES
(
const
GLshort
*
coords
);
GL_API
void
GL_APIENTRY
glDrawTexivOES
(
const
GLint
*
coords
);
GL_API
void
GL_APIENTRY
glDrawTexxvOES
(
const
GLfixed
*
coords
);
GL_API
void
GL_APIENTRY
glDrawTexfOES
(
GLfloat
x
,
GLfloat
y
,
GLfloat
z
,
GLfloat
width
,
GLfloat
height
);
GL_API
void
GL_APIENTRY
glDrawTexfvOES
(
const
GLfloat
*
coords
);
#endif
/* GL_OES_draw_texture */
/* GL_OES_single_precision */
#ifndef GL_OES_single_precision
#define GL_OES_single_precision 1
GL_API
void
GL_APIENTRY
glDepthRangefOES
(
GLclampf
zNear
,
GLclampf
zFar
);
GL_API
void
GL_APIENTRY
glFrustumfOES
(
GLfloat
left
,
GLfloat
right
,
GLfloat
bottom
,
GLfloat
top
,
GLfloat
zNear
,
GLfloat
zFar
);
GL_API
void
GL_APIENTRY
glOrthofOES
(
GLfloat
left
,
GLfloat
right
,
GLfloat
bottom
,
GLfloat
top
,
GLfloat
zNear
,
GLfloat
zFar
);
GL_API
void
GL_APIENTRY
glClipPlanefOES
(
GLenum
plane
,
const
GLfloat
*
equation
);
GL_API
void
GL_APIENTRY
glGetClipPlanefOES
(
GLenum
pname
,
GLfloat
eqn
[
4
]);
GL_API
void
GL_APIENTRY
glClearDepthfOES
(
GLclampf
depth
);
#endif
/* GL_OES_single_precision */
/* GL_OES_vertex_buffer_object */
#ifndef GL_OES_vertex_buffer_object
#define GL_OES_vertex_buffer_object 1
GL_API
void
APIENTRY
glBindBufferOES
(
GLenum
,
GLuint
);
GL_API
void
APIENTRY
glDeleteBuffersOES
(
GLsizei
,
const
GLuint
*
);
GL_API
void
APIENTRY
glGenBuffersOES
(
GLsizei
,
GLuint
*
);
GL_API
GLboolean
APIENTRY
glIsBufferOES
(
GLuint
);
GL_API
void
APIENTRY
glBufferDataOES
(
GLenum
,
GLsizeiptr
,
const
GLvoid
*
,
GLenum
);
GL_API
void
APIENTRY
glBufferSubDataOES
(
GLenum
,
GLintptr
,
GLsizeiptr
,
const
GLvoid
*
);
GL_API
void
APIENTRY
glGetBufferParameterivOES
(
GLenum
,
GLenum
,
GLint
*
);
#endif
/* GL_OES_vertex_buffer_object */
#ifdef __cplusplus
}
#endif
#endif
/* __gles_h_ */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_pixels.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_pixels.h
*
* Header for the enumerated pixel format definitions.
*/
#ifndef _SDL_pixels_h
#define _SDL_pixels_h
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* \name Transparency definitions
*
* These define alpha as the opacity of a surface.
*/
/*@{*/
#define SDL_ALPHA_OPAQUE 255
#define SDL_ALPHA_TRANSPARENT 0
/*@}*/
/** Pixel type. */
enum
{
SDL_PIXELTYPE_UNKNOWN
,
SDL_PIXELTYPE_INDEX1
,
SDL_PIXELTYPE_INDEX4
,
SDL_PIXELTYPE_INDEX8
,
SDL_PIXELTYPE_PACKED8
,
SDL_PIXELTYPE_PACKED16
,
SDL_PIXELTYPE_PACKED32
,
SDL_PIXELTYPE_ARRAYU8
,
SDL_PIXELTYPE_ARRAYU16
,
SDL_PIXELTYPE_ARRAYU32
,
SDL_PIXELTYPE_ARRAYF16
,
SDL_PIXELTYPE_ARRAYF32
};
/** Bitmap pixel order, high bit -> low bit. */
enum
{
SDL_BITMAPORDER_NONE
,
SDL_BITMAPORDER_4321
,
SDL_BITMAPORDER_1234
};
/** Packed component order, high bit -> low bit. */
enum
{
SDL_PACKEDORDER_NONE
,
SDL_PACKEDORDER_XRGB
,
SDL_PACKEDORDER_RGBX
,
SDL_PACKEDORDER_ARGB
,
SDL_PACKEDORDER_RGBA
,
SDL_PACKEDORDER_XBGR
,
SDL_PACKEDORDER_BGRX
,
SDL_PACKEDORDER_ABGR
,
SDL_PACKEDORDER_BGRA
};
/** Array component order, low byte -> high byte. */
enum
{
SDL_ARRAYORDER_NONE
,
SDL_ARRAYORDER_RGB
,
SDL_ARRAYORDER_RGBA
,
SDL_ARRAYORDER_ARGB
,
SDL_ARRAYORDER_BGR
,
SDL_ARRAYORDER_BGRA
,
SDL_ARRAYORDER_ABGR
};
/** Packed component layout. */
enum
{
SDL_PACKEDLAYOUT_NONE
,
SDL_PACKEDLAYOUT_332
,
SDL_PACKEDLAYOUT_4444
,
SDL_PACKEDLAYOUT_1555
,
SDL_PACKEDLAYOUT_5551
,
SDL_PACKEDLAYOUT_565
,
SDL_PACKEDLAYOUT_8888
,
SDL_PACKEDLAYOUT_2101010
,
SDL_PACKEDLAYOUT_1010102
};
#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
((1 << 31) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
((bits) << 8) | ((bytes) << 0))
#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
#define SDL_BYTESPERPIXEL(X) (((X) >> 0) & 0xFF)
#define SDL_ISPIXELFORMAT_INDEXED(format) \
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))
#define SDL_ISPIXELFORMAT_ALPHA(format) \
((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))
#define SDL_ISPIXELFORMAT_FOURCC(format) \
((format) && !((format) & 0x80000000))
enum
{
SDL_PIXELFORMAT_UNKNOWN
,
SDL_PIXELFORMAT_INDEX1LSB
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_INDEX1
,
SDL_BITMAPORDER_1234
,
0
,
1
,
0
),
SDL_PIXELFORMAT_INDEX1MSB
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_INDEX1
,
SDL_BITMAPORDER_4321
,
0
,
1
,
0
),
SDL_PIXELFORMAT_INDEX4LSB
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_INDEX4
,
SDL_BITMAPORDER_1234
,
0
,
4
,
0
),
SDL_PIXELFORMAT_INDEX4MSB
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_INDEX4
,
SDL_BITMAPORDER_4321
,
0
,
4
,
0
),
SDL_PIXELFORMAT_INDEX8
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_INDEX8
,
0
,
0
,
8
,
1
),
SDL_PIXELFORMAT_RGB332
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED8
,
SDL_PACKEDORDER_XRGB
,
SDL_PACKEDLAYOUT_332
,
8
,
1
),
SDL_PIXELFORMAT_RGB444
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED16
,
SDL_PACKEDORDER_XRGB
,
SDL_PACKEDLAYOUT_4444
,
12
,
2
),
SDL_PIXELFORMAT_RGB555
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED16
,
SDL_PACKEDORDER_XRGB
,
SDL_PACKEDLAYOUT_1555
,
15
,
2
),
SDL_PIXELFORMAT_BGR555
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED16
,
SDL_PACKEDORDER_XBGR
,
SDL_PACKEDLAYOUT_1555
,
15
,
2
),
SDL_PIXELFORMAT_ARGB4444
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED16
,
SDL_PACKEDORDER_ARGB
,
SDL_PACKEDLAYOUT_4444
,
16
,
2
),
SDL_PIXELFORMAT_ABGR4444
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED16
,
SDL_PACKEDORDER_ABGR
,
SDL_PACKEDLAYOUT_4444
,
16
,
2
),
SDL_PIXELFORMAT_ARGB1555
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED16
,
SDL_PACKEDORDER_ARGB
,
SDL_PACKEDLAYOUT_1555
,
16
,
2
),
SDL_PIXELFORMAT_ABGR1555
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED16
,
SDL_PACKEDORDER_ABGR
,
SDL_PACKEDLAYOUT_1555
,
16
,
2
),
SDL_PIXELFORMAT_RGB565
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED16
,
SDL_PACKEDORDER_XRGB
,
SDL_PACKEDLAYOUT_565
,
16
,
2
),
SDL_PIXELFORMAT_BGR565
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED16
,
SDL_PACKEDORDER_XBGR
,
SDL_PACKEDLAYOUT_565
,
16
,
2
),
SDL_PIXELFORMAT_RGB24
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_ARRAYU8
,
SDL_ARRAYORDER_RGB
,
0
,
24
,
3
),
SDL_PIXELFORMAT_BGR24
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_ARRAYU8
,
SDL_ARRAYORDER_BGR
,
0
,
24
,
3
),
SDL_PIXELFORMAT_RGB888
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED32
,
SDL_PACKEDORDER_XRGB
,
SDL_PACKEDLAYOUT_8888
,
24
,
4
),
SDL_PIXELFORMAT_BGR888
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED32
,
SDL_PACKEDORDER_XBGR
,
SDL_PACKEDLAYOUT_8888
,
24
,
4
),
SDL_PIXELFORMAT_ARGB8888
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED32
,
SDL_PACKEDORDER_ARGB
,
SDL_PACKEDLAYOUT_8888
,
32
,
4
),
SDL_PIXELFORMAT_RGBA8888
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED32
,
SDL_PACKEDORDER_RGBA
,
SDL_PACKEDLAYOUT_8888
,
32
,
4
),
SDL_PIXELFORMAT_ABGR8888
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED32
,
SDL_PACKEDORDER_ABGR
,
SDL_PACKEDLAYOUT_8888
,
32
,
4
),
SDL_PIXELFORMAT_BGRA8888
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED32
,
SDL_PACKEDORDER_BGRA
,
SDL_PACKEDLAYOUT_8888
,
32
,
4
),
SDL_PIXELFORMAT_ARGB2101010
=
SDL_DEFINE_PIXELFORMAT
(
SDL_PIXELTYPE_PACKED32
,
SDL_PACKEDORDER_ARGB
,
SDL_PACKEDLAYOUT_2101010
,
32
,
4
),
SDL_PIXELFORMAT_YV12
=
/**< Planar mode: Y + V + U (3 planes) */
SDL_DEFINE_PIXELFOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
),
SDL_PIXELFORMAT_IYUV
=
/**< Planar mode: Y + U + V (3 planes) */
SDL_DEFINE_PIXELFOURCC
(
'I'
,
'Y'
,
'U'
,
'V'
),
SDL_PIXELFORMAT_YUY2
=
/**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
SDL_DEFINE_PIXELFOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
),
SDL_PIXELFORMAT_UYVY
=
/**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
SDL_DEFINE_PIXELFOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
),
SDL_PIXELFORMAT_YVYU
=
/**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
SDL_DEFINE_PIXELFOURCC
(
'Y'
,
'V'
,
'Y'
,
'U'
)
};
typedef
struct
SDL_Color
{
Uint8
r
;
Uint8
g
;
Uint8
b
;
Uint8
unused
;
}
SDL_Color
;
#define SDL_Colour SDL_Color
typedef
struct
SDL_Palette
SDL_Palette
;
typedef
int
(
*
SDL_PaletteChangedFunc
)
(
void
*
userdata
,
SDL_Palette
*
palette
);
typedef
struct
SDL_PaletteWatch
SDL_PaletteWatch
;
struct
SDL_Palette
{
int
ncolors
;
SDL_Color
*
colors
;
int
refcount
;
SDL_PaletteWatch
*
watch
;
};
/**
* \note Everything in the pixel format structure is read-only.
*/
typedef
struct
SDL_PixelFormat
{
SDL_Palette
*
palette
;
Uint8
BitsPerPixel
;
Uint8
BytesPerPixel
;
Uint8
Rloss
;
Uint8
Gloss
;
Uint8
Bloss
;
Uint8
Aloss
;
Uint8
Rshift
;
Uint8
Gshift
;
Uint8
Bshift
;
Uint8
Ashift
;
Uint32
Rmask
;
Uint32
Gmask
;
Uint32
Bmask
;
Uint32
Amask
;
}
SDL_PixelFormat
;
/**
* \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
*
* \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
*
* \sa SDL_MasksToPixelFormatEnum()
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_PixelFormatEnumToMasks
(
Uint32
format
,
int
*
bpp
,
Uint32
*
Rmask
,
Uint32
*
Gmask
,
Uint32
*
Bmask
,
Uint32
*
Amask
);
/**
* \brief Convert a bpp and RGBA masks to an enumerated pixel format.
*
* \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion
* wasn't possible.
*
* \sa SDL_PixelFormatEnumToMasks()
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_MasksToPixelFormatEnum
(
int
bpp
,
Uint32
Rmask
,
Uint32
Gmask
,
Uint32
Bmask
,
Uint32
Amask
);
/**
* \brief Create a palette structure with the specified number of color
* entries.
*
* \return A new palette, or NULL if there wasn't enough memory.
*
* \note The palette entries are initialized to white.
*
* \sa SDL_FreePalette()
*/
extern
DECLSPEC
SDL_Palette
*
SDLCALL
SDL_AllocPalette
(
int
ncolors
);
/**
* \brief Add a callback function which is called when the palette changes.
*
* \sa SDL_DelPaletteWatch()
*/
extern
DECLSPEC
int
SDLCALL
SDL_AddPaletteWatch
(
SDL_Palette
*
palette
,
SDL_PaletteChangedFunc
callback
,
void
*
userdata
);
/**
* \brief Remove a callback function previously added with
* SDL_AddPaletteWatch().
*
* \sa SDL_AddPaletteWatch()
*/
extern
DECLSPEC
void
SDLCALL
SDL_DelPaletteWatch
(
SDL_Palette
*
palette
,
SDL_PaletteChangedFunc
callback
,
void
*
userdata
);
/**
* \brief Set a range of colors in a palette.
*
* \param palette The palette to modify.
* \param colors An array of colors to copy into the palette.
* \param firstcolor The index of the first palette entry to modify.
* \param ncolors The number of entries to modify.
*
* \return 0 on success, or -1 if not all of the colors could be set.
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetPaletteColors
(
SDL_Palette
*
palette
,
const
SDL_Color
*
colors
,
int
firstcolor
,
int
ncolors
);
/**
* \brief Free a palette created with SDL_AllocPalette().
*
* \sa SDL_AllocPalette()
*/
extern
DECLSPEC
void
SDLCALL
SDL_FreePalette
(
SDL_Palette
*
palette
);
/**
* \brief Maps an RGB triple to an opaque pixel value for a given pixel format.
*
* \sa SDL_MapRGBA
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_MapRGB
(
const
SDL_PixelFormat
*
format
,
Uint8
r
,
Uint8
g
,
Uint8
b
);
/**
* \brief Maps an RGBA quadruple to a pixel value for a given pixel format.
*
* \sa SDL_MapRGB
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_MapRGBA
(
const
SDL_PixelFormat
*
format
,
Uint8
r
,
Uint8
g
,
Uint8
b
,
Uint8
a
);
/**
* \brief Get the RGB components from a pixel of the specified format.
*
* \sa SDL_GetRGBA
*/
extern
DECLSPEC
void
SDLCALL
SDL_GetRGB
(
Uint32
pixel
,
const
SDL_PixelFormat
*
format
,
Uint8
*
r
,
Uint8
*
g
,
Uint8
*
b
);
/**
* \brief Get the RGBA components from a pixel of the specified format.
*
* \sa SDL_GetRGB
*/
extern
DECLSPEC
void
SDLCALL
SDL_GetRGBA
(
Uint32
pixel
,
const
SDL_PixelFormat
*
format
,
Uint8
*
r
,
Uint8
*
g
,
Uint8
*
b
,
Uint8
*
a
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_pixels_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_platform.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_platform.h
*
* Try to get a standard set of platform defines.
*/
#ifndef _SDL_platform_h
#define _SDL_platform_h
#if defined(_AIX)
#undef __AIX__
#define __AIX__ 1
#endif
#if defined(__BEOS__)
#undef __BEOS__
#define __BEOS__ 1
#endif
#if defined(__HAIKU__)
#undef __HAIKU__
#define __HAIKU__ 1
#endif
#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
#undef __BSDI__
#define __BSDI__ 1
#endif
#if defined(_arch_dreamcast)
#undef __DREAMCAST__
#define __DREAMCAST__ 1
#endif
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
#undef __FREEBSD__
#define __FREEBSD__ 1
#endif
#if defined(hpux) || defined(__hpux) || defined(__hpux__)
#undef __HPUX__
#define __HPUX__ 1
#endif
#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
#undef __IRIX__
#define __IRIX__ 1
#endif
#if defined(linux) || defined(__linux) || defined(__linux__)
#undef __LINUX__
#define __LINUX__ 1
#endif
#if defined(__APPLE__)
/* lets us know what version of Mac OS X we're compiling on */
#include "AvailabilityMacros.h"
#ifdef MAC_OS_X_VERSION_10_3
#include "TargetConditionals.h"
/* this header is in 10.3 or later */
#if TARGET_OS_IPHONE
/* if compiling for iPhone */
#undef __IPHONEOS__
#define __IPHONEOS__ 1
#undef __MACOSX__
#else
/* if not compiling for iPhone */
#undef __MACOSX__
#define __MACOSX__ 1
#endif
/* TARGET_OS_IPHONE */
#else
/* if earlier verion of Mac OS X than version 10.3 */
#undef __MACOSX__
#define __MACOSX__ 1
#endif
#endif
/* defined(__APPLE__) */
#if defined(__NetBSD__)
#undef __NETBSD__
#define __NETBSD__ 1
#endif
#if defined(__OpenBSD__)
#undef __OPENBSD__
#define __OPENBSD__ 1
#endif
#if defined(__OS2__)
#undef __OS2__
#define __OS2__ 1
#endif
#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
#undef __OSF__
#define __OSF__ 1
#endif
#if defined(__QNXNTO__)
#undef __QNXNTO__
#define __QNXNTO__ 1
#endif
#if defined(riscos) || defined(__riscos) || defined(__riscos__)
#undef __RISCOS__
#define __RISCOS__ 1
#endif
#if defined(__SVR4)
#undef __SOLARIS__
#define __SOLARIS__ 1
#endif
#if defined(WIN32) || defined(_WIN32)
#undef __WIN32__
#define __WIN32__ 1
#endif
#if defined(__NDS__)
#undef __NINTENDODS__
#define __NINTENDODS__ 1
#endif
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* \brief Gets the name of the platform.
*/
extern
DECLSPEC
const
char
*
SDLCALL
SDL_GetPlatform
(
void
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_platform_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_power.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_power_h
#define _SDL_power_h
/**
* \file SDL_power.h
*
* Header for the SDL power management routines.
*/
#include "SDL_stdinc.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* \brief The basic state for the system's power supply.
*/
typedef
enum
{
SDL_POWERSTATE_UNKNOWN
,
/**< cannot determine power status */
SDL_POWERSTATE_ON_BATTERY
,
/**< Not plugged in, running on the battery */
SDL_POWERSTATE_NO_BATTERY
,
/**< Plugged in, no battery available */
SDL_POWERSTATE_CHARGING
,
/**< Plugged in, charging battery */
SDL_POWERSTATE_CHARGED
/**< Plugged in, battery charged */
}
SDL_PowerState
;
/**
* \brief Get the current power supply details.
*
* \param secs Seconds of battery life left. You can pass a NULL here if
* you don't care. Will return -1 if we can't determine a
* value, or we're not running on a battery.
*
* \param pct Percentage of battery life left, between 0 and 100. You can
* pass a NULL here if you don't care. Will return -1 if we
* can't determine a value, or we're not running on a battery.
*
* \return The state of the battery (if any).
*/
extern
DECLSPEC
SDL_PowerState
SDLCALL
SDL_GetPowerInfo
(
int
*
secs
,
int
*
pct
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_power_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_quit.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_quit.h
*
* Include file for SDL quit event handling.
*/
#ifndef _SDL_quit_h
#define _SDL_quit_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
/**
* \file SDL_quit.h
*
* An ::SDL_QUIT event is generated when the user tries to close the application
* window. If it is ignored or filtered out, the window will remain open.
* If it is not ignored or filtered, it is queued normally and the window
* is allowed to close. When the window is closed, screen updates will
* complete, but have no effect.
*
* SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
* and SIGTERM (system termination request), if handlers do not already
* exist, that generate ::SDL_QUIT events as well. There is no way
* to determine the cause of an ::SDL_QUIT event, but setting a signal
* handler in your application will override the default generation of
* quit events for that signal.
*
* \sa SDL_Quit()
*/
/* There are no functions directly affecting the quit event */
#define SDL_QuitRequested() \
(SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK))
#endif
/* _SDL_quit_h */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_rect.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_rect.h
*
* Header file for SDL_rect definition and management functions.
*/
#ifndef _SDL_rect_h
#define _SDL_rect_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_pixels.h"
#include "SDL_rwops.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* \brief The structure that defines a point
*
* \sa SDL_EnclosePoints
*/
typedef
struct
{
int
x
;
int
y
;
}
SDL_Point
;
/**
* \brief A rectangle, with the origin at the upper left.
*
* \sa SDL_RectEmpty
* \sa SDL_RectEquals
* \sa SDL_HasIntersection
* \sa SDL_IntersectRect
* \sa SDL_UnionRect
* \sa SDL_EnclosePoints
*/
typedef
struct
SDL_Rect
{
int
x
,
y
;
int
w
,
h
;
}
SDL_Rect
;
/**
* \brief Returns true if the rectangle has no area.
*/
#define SDL_RectEmpty(X) (((X)->w <= 0) || ((X)->h <= 0))
/**
* \brief Returns true if the two rectangles are equal.
*/
#define SDL_RectEquals(A, B) (((A)->x == (B)->x) && ((A)->y == (B)->y) && \
((A)->w == (B)->w) && ((A)->h == (B)->h))
/**
* \brief Determine whether two rectangles intersect.
*
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_HasIntersection
(
const
SDL_Rect
*
A
,
const
SDL_Rect
*
B
);
/**
* \brief Calculate the intersection of two rectangles.
*
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_IntersectRect
(
const
SDL_Rect
*
A
,
const
SDL_Rect
*
B
,
SDL_Rect
*
result
);
/**
* \brief Calculate the union of two rectangles.
*/
extern
DECLSPEC
void
SDLCALL
SDL_UnionRect
(
const
SDL_Rect
*
A
,
const
SDL_Rect
*
B
,
SDL_Rect
*
result
);
/**
* \brief Calculate a minimal rectangle enclosing a set of points
*
* \return SDL_TRUE if any points were within the clipping rect
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_EnclosePoints
(
const
SDL_Point
*
points
,
int
count
,
const
SDL_Rect
*
clip
,
SDL_Rect
*
result
);
/**
* \brief Calculate the intersection of a rectangle and line segment.
*
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_IntersectRectAndLine
(
const
SDL_Rect
*
rect
,
int
*
X1
,
int
*
Y1
,
int
*
X2
,
int
*
Y2
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_rect_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_rwops.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_rwops.h
*
* This file provides a general interface for SDL to read and write
* data sources. It can easily be extended to files, memory, etc.
*/
#ifndef _SDL_rwops_h
#define _SDL_rwops_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* This is the read/write operation structure -- very basic.
*/
typedef
struct
SDL_RWops
{
/**
* Seek to \c offset relative to \c whence, one of stdio's whence values:
* RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
*
* \return the final offset in the data source.
*/
long
(
SDLCALL
*
seek
)
(
struct
SDL_RWops
*
context
,
long
offset
,
int
whence
);
/**
* Read up to \c maxnum objects each of size \c size from the data
* source to the area pointed at by \c ptr.
*
* \return the number of objects read, or 0 at error or end of file.
*/
size_t
(
SDLCALL
*
read
)
(
struct
SDL_RWops
*
context
,
void
*
ptr
,
size_t
size
,
size_t
maxnum
);
/**
* Write exactly \c num objects each of size \c objsize from the area
* pointed at by \c ptr to data source.
*
* \return the number of objects written, or 0 at error or end of file.
*/
size_t
(
SDLCALL
*
write
)
(
struct
SDL_RWops
*
context
,
const
void
*
ptr
,
size_t
size
,
size_t
num
);
/**
* Close and free an allocated SDL_RWops structure.
*
* \return 0 if successful or -1 on write error when flushing data.
*/
int
(
SDLCALL
*
close
)
(
struct
SDL_RWops
*
context
);
Uint32
type
;
union
{
#ifdef __WIN32__
struct
{
SDL_bool
append
;
void
*
h
;
struct
{
void
*
data
;
size_t
size
;
size_t
left
;
}
buffer
;
}
win32io
;
#endif
#ifdef HAVE_STDIO_H
struct
{
SDL_bool
autoclose
;
FILE
*
fp
;
}
stdio
;
#endif
struct
{
Uint8
*
base
;
Uint8
*
here
;
Uint8
*
stop
;
}
mem
;
struct
{
void
*
data1
;
}
unknown
;
}
hidden
;
}
SDL_RWops
;
/**
* \name RWFrom functions
*
* Functions to create SDL_RWops structures from various data sources.
*/
/*@{*/
extern
DECLSPEC
SDL_RWops
*
SDLCALL
SDL_RWFromFile
(
const
char
*
file
,
const
char
*
mode
);
#ifdef HAVE_STDIO_H
extern
DECLSPEC
SDL_RWops
*
SDLCALL
SDL_RWFromFP
(
FILE
*
fp
,
SDL_bool
autoclose
);
#else
extern
DECLSPEC
SDL_RWops
*
SDLCALL
SDL_RWFromFP
(
void
*
fp
,
SDL_bool
autoclose
);
#endif
extern
DECLSPEC
SDL_RWops
*
SDLCALL
SDL_RWFromMem
(
void
*
mem
,
int
size
);
extern
DECLSPEC
SDL_RWops
*
SDLCALL
SDL_RWFromConstMem
(
const
void
*
mem
,
int
size
);
/*@}*//*RWFrom functions*/
extern
DECLSPEC
SDL_RWops
*
SDLCALL
SDL_AllocRW
(
void
);
extern
DECLSPEC
void
SDLCALL
SDL_FreeRW
(
SDL_RWops
*
area
);
#define RW_SEEK_SET 0
/**< Seek from the beginning of data */
#define RW_SEEK_CUR 1
/**< Seek relative to current read point */
#define RW_SEEK_END 2
/**< Seek relative to the end of data */
/**
* \name Read/write macros
*
* Macros to easily read and write from an SDL_RWops structure.
*/
/*@{*/
#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR)
#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
#define SDL_RWclose(ctx) (ctx)->close(ctx)
/*@}*//*Read/write macros*/
/**
* \name Read endian functions
*
* Read an item of the specified endianness and return in native format.
*/
/*@{*/
extern
DECLSPEC
Uint16
SDLCALL
SDL_ReadLE16
(
SDL_RWops
*
src
);
extern
DECLSPEC
Uint16
SDLCALL
SDL_ReadBE16
(
SDL_RWops
*
src
);
extern
DECLSPEC
Uint32
SDLCALL
SDL_ReadLE32
(
SDL_RWops
*
src
);
extern
DECLSPEC
Uint32
SDLCALL
SDL_ReadBE32
(
SDL_RWops
*
src
);
extern
DECLSPEC
Uint64
SDLCALL
SDL_ReadLE64
(
SDL_RWops
*
src
);
extern
DECLSPEC
Uint64
SDLCALL
SDL_ReadBE64
(
SDL_RWops
*
src
);
/*@}*//*Read endian functions*/
/**
* \name Write endian functions
*
* Write an item of native format to the specified endianness.
*/
/*@{*/
extern
DECLSPEC
size_t
SDLCALL
SDL_WriteLE16
(
SDL_RWops
*
dst
,
Uint16
value
);
extern
DECLSPEC
size_t
SDLCALL
SDL_WriteBE16
(
SDL_RWops
*
dst
,
Uint16
value
);
extern
DECLSPEC
size_t
SDLCALL
SDL_WriteLE32
(
SDL_RWops
*
dst
,
Uint32
value
);
extern
DECLSPEC
size_t
SDLCALL
SDL_WriteBE32
(
SDL_RWops
*
dst
,
Uint32
value
);
extern
DECLSPEC
size_t
SDLCALL
SDL_WriteLE64
(
SDL_RWops
*
dst
,
Uint64
value
);
extern
DECLSPEC
size_t
SDLCALL
SDL_WriteBE64
(
SDL_RWops
*
dst
,
Uint64
value
);
/*@}*//*Write endian functions*/
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_rwops_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_scancode.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_scancode.h
*
* Defines keyboard scancodes.
*/
#ifndef _SDL_scancode_h
#define _SDL_scancode_h
#include "SDL_stdinc.h"
/**
* \brief The SDL keyboard scancode representation.
*
* Values of this type are used to represent keyboard keys, among other places
* in the \link SDL_keysym::scancode key.keysym.scancode \endlink field of the
* SDL_Event structure.
*
* The values in this enumeration are based on the USB usage page standard:
* http://www.usb.org/developers/devclass_docs/Hut1_12.pdf
*/
typedef
enum
{
SDL_SCANCODE_UNKNOWN
=
0
,
/**
* \name Usage page 0x07
*
* These values are from usage page 0x07 (USB keyboard page).
*/
/*@{*/
SDL_SCANCODE_A
=
4
,
SDL_SCANCODE_B
=
5
,
SDL_SCANCODE_C
=
6
,
SDL_SCANCODE_D
=
7
,
SDL_SCANCODE_E
=
8
,
SDL_SCANCODE_F
=
9
,
SDL_SCANCODE_G
=
10
,
SDL_SCANCODE_H
=
11
,
SDL_SCANCODE_I
=
12
,
SDL_SCANCODE_J
=
13
,
SDL_SCANCODE_K
=
14
,
SDL_SCANCODE_L
=
15
,
SDL_SCANCODE_M
=
16
,
SDL_SCANCODE_N
=
17
,
SDL_SCANCODE_O
=
18
,
SDL_SCANCODE_P
=
19
,
SDL_SCANCODE_Q
=
20
,
SDL_SCANCODE_R
=
21
,
SDL_SCANCODE_S
=
22
,
SDL_SCANCODE_T
=
23
,
SDL_SCANCODE_U
=
24
,
SDL_SCANCODE_V
=
25
,
SDL_SCANCODE_W
=
26
,
SDL_SCANCODE_X
=
27
,
SDL_SCANCODE_Y
=
28
,
SDL_SCANCODE_Z
=
29
,
SDL_SCANCODE_1
=
30
,
SDL_SCANCODE_2
=
31
,
SDL_SCANCODE_3
=
32
,
SDL_SCANCODE_4
=
33
,
SDL_SCANCODE_5
=
34
,
SDL_SCANCODE_6
=
35
,
SDL_SCANCODE_7
=
36
,
SDL_SCANCODE_8
=
37
,
SDL_SCANCODE_9
=
38
,
SDL_SCANCODE_0
=
39
,
SDL_SCANCODE_RETURN
=
40
,
SDL_SCANCODE_ESCAPE
=
41
,
SDL_SCANCODE_BACKSPACE
=
42
,
SDL_SCANCODE_TAB
=
43
,
SDL_SCANCODE_SPACE
=
44
,
SDL_SCANCODE_MINUS
=
45
,
SDL_SCANCODE_EQUALS
=
46
,
SDL_SCANCODE_LEFTBRACKET
=
47
,
SDL_SCANCODE_RIGHTBRACKET
=
48
,
SDL_SCANCODE_BACKSLASH
=
49
,
/**< Located at the lower left of the return
* key on ISO keyboards and at the right end
* of the QWERTY row on ANSI keyboards.
* Produces REVERSE SOLIDUS (backslash) and
* VERTICAL LINE in a US layout, REVERSE
* SOLIDUS and VERTICAL LINE in a UK Mac
* layout, NUMBER SIGN and TILDE in a UK
* Windows layout, DOLLAR SIGN and POUND SIGN
* in a Swiss German layout, NUMBER SIGN and
* APOSTROPHE in a German layout, GRAVE
* ACCENT and POUND SIGN in a French Mac
* layout, and ASTERISK and MICRO SIGN in a
* French Windows layout.
*/
SDL_SCANCODE_NONUSHASH
=
50
,
/**< ISO USB keyboards actually use this code
* instead of 49 for the same key, but all
* OSes I've seen treat the two codes
* identically. So, as an implementor, unless
* your keyboard generates both of those
* codes and your OS treats them differently,
* you should generate SDL_SCANCODE_BACKSLASH
* instead of this code. As a user, you
* should not rely on this code because SDL
* will never generate it with most (all?)
* keyboards.
*/
SDL_SCANCODE_SEMICOLON
=
51
,
SDL_SCANCODE_APOSTROPHE
=
52
,
SDL_SCANCODE_GRAVE
=
53
,
/**< Located in the top left corner (on both ANSI
* and ISO keyboards). Produces GRAVE ACCENT and
* TILDE in a US Windows layout and in US and UK
* Mac layouts on ANSI keyboards, GRAVE ACCENT
* and NOT SIGN in a UK Windows layout, SECTION
* SIGN and PLUS-MINUS SIGN in US and UK Mac
* layouts on ISO keyboards, SECTION SIGN and
* DEGREE SIGN in a Swiss German layout (Mac:
* only on ISO keyboards), CIRCUMFLEX ACCENT and
* DEGREE SIGN in a German layout (Mac: only on
* ISO keyboards), SUPERSCRIPT TWO and TILDE in a
* French Windows layout, COMMERCIAL AT and
* NUMBER SIGN in a French Mac layout on ISO
* keyboards, and LESS-THAN SIGN and GREATER-THAN
* SIGN in a Swiss German, German, or French Mac
* layout on ANSI keyboards.
*/
SDL_SCANCODE_COMMA
=
54
,
SDL_SCANCODE_PERIOD
=
55
,
SDL_SCANCODE_SLASH
=
56
,
SDL_SCANCODE_CAPSLOCK
=
57
,
SDL_SCANCODE_F1
=
58
,
SDL_SCANCODE_F2
=
59
,
SDL_SCANCODE_F3
=
60
,
SDL_SCANCODE_F4
=
61
,
SDL_SCANCODE_F5
=
62
,
SDL_SCANCODE_F6
=
63
,
SDL_SCANCODE_F7
=
64
,
SDL_SCANCODE_F8
=
65
,
SDL_SCANCODE_F9
=
66
,
SDL_SCANCODE_F10
=
67
,
SDL_SCANCODE_F11
=
68
,
SDL_SCANCODE_F12
=
69
,
SDL_SCANCODE_PRINTSCREEN
=
70
,
SDL_SCANCODE_SCROLLLOCK
=
71
,
SDL_SCANCODE_PAUSE
=
72
,
SDL_SCANCODE_INSERT
=
73
,
/**< insert on PC, help on some Mac keyboards (but
does send code 73, not 117) */
SDL_SCANCODE_HOME
=
74
,
SDL_SCANCODE_PAGEUP
=
75
,
SDL_SCANCODE_DELETE
=
76
,
SDL_SCANCODE_END
=
77
,
SDL_SCANCODE_PAGEDOWN
=
78
,
SDL_SCANCODE_RIGHT
=
79
,
SDL_SCANCODE_LEFT
=
80
,
SDL_SCANCODE_DOWN
=
81
,
SDL_SCANCODE_UP
=
82
,
SDL_SCANCODE_NUMLOCKCLEAR
=
83
,
/**< num lock on PC, clear on Mac keyboards
*/
SDL_SCANCODE_KP_DIVIDE
=
84
,
SDL_SCANCODE_KP_MULTIPLY
=
85
,
SDL_SCANCODE_KP_MINUS
=
86
,
SDL_SCANCODE_KP_PLUS
=
87
,
SDL_SCANCODE_KP_ENTER
=
88
,
SDL_SCANCODE_KP_1
=
89
,
SDL_SCANCODE_KP_2
=
90
,
SDL_SCANCODE_KP_3
=
91
,
SDL_SCANCODE_KP_4
=
92
,
SDL_SCANCODE_KP_5
=
93
,
SDL_SCANCODE_KP_6
=
94
,
SDL_SCANCODE_KP_7
=
95
,
SDL_SCANCODE_KP_8
=
96
,
SDL_SCANCODE_KP_9
=
97
,
SDL_SCANCODE_KP_0
=
98
,
SDL_SCANCODE_KP_PERIOD
=
99
,
SDL_SCANCODE_NONUSBACKSLASH
=
100
,
/**< This is the additional key that ISO
* keyboards have over ANSI ones,
* located between left shift and Y.
* Produces GRAVE ACCENT and TILDE in a
* US or UK Mac layout, REVERSE SOLIDUS
* (backslash) and VERTICAL LINE in a
* US or UK Windows layout, and
* LESS-THAN SIGN and GREATER-THAN SIGN
* in a Swiss German, German, or French
* layout. */
SDL_SCANCODE_APPLICATION
=
101
,
/**< windows contextual menu, compose */
SDL_SCANCODE_POWER
=
102
,
/**< The USB document says this is a status flag,
* not a physical key - but some Mac keyboards
* do have a power key. */
SDL_SCANCODE_KP_EQUALS
=
103
,
SDL_SCANCODE_F13
=
104
,
SDL_SCANCODE_F14
=
105
,
SDL_SCANCODE_F15
=
106
,
SDL_SCANCODE_F16
=
107
,
SDL_SCANCODE_F17
=
108
,
SDL_SCANCODE_F18
=
109
,
SDL_SCANCODE_F19
=
110
,
SDL_SCANCODE_F20
=
111
,
SDL_SCANCODE_F21
=
112
,
SDL_SCANCODE_F22
=
113
,
SDL_SCANCODE_F23
=
114
,
SDL_SCANCODE_F24
=
115
,
SDL_SCANCODE_EXECUTE
=
116
,
SDL_SCANCODE_HELP
=
117
,
SDL_SCANCODE_MENU
=
118
,
SDL_SCANCODE_SELECT
=
119
,
SDL_SCANCODE_STOP
=
120
,
SDL_SCANCODE_AGAIN
=
121
,
/**< redo */
SDL_SCANCODE_UNDO
=
122
,
SDL_SCANCODE_CUT
=
123
,
SDL_SCANCODE_COPY
=
124
,
SDL_SCANCODE_PASTE
=
125
,
SDL_SCANCODE_FIND
=
126
,
SDL_SCANCODE_MUTE
=
127
,
SDL_SCANCODE_VOLUMEUP
=
128
,
SDL_SCANCODE_VOLUMEDOWN
=
129
,
/* not sure whether there's a reason to enable these */
/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */
/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */
/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */
SDL_SCANCODE_KP_COMMA
=
133
,
SDL_SCANCODE_KP_EQUALSAS400
=
134
,
SDL_SCANCODE_INTERNATIONAL1
=
135
,
/**< used on Asian keyboards, see
footnotes in USB doc */
SDL_SCANCODE_INTERNATIONAL2
=
136
,
SDL_SCANCODE_INTERNATIONAL3
=
137
,
/**< Yen */
SDL_SCANCODE_INTERNATIONAL4
=
138
,
SDL_SCANCODE_INTERNATIONAL5
=
139
,
SDL_SCANCODE_INTERNATIONAL6
=
140
,
SDL_SCANCODE_INTERNATIONAL7
=
141
,
SDL_SCANCODE_INTERNATIONAL8
=
142
,
SDL_SCANCODE_INTERNATIONAL9
=
143
,
SDL_SCANCODE_LANG1
=
144
,
/**< Hangul/English toggle */
SDL_SCANCODE_LANG2
=
145
,
/**< Hanja conversion */
SDL_SCANCODE_LANG3
=
146
,
/**< Katakana */
SDL_SCANCODE_LANG4
=
147
,
/**< Hiragana */
SDL_SCANCODE_LANG5
=
148
,
/**< Zenkaku/Hankaku */
SDL_SCANCODE_LANG6
=
149
,
/**< reserved */
SDL_SCANCODE_LANG7
=
150
,
/**< reserved */
SDL_SCANCODE_LANG8
=
151
,
/**< reserved */
SDL_SCANCODE_LANG9
=
152
,
/**< reserved */
SDL_SCANCODE_ALTERASE
=
153
,
/**< Erase-Eaze */
SDL_SCANCODE_SYSREQ
=
154
,
SDL_SCANCODE_CANCEL
=
155
,
SDL_SCANCODE_CLEAR
=
156
,
SDL_SCANCODE_PRIOR
=
157
,
SDL_SCANCODE_RETURN2
=
158
,
SDL_SCANCODE_SEPARATOR
=
159
,
SDL_SCANCODE_OUT
=
160
,
SDL_SCANCODE_OPER
=
161
,
SDL_SCANCODE_CLEARAGAIN
=
162
,
SDL_SCANCODE_CRSEL
=
163
,
SDL_SCANCODE_EXSEL
=
164
,
SDL_SCANCODE_KP_00
=
176
,
SDL_SCANCODE_KP_000
=
177
,
SDL_SCANCODE_THOUSANDSSEPARATOR
=
178
,
SDL_SCANCODE_DECIMALSEPARATOR
=
179
,
SDL_SCANCODE_CURRENCYUNIT
=
180
,
SDL_SCANCODE_CURRENCYSUBUNIT
=
181
,
SDL_SCANCODE_KP_LEFTPAREN
=
182
,
SDL_SCANCODE_KP_RIGHTPAREN
=
183
,
SDL_SCANCODE_KP_LEFTBRACE
=
184
,
SDL_SCANCODE_KP_RIGHTBRACE
=
185
,
SDL_SCANCODE_KP_TAB
=
186
,
SDL_SCANCODE_KP_BACKSPACE
=
187
,
SDL_SCANCODE_KP_A
=
188
,
SDL_SCANCODE_KP_B
=
189
,
SDL_SCANCODE_KP_C
=
190
,
SDL_SCANCODE_KP_D
=
191
,
SDL_SCANCODE_KP_E
=
192
,
SDL_SCANCODE_KP_F
=
193
,
SDL_SCANCODE_KP_XOR
=
194
,
SDL_SCANCODE_KP_POWER
=
195
,
SDL_SCANCODE_KP_PERCENT
=
196
,
SDL_SCANCODE_KP_LESS
=
197
,
SDL_SCANCODE_KP_GREATER
=
198
,
SDL_SCANCODE_KP_AMPERSAND
=
199
,
SDL_SCANCODE_KP_DBLAMPERSAND
=
200
,
SDL_SCANCODE_KP_VERTICALBAR
=
201
,
SDL_SCANCODE_KP_DBLVERTICALBAR
=
202
,
SDL_SCANCODE_KP_COLON
=
203
,
SDL_SCANCODE_KP_HASH
=
204
,
SDL_SCANCODE_KP_SPACE
=
205
,
SDL_SCANCODE_KP_AT
=
206
,
SDL_SCANCODE_KP_EXCLAM
=
207
,
SDL_SCANCODE_KP_MEMSTORE
=
208
,
SDL_SCANCODE_KP_MEMRECALL
=
209
,
SDL_SCANCODE_KP_MEMCLEAR
=
210
,
SDL_SCANCODE_KP_MEMADD
=
211
,
SDL_SCANCODE_KP_MEMSUBTRACT
=
212
,
SDL_SCANCODE_KP_MEMMULTIPLY
=
213
,
SDL_SCANCODE_KP_MEMDIVIDE
=
214
,
SDL_SCANCODE_KP_PLUSMINUS
=
215
,
SDL_SCANCODE_KP_CLEAR
=
216
,
SDL_SCANCODE_KP_CLEARENTRY
=
217
,
SDL_SCANCODE_KP_BINARY
=
218
,
SDL_SCANCODE_KP_OCTAL
=
219
,
SDL_SCANCODE_KP_DECIMAL
=
220
,
SDL_SCANCODE_KP_HEXADECIMAL
=
221
,
SDL_SCANCODE_LCTRL
=
224
,
SDL_SCANCODE_LSHIFT
=
225
,
SDL_SCANCODE_LALT
=
226
,
/**< alt, option */
SDL_SCANCODE_LGUI
=
227
,
/**< windows, command (apple), meta */
SDL_SCANCODE_RCTRL
=
228
,
SDL_SCANCODE_RSHIFT
=
229
,
SDL_SCANCODE_RALT
=
230
,
/**< alt gr, option */
SDL_SCANCODE_RGUI
=
231
,
/**< windows, command (apple), meta */
SDL_SCANCODE_MODE
=
257
,
/**< I'm not sure if this is really not covered
* by any of the above, but since there's a
* special KMOD_MODE for it I'm adding it here
*/
/*@}*//*Usage page 0x07*/
/**
* \name Usage page 0x0C
*
* These values are mapped from usage page 0x0C (USB consumer page).
*/
/*@{*/
SDL_SCANCODE_AUDIONEXT
=
258
,
SDL_SCANCODE_AUDIOPREV
=
259
,
SDL_SCANCODE_AUDIOSTOP
=
260
,
SDL_SCANCODE_AUDIOPLAY
=
261
,
SDL_SCANCODE_AUDIOMUTE
=
262
,
SDL_SCANCODE_MEDIASELECT
=
263
,
SDL_SCANCODE_WWW
=
264
,
SDL_SCANCODE_MAIL
=
265
,
SDL_SCANCODE_CALCULATOR
=
266
,
SDL_SCANCODE_COMPUTER
=
267
,
SDL_SCANCODE_AC_SEARCH
=
268
,
SDL_SCANCODE_AC_HOME
=
269
,
SDL_SCANCODE_AC_BACK
=
270
,
SDL_SCANCODE_AC_FORWARD
=
271
,
SDL_SCANCODE_AC_STOP
=
272
,
SDL_SCANCODE_AC_REFRESH
=
273
,
SDL_SCANCODE_AC_BOOKMARKS
=
274
,
/*@}*//*Usage page 0x0C*/
/**
* \name Walther keys
*
* These are values that Christian Walther added (for mac keyboard?).
*/
/*@{*/
SDL_SCANCODE_BRIGHTNESSDOWN
=
275
,
SDL_SCANCODE_BRIGHTNESSUP
=
276
,
SDL_SCANCODE_DISPLAYSWITCH
=
277
,
/**< display mirroring/dual display
switch, video mode switch */
SDL_SCANCODE_KBDILLUMTOGGLE
=
278
,
SDL_SCANCODE_KBDILLUMDOWN
=
279
,
SDL_SCANCODE_KBDILLUMUP
=
280
,
SDL_SCANCODE_EJECT
=
281
,
SDL_SCANCODE_SLEEP
=
282
,
/*@}*//*Walther keys*/
/* Add any other keys here. */
SDL_NUM_SCANCODES
=
512
/**< not a key, just marks the number of scancodes
for array bounds */
}
SDL_scancode
;
#endif
/* _SDL_scancode_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_stdinc.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_stdinc.h
*
* This is a general header that includes C language support.
*/
#ifndef _SDL_stdinc_h
#define _SDL_stdinc_h
#include "SDL_config.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#if defined(STDC_HEADERS)
# include <stdlib.h>
# include <stddef.h>
# include <stdarg.h>
#else
# if defined(HAVE_STDLIB_H)
# include <stdlib.h>
# elif defined(HAVE_MALLOC_H)
# include <malloc.h>
# endif
# if defined(HAVE_STDDEF_H)
# include <stddef.h>
# endif
# if defined(HAVE_STDARG_H)
# include <stdarg.h>
# endif
#endif
#ifdef HAVE_STRING_H
# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
# include <memory.h>
# endif
# include <string.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
#elif defined(HAVE_STDINT_H)
# include <stdint.h>
#endif
#ifdef HAVE_CTYPE_H
# include <ctype.h>
#endif
#ifdef HAVE_MATH_H
# include <math.h>
#endif
#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
# include <iconv.h>
#endif
/**
* The number of elements in an array.
*/
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
#define SDL_TABLESIZE(table) SDL_arraysize(table)
/**
* \name Cast operators
*
* Use proper C++ casts when compiled as C++ to be compatible with the option
* -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above).
*/
/*@{*/
#ifdef __cplusplus
#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
#define SDL_static_cast(type, expression) static_cast<type>(expression)
#else
#define SDL_reinterpret_cast(type, expression) ((type)(expression))
#define SDL_static_cast(type, expression) ((type)(expression))
#endif
/*@}*//*Cast operators*/
/* Define a four character code as a Uint32 */
#define SDL_FOURCC(A, B, C, D) \
((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24))
/**
* \name Basic data types
*/
/*@{*/
typedef
enum
{
SDL_FALSE
=
0
,
SDL_TRUE
=
1
}
SDL_bool
;
/**
* \brief A signed 8-bit integer type.
*/
typedef
int8_t
Sint8
;
/**
* \brief An unsigned 8-bit integer type.
*/
typedef
uint8_t
Uint8
;
/**
* \brief A signed 16-bit integer type.
*/
typedef
int16_t
Sint16
;
/**
* \brief An unsigned 16-bit integer type.
*/
typedef
uint16_t
Uint16
;
/**
* \brief A signed 32-bit integer type.
*/
typedef
int32_t
Sint32
;
/**
* \brief An unsigned 32-bit integer type.
*/
typedef
uint32_t
Uint32
;
#ifdef SDL_HAS_64BIT_TYPE
/**
* \brief A signed 64-bit integer type.
* \warning On platforms without any sort of 64-bit datatype, this is equivalent to Sint32!
*/
typedef
int64_t
Sint64
;
/**
* \brief An unsigned 64-bit integer type.
* \warning On platforms without any sort of 64-bit datatype, this is equivalent to Uint32!
*/
typedef
uint64_t
Uint64
;
#else
/* This is really just a hack to prevent the compiler from complaining */
typedef
Sint32
Sint64
;
typedef
Uint32
Uint64
;
#endif
/*@}*//*Basic data types*/
#define SDL_COMPILE_TIME_ASSERT(name, x) \
typedef int SDL_dummy_ ## name[(x) * 2 - 1]
/** \cond */
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
SDL_COMPILE_TIME_ASSERT
(
uint8
,
sizeof
(
Uint8
)
==
1
);
SDL_COMPILE_TIME_ASSERT
(
sint8
,
sizeof
(
Sint8
)
==
1
);
SDL_COMPILE_TIME_ASSERT
(
uint16
,
sizeof
(
Uint16
)
==
2
);
SDL_COMPILE_TIME_ASSERT
(
sint16
,
sizeof
(
Sint16
)
==
2
);
SDL_COMPILE_TIME_ASSERT
(
uint32
,
sizeof
(
Uint32
)
==
4
);
SDL_COMPILE_TIME_ASSERT
(
sint32
,
sizeof
(
Sint32
)
==
4
);
#ifndef __NINTENDODS__
/* TODO: figure out why the following happens:
include/SDL_stdinc.h:150: error: size of array 'SDL_dummy_uint64' is negative
include/SDL_stdinc.h:151: error: size of array 'SDL_dummy_sint64' is negative */
SDL_COMPILE_TIME_ASSERT
(
uint64
,
sizeof
(
Uint64
)
==
8
);
SDL_COMPILE_TIME_ASSERT
(
sint64
,
sizeof
(
Sint64
)
==
8
);
#endif
#endif
/* DOXYGEN_SHOULD_IGNORE_THIS */
/** \endcond */
/* Check to make sure enums are the size of ints, for structure packing.
For both Watcom C/C++ and Borland C/C++ the compiler option that makes
enums having the size of an int must be enabled.
This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
*/
/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */
#ifdef __MWERKS__
#pragma enumsalwaysint on
#endif
/** \cond */
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
#ifndef __NINTENDODS__
/* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
typedef
enum
{
DUMMY_ENUM_VALUE
}
SDL_DUMMY_ENUM
;
SDL_COMPILE_TIME_ASSERT
(
enum
,
sizeof
(
SDL_DUMMY_ENUM
)
==
sizeof
(
int
));
#endif
#endif
/* DOXYGEN_SHOULD_IGNORE_THIS */
/** \endcond */
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
#ifdef HAVE_MALLOC
#define SDL_malloc malloc
#else
extern
DECLSPEC
void
*
SDLCALL
SDL_malloc
(
size_t
size
);
#endif
#ifdef HAVE_CALLOC
#define SDL_calloc calloc
#else
extern
DECLSPEC
void
*
SDLCALL
SDL_calloc
(
size_t
nmemb
,
size_t
size
);
#endif
#ifdef HAVE_REALLOC
#define SDL_realloc realloc
#else
extern
DECLSPEC
void
*
SDLCALL
SDL_realloc
(
void
*
mem
,
size_t
size
);
#endif
#ifdef HAVE_FREE
#define SDL_free free
#else
extern
DECLSPEC
void
SDLCALL
SDL_free
(
void
*
mem
);
#endif
#if defined(HAVE_ALLOCA) && !defined(alloca)
# if defined(HAVE_ALLOCA_H)
# include <alloca.h>
# elif defined(__GNUC__)
# define alloca __builtin_alloca
# elif defined(_MSC_VER)
# include <malloc.h>
# define alloca _alloca
# elif defined(__WATCOMC__)
# include <malloc.h>
# elif defined(__BORLANDC__)
# include <malloc.h>
# elif defined(__DMC__)
# include <stdlib.h>
# elif defined(__AIX__)
#pragma alloca
# elif defined(__MRC__)
void
*
alloca
(
unsigned
);
# else
char
*
alloca
();
# endif
#endif
#ifdef HAVE_ALLOCA
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
#define SDL_stack_free(data)
#else
#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count))
#define SDL_stack_free(data) SDL_free(data)
#endif
#ifdef HAVE_GETENV
#define SDL_getenv getenv
#else
extern
DECLSPEC
char
*
SDLCALL
SDL_getenv
(
const
char
*
name
);
#endif
/* SDL_putenv() has moved to SDL_compat. */
#ifdef HAVE_SETENV
#define SDL_setenv setenv
#else
extern
DECLSPEC
int
SDLCALL
SDL_setenv
(
const
char
*
name
,
const
char
*
value
,
int
overwrite
);
#endif
#ifdef HAVE_QSORT
#define SDL_qsort qsort
#else
extern
DECLSPEC
void
SDLCALL
SDL_qsort
(
void
*
base
,
size_t
nmemb
,
size_t
size
,
int
(
*
compare
)
(
const
void
*
,
const
void
*
));
#endif
#ifdef HAVE_ABS
#define SDL_abs abs
#else
#define SDL_abs(X) ((X) < 0 ? -(X) : (X))
#endif
#define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
#define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
#ifdef HAVE_CTYPE_H
#define SDL_isdigit(X) isdigit(X)
#define SDL_isspace(X) isspace(X)
#define SDL_toupper(X) toupper(X)
#define SDL_tolower(X) tolower(X)
#else
#define SDL_isdigit(X) (((X) >= '0') && ((X) <= '9'))
#define SDL_isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n'))
#define SDL_toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X))
#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X))
#endif
#ifdef HAVE_MEMSET
#define SDL_memset memset
#else
extern
DECLSPEC
void
*
SDLCALL
SDL_memset
(
void
*
dst
,
int
c
,
size_t
len
);
#endif
#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
#if defined(__GNUC__) && defined(i386)
#define SDL_memset4(dst, val, len) \
do { \
int u0, u1, u2; \
__asm__ __volatile__ ( \
"cld\n\t" \
"rep ; stosl\n\t" \
: "=&D" (u0), "=&a" (u1), "=&c" (u2) \
: "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len)) \
: "memory" ); \
} while(0)
#endif
#ifndef SDL_memset4
#define SDL_memset4(dst, val, len) \
do { \
unsigned _count = (len); \
unsigned _n = (_count + 3) / 4; \
Uint32 *_p = SDL_static_cast(Uint32 *, dst); \
Uint32 _val = (val); \
if (len == 0) break; \
switch (_count % 4) { \
case 0: do { *_p++ = _val; \
case 3: *_p++ = _val; \
case 2: *_p++ = _val; \
case 1: *_p++ = _val; \
} while ( --_n ); \
} \
} while(0)
#endif
/* We can count on memcpy existing on Mac OS X and being well-tuned. */
#if defined(__MACH__) && defined(__APPLE__)
#define SDL_memcpy(dst, src, len) memcpy(dst, src, len)
#elif defined(__GNUC__) && defined(i386)
#define SDL_memcpy(dst, src, len) \
do { \
int u0, u1, u2; \
__asm__ __volatile__ ( \
"cld\n\t" \
"rep ; movsl\n\t" \
"testb $2,%b4\n\t" \
"je 1f\n\t" \
"movsw\n" \
"1:\ttestb $1,%b4\n\t" \
"je 2f\n\t" \
"movsb\n" \
"2:" \
: "=&c" (u0), "=&D" (u1), "=&S" (u2) \
: "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \
: "memory" ); \
} while(0)
#endif
#ifndef SDL_memcpy
#ifdef HAVE_MEMCPY
#define SDL_memcpy memcpy
#elif defined(HAVE_BCOPY)
#define SDL_memcpy(d, s, n) bcopy((s), (d), (n))
#else
extern
DECLSPEC
void
*
SDLCALL
SDL_memcpy
(
void
*
dst
,
const
void
*
src
,
size_t
len
);
#endif
#endif
/* We can count on memcpy existing on Mac OS X and being well-tuned. */
#if defined(__MACH__) && defined(__APPLE__)
#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4)
#elif defined(__GNUC__) && defined(i386)
#define SDL_memcpy4(dst, src, len) \
do { \
int ecx, edi, esi; \
__asm__ __volatile__ ( \
"cld\n\t" \
"rep ; movsl" \
: "=&c" (ecx), "=&D" (edi), "=&S" (esi) \
: "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src) \
: "memory" ); \
} while(0)
#endif
#ifndef SDL_memcpy4
#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2)
#endif
#if defined(__GNUC__) && defined(i386)
#define SDL_revcpy(dst, src, len) \
do { \
int u0, u1, u2; \
char *dstp = SDL_static_cast(char *, dst); \
char *srcp = SDL_static_cast(char *, src); \
int n = (len); \
if ( n >= 4 ) { \
__asm__ __volatile__ ( \
"std\n\t" \
"rep ; movsl\n\t" \
"cld\n\t" \
: "=&c" (u0), "=&D" (u1), "=&S" (u2) \
: "0" (n >> 2), \
"1" (dstp+(n-4)), "2" (srcp+(n-4)) \
: "memory" ); \
} \
switch (n & 3) { \
case 3: dstp[2] = srcp[2]; \
case 2: dstp[1] = srcp[1]; \
case 1: dstp[0] = srcp[0]; \
break; \
default: \
break; \
} \
} while(0)
#endif
#ifndef SDL_revcpy
extern
DECLSPEC
void
*
SDLCALL
SDL_revcpy
(
void
*
dst
,
const
void
*
src
,
size_t
len
);
#endif
#ifdef HAVE_MEMMOVE
#define SDL_memmove memmove
#elif defined(HAVE_BCOPY)
#define SDL_memmove(d, s, n) bcopy((s), (d), (n))
#else
#define SDL_memmove(dst, src, len) \
do { \
if ( dst < src ) { \
SDL_memcpy(dst, src, len); \
} else { \
SDL_revcpy(dst, src, len); \
} \
} while(0)
#endif
#ifdef HAVE_MEMCMP
#define SDL_memcmp memcmp
#else
extern
DECLSPEC
int
SDLCALL
SDL_memcmp
(
const
void
*
s1
,
const
void
*
s2
,
size_t
len
);
#endif
#ifdef HAVE_STRLEN
#define SDL_strlen strlen
#else
extern
DECLSPEC
size_t
SDLCALL
SDL_strlen
(
const
char
*
string
);
#endif
#ifdef HAVE_WCSLEN
#define SDL_wcslen wcslen
#else
#if !defined(wchar_t) && defined(__NINTENDODS__)
#define wchar_t short
/* TODO: figure out why libnds doesn't have this */
#endif
extern
DECLSPEC
size_t
SDLCALL
SDL_wcslen
(
const
wchar_t
*
string
);
#endif
#ifdef HAVE_STRLCPY
#define SDL_strlcpy strlcpy
#else
extern
DECLSPEC
size_t
SDLCALL
SDL_strlcpy
(
char
*
dst
,
const
char
*
src
,
size_t
maxlen
);
#endif
#ifdef HAVE_STRLCAT
#define SDL_strlcat strlcat
#else
extern
DECLSPEC
size_t
SDLCALL
SDL_strlcat
(
char
*
dst
,
const
char
*
src
,
size_t
maxlen
);
#endif
#ifdef HAVE_STRDUP
#define SDL_strdup strdup
#else
extern
DECLSPEC
char
*
SDLCALL
SDL_strdup
(
const
char
*
string
);
#endif
#ifdef HAVE__STRREV
#define SDL_strrev _strrev
#else
extern
DECLSPEC
char
*
SDLCALL
SDL_strrev
(
char
*
string
);
#endif
#ifdef HAVE__STRUPR
#define SDL_strupr _strupr
#else
extern
DECLSPEC
char
*
SDLCALL
SDL_strupr
(
char
*
string
);
#endif
#ifdef HAVE__STRLWR
#define SDL_strlwr _strlwr
#else
extern
DECLSPEC
char
*
SDLCALL
SDL_strlwr
(
char
*
string
);
#endif
#ifdef HAVE_STRCHR
#define SDL_strchr strchr
#elif defined(HAVE_INDEX)
#define SDL_strchr index
#else
extern
DECLSPEC
char
*
SDLCALL
SDL_strchr
(
const
char
*
string
,
int
c
);
#endif
#ifdef HAVE_STRRCHR
#define SDL_strrchr strrchr
#elif defined(HAVE_RINDEX)
#define SDL_strrchr rindex
#else
extern
DECLSPEC
char
*
SDLCALL
SDL_strrchr
(
const
char
*
string
,
int
c
);
#endif
#ifdef HAVE_STRSTR
#define SDL_strstr strstr
#else
extern
DECLSPEC
char
*
SDLCALL
SDL_strstr
(
const
char
*
haystack
,
const
char
*
needle
);
#endif
#ifdef HAVE_ITOA
#define SDL_itoa itoa
#else
#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix)
#endif
#ifdef HAVE__LTOA
#define SDL_ltoa _ltoa
#else
extern
DECLSPEC
char
*
SDLCALL
SDL_ltoa
(
long
value
,
char
*
string
,
int
radix
);
#endif
#ifdef HAVE__UITOA
#define SDL_uitoa _uitoa
#else
#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix)
#endif
#ifdef HAVE__ULTOA
#define SDL_ultoa _ultoa
#else
extern
DECLSPEC
char
*
SDLCALL
SDL_ultoa
(
unsigned
long
value
,
char
*
string
,
int
radix
);
#endif
#ifdef HAVE_STRTOL
#define SDL_strtol strtol
#else
extern
DECLSPEC
long
SDLCALL
SDL_strtol
(
const
char
*
string
,
char
**
endp
,
int
base
);
#endif
#ifdef HAVE_STRTOUL
#define SDL_strtoul strtoul
#else
extern
DECLSPEC
unsigned
long
SDLCALL
SDL_strtoul
(
const
char
*
string
,
char
**
endp
,
int
base
);
#endif
#ifdef SDL_HAS_64BIT_TYPE
#ifdef HAVE__I64TOA
#define SDL_lltoa _i64toa
#else
extern
DECLSPEC
char
*
SDLCALL
SDL_lltoa
(
Sint64
value
,
char
*
string
,
int
radix
);
#endif
#ifdef HAVE__UI64TOA
#define SDL_ulltoa _ui64toa
#else
extern
DECLSPEC
char
*
SDLCALL
SDL_ulltoa
(
Uint64
value
,
char
*
string
,
int
radix
);
#endif
#ifdef HAVE_STRTOLL
#define SDL_strtoll strtoll
#else
extern
DECLSPEC
Sint64
SDLCALL
SDL_strtoll
(
const
char
*
string
,
char
**
endp
,
int
base
);
#endif
#ifdef HAVE_STRTOULL
#define SDL_strtoull strtoull
#else
extern
DECLSPEC
Uint64
SDLCALL
SDL_strtoull
(
const
char
*
string
,
char
**
endp
,
int
base
);
#endif
#endif
/* SDL_HAS_64BIT_TYPE */
#ifdef HAVE_STRTOD
#define SDL_strtod strtod
#else
extern
DECLSPEC
double
SDLCALL
SDL_strtod
(
const
char
*
string
,
char
**
endp
);
#endif
#ifdef HAVE_ATOI
#define SDL_atoi atoi
#else
#define SDL_atoi(X) SDL_strtol(X, NULL, 0)
#endif
#ifdef HAVE_ATOF
#define SDL_atof atof
#else
#define SDL_atof(X) SDL_strtod(X, NULL)
#endif
#ifdef HAVE_STRCMP
#define SDL_strcmp strcmp
#else
extern
DECLSPEC
int
SDLCALL
SDL_strcmp
(
const
char
*
str1
,
const
char
*
str2
);
#endif
#ifdef HAVE_STRNCMP
#define SDL_strncmp strncmp
#else
extern
DECLSPEC
int
SDLCALL
SDL_strncmp
(
const
char
*
str1
,
const
char
*
str2
,
size_t
maxlen
);
#endif
#ifdef HAVE_STRCASECMP
#define SDL_strcasecmp strcasecmp
#elif defined(HAVE__STRICMP)
#define SDL_strcasecmp _stricmp
#else
extern
DECLSPEC
int
SDLCALL
SDL_strcasecmp
(
const
char
*
str1
,
const
char
*
str2
);
#endif
#ifdef HAVE_STRNCASECMP
#define SDL_strncasecmp strncasecmp
#elif defined(HAVE__STRNICMP)
#define SDL_strncasecmp _strnicmp
#else
extern
DECLSPEC
int
SDLCALL
SDL_strncasecmp
(
const
char
*
str1
,
const
char
*
str2
,
size_t
maxlen
);
#endif
#ifdef HAVE_SSCANF
#define SDL_sscanf sscanf
#else
extern
DECLSPEC
int
SDLCALL
SDL_sscanf
(
const
char
*
text
,
const
char
*
fmt
,
...);
#endif
#ifdef HAVE_SNPRINTF
#define SDL_snprintf snprintf
#else
extern
DECLSPEC
int
SDLCALL
SDL_snprintf
(
char
*
text
,
size_t
maxlen
,
const
char
*
fmt
,
...);
#endif
#ifdef HAVE_VSNPRINTF
#define SDL_vsnprintf vsnprintf
#else
extern
DECLSPEC
int
SDLCALL
SDL_vsnprintf
(
char
*
text
,
size_t
maxlen
,
const
char
*
fmt
,
va_list
ap
);
#endif
#ifndef HAVE_M_PI
#define M_PI 3.14159265358979323846264338327950288
/* pi */
#endif
#ifdef HAVE_CEIL
#define SDL_ceil ceil
#else
#define SDL_ceil(x) ((double)(int)((x)+0.5))
#endif
#ifdef HAVE_COPYSIGN
#define SDL_copysign copysign
#else
extern
DECLSPEC
double
SDLCALL
SDL_copysign
(
double
x
,
double
y
);
#endif
#ifdef HAVE_COS
#define SDL_cos cos
#else
extern
DECLSPEC
double
SDLCALL
SDL_cos
(
double
x
);
#endif
#ifdef HAVE_COSF
#define SDL_cosf cosf
#else
#define SDL_cosf(x) (float)SDL_cos((double)x)
#endif
#ifdef HAVE_FABS
#define SDL_fabs fabs
#else
extern
DECLSPEC
double
SDLCALL
SDL_fabs
(
double
x
);
#endif
#ifdef HAVE_FLOOR
#define SDL_floor floor
#else
extern
DECLSPEC
double
SDLCALL
SDL_floor
(
double
x
);
#endif
#ifdef HAVE_LOG
#define SDL_log log
#else
extern
DECLSPEC
double
SDLCALL
SDL_log
(
double
x
);
#endif
#ifdef HAVE_POW
#define SDL_pow pow
#else
extern
DECLSPEC
double
SDLCALL
SDL_pow
(
double
x
,
double
y
);
#endif
#ifdef HAVE_SCALBN
#define SDL_scalbn scalbn
#else
extern
DECLSPEC
double
SDLCALL
SDL_scalbn
(
double
x
,
int
n
);
#endif
#ifdef HAVE_SIN
#define SDL_sin sin
#else
extern
DECLSPEC
double
SDLCALL
SDL_sin
(
double
x
);
#endif
#ifdef HAVE_SINF
#define SDL_sinf sinf
#else
#define SDL_sinf(x) (float)SDL_sin((double)x)
#endif
#ifdef HAVE_SQRT
#define SDL_sqrt sqrt
#else
extern
DECLSPEC
double
SDLCALL
SDL_sqrt
(
double
x
);
#endif
/* The SDL implementation of iconv() returns these error codes */
#define SDL_ICONV_ERROR (size_t)-1
#define SDL_ICONV_E2BIG (size_t)-2
#define SDL_ICONV_EILSEQ (size_t)-3
#define SDL_ICONV_EINVAL (size_t)-4
#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
#define SDL_iconv_t iconv_t
#define SDL_iconv_open iconv_open
#define SDL_iconv_close iconv_close
#else
typedef
struct
_SDL_iconv_t
*
SDL_iconv_t
;
extern
DECLSPEC
SDL_iconv_t
SDLCALL
SDL_iconv_open
(
const
char
*
tocode
,
const
char
*
fromcode
);
extern
DECLSPEC
int
SDLCALL
SDL_iconv_close
(
SDL_iconv_t
cd
);
#endif
extern
DECLSPEC
size_t
SDLCALL
SDL_iconv
(
SDL_iconv_t
cd
,
const
char
**
inbuf
,
size_t
*
inbytesleft
,
char
**
outbuf
,
size_t
*
outbytesleft
);
/**
* This function converts a string between encodings in one pass, returning a
* string that must be freed with SDL_free() or NULL on error.
*/
extern
DECLSPEC
char
*
SDLCALL
SDL_iconv_string
(
const
char
*
tocode
,
const
char
*
fromcode
,
const
char
*
inbuf
,
size_t
inbytesleft
);
#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_stdinc_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_surface.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_surface.h
*
* Header file for ::SDL_surface definition and management functions.
*/
#ifndef _SDL_surface_h
#define _SDL_surface_h
#include "SDL_stdinc.h"
#include "SDL_pixels.h"
#include "SDL_rect.h"
#include "SDL_rwops.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* \name Surface flags
*
* These are the currently supported flags for the ::SDL_surface.
*
* \internal
* Used internally (read-only).
*/
/*@{*/
#define SDL_PREALLOC 0x00000001
/**< Surface uses preallocated memory */
#define SDL_RLEACCEL 0x00000002
/**< Surface is RLE encoded */
/*@}*//*Surface flags*/
/**
* Evaluates to true if the surface needs to be locked before access.
*/
#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
/**
* \brief A collection of pixels used in software blitting.
*
* \note This structure should be treated as read-only, except for \c pixels,
* which, if not NULL, contains the raw pixel data for the surface.
*/
typedef
struct
SDL_Surface
{
Uint32
flags
;
/**< Read-only */
SDL_PixelFormat
*
format
;
/**< Read-only */
int
w
,
h
;
/**< Read-only */
int
pitch
;
/**< Read-only */
void
*
pixels
;
/**< Read-write */
/** Application data associated with the surface */
void
*
userdata
;
/**< Read-write */
/** information needed for surfaces requiring locks */
int
locked
;
/**< Read-only */
void
*
lock_data
;
/**< Read-only */
/** clipping information */
SDL_Rect
clip_rect
;
/**< Read-only */
/** info for fast blit mapping to other surfaces */
struct
SDL_BlitMap
*
map
;
/**< Private */
/** format version, bumped at every change to invalidate blit maps */
unsigned
int
format_version
;
/**< Private */
/** Reference count -- used when freeing surface */
int
refcount
;
/**< Read-mostly */
}
SDL_Surface
;
/**
* \brief The type of function used for surface blitting functions.
*/
typedef
int
(
*
SDL_blit
)
(
struct
SDL_Surface
*
src
,
SDL_Rect
*
srcrect
,
struct
SDL_Surface
*
dst
,
SDL_Rect
*
dstrect
);
/**
* Allocate and free an RGB surface.
*
* If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
* If the depth is greater than 8 bits, the pixel format is set using the
* flags '[RGB]mask'.
*
* If the function runs out of memory, it will return NULL.
*
* \param flags The \c flags are obsolete and should be set to 0.
*/
extern
DECLSPEC
SDL_Surface
*
SDLCALL
SDL_CreateRGBSurface
(
Uint32
flags
,
int
width
,
int
height
,
int
depth
,
Uint32
Rmask
,
Uint32
Gmask
,
Uint32
Bmask
,
Uint32
Amask
);
extern
DECLSPEC
SDL_Surface
*
SDLCALL
SDL_CreateRGBSurfaceFrom
(
void
*
pixels
,
int
width
,
int
height
,
int
depth
,
int
pitch
,
Uint32
Rmask
,
Uint32
Gmask
,
Uint32
Bmask
,
Uint32
Amask
);
extern
DECLSPEC
void
SDLCALL
SDL_FreeSurface
(
SDL_Surface
*
surface
);
/**
* \brief Set the palette used by a surface.
*
* \return 0, or -1 if the surface format doesn't use a palette.
*
* \note A single palette can be shared with many surfaces.
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetSurfacePalette
(
SDL_Surface
*
surface
,
SDL_Palette
*
palette
);
/**
* \brief Sets up a surface for directly accessing the pixels.
*
* Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write
* to and read from \c surface->pixels, using the pixel format stored in
* \c surface->format. Once you are done accessing the surface, you should
* use SDL_UnlockSurface() to release it.
*
* Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
* to 0, then you can read and write to the surface at any time, and the
* pixel format of the surface will not change.
*
* No operating system or library calls should be made between lock/unlock
* pairs, as critical system locks may be held during this time.
*
* SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
*
* \sa SDL_UnlockSurface()
*/
extern
DECLSPEC
int
SDLCALL
SDL_LockSurface
(
SDL_Surface
*
surface
);
/** \sa SDL_LockSurface() */
extern
DECLSPEC
void
SDLCALL
SDL_UnlockSurface
(
SDL_Surface
*
surface
);
/**
* Load a surface from a seekable SDL data source (memory or file).
*
* If \c freesrc is non-zero, the source will be closed after being read.
*
* The new surface should be freed with SDL_FreeSurface().
*
* \return the new surface, or NULL if there was an error.
*/
extern
DECLSPEC
SDL_Surface
*
SDLCALL
SDL_LoadBMP_RW
(
SDL_RWops
*
src
,
int
freesrc
);
/**
* Load a surface from a file.
*
* Convenience macro.
*/
#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
/**
* Save a surface to a seekable SDL data source (memory or file).
*
* If \c freedst is non-zero, the source will be closed after being written.
*
* \return 0 if successful or -1 if there was an error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_SaveBMP_RW
(
SDL_Surface
*
surface
,
SDL_RWops
*
dst
,
int
freedst
);
/**
* Save a surface to a file.
*
* Convenience macro.
*/
#define SDL_SaveBMP(surface, file) \
SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
/**
* \brief Sets the RLE acceleration hint for a surface.
*
* \return 0 on success, or -1 if the surface is not valid
*
* \note If RLE is enabled, colorkey and alpha blending blits are much faster,
* but the surface must be locked before directly accessing the pixels.
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetSurfaceRLE
(
SDL_Surface
*
surface
,
int
flag
);
/**
* \brief Sets the color key (transparent pixel) in a blittable surface.
*
* \param surface The surface to update
* \param flag Non-zero to enable colorkey and 0 to disable colorkey
* \param key The transparent pixel in the native surface format
*
* \return 0 on success, or -1 if the surface is not valid
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetColorKey
(
SDL_Surface
*
surface
,
int
flag
,
Uint32
key
);
/**
* \brief Gets the color key (transparent pixel) in a blittable surface.
*
* \param surface The surface to update
* \param key A pointer filled in with the transparent pixel in the native
* surface format
*
* \return 0 on success, or -1 if the surface is not valid or colorkey is not
* enabled.
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetColorKey
(
SDL_Surface
*
surface
,
Uint32
*
key
);
/**
* \brief Set an additional color value used in blit operations.
*
* \param surface The surface to update.
* \param r The red source color value multiplied into blit operations.
* \param g The green source color value multiplied into blit operations.
* \param b The blue source color value multiplied into blit operations.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_GetSurfaceColorMod()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetSurfaceColorMod
(
SDL_Surface
*
surface
,
Uint8
r
,
Uint8
g
,
Uint8
b
);
/**
* \brief Get the additional color value used in blit operations.
*
* \param surface The surface to query.
* \param r A pointer filled in with the source red color value.
* \param g A pointer filled in with the source green color value.
* \param b A pointer filled in with the source blue color value.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_SetSurfaceColorMod()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetSurfaceColorMod
(
SDL_Surface
*
surface
,
Uint8
*
r
,
Uint8
*
g
,
Uint8
*
b
);
/**
* \brief Set an additional alpha value used in blit operations.
*
* \param surface The surface to update.
* \param alpha The source alpha value multiplied into blit operations.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_GetSurfaceAlphaMod()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetSurfaceAlphaMod
(
SDL_Surface
*
surface
,
Uint8
alpha
);
/**
* \brief Get the additional alpha value used in blit operations.
*
* \param surface The surface to query.
* \param alpha A pointer filled in with the source alpha value.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_SetSurfaceAlphaMod()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetSurfaceAlphaMod
(
SDL_Surface
*
surface
,
Uint8
*
alpha
);
/**
* \brief Set the blend mode used for blit operations.
*
* \param surface The surface to update.
* \param blendMode ::SDL_BlendMode to use for blit blending.
*
* \return 0 on success, or -1 if the parameters are not valid.
*
* \sa SDL_GetSurfaceBlendMode()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetSurfaceBlendMode
(
SDL_Surface
*
surface
,
int
blendMode
);
/**
* \brief Get the blend mode used for blit operations.
*
* \param surface The surface to query.
* \param blendMode A pointer filled in with the current blend mode.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_SetSurfaceBlendMode()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetSurfaceBlendMode
(
SDL_Surface
*
surface
,
int
*
blendMode
);
/**
* \brief Set the scale mode used for blit operations.
*
* \param surface The surface to update.
* \param scaleMode ::SDL_TextureScaleMode to use for blit scaling.
*
* \return 0 on success, or -1 if the surface is not valid or the scale mode is
* not supported.
*
* \note If the scale mode is not supported, the closest supported mode is
* chosen. Currently only ::SDL_TEXTURESCALEMODE_FAST is supported on
* surfaces.
*
* \sa SDL_GetSurfaceScaleMode()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetSurfaceScaleMode
(
SDL_Surface
*
surface
,
int
scaleMode
);
/**
* \brief Get the scale mode used for blit operations.
*
* \param surface The surface to query.
* \param scaleMode A pointer filled in with the current scale mode.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_SetSurfaceScaleMode()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetSurfaceScaleMode
(
SDL_Surface
*
surface
,
int
*
scaleMode
);
/**
* Sets the clipping rectangle for the destination surface in a blit.
*
* If the clip rectangle is NULL, clipping will be disabled.
*
* If the clip rectangle doesn't intersect the surface, the function will
* return SDL_FALSE and blits will be completely clipped. Otherwise the
* function returns SDL_TRUE and blits to the surface will be clipped to
* the intersection of the surface area and the clipping rectangle.
*
* Note that blits are automatically clipped to the edges of the source
* and destination surfaces.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_SetClipRect
(
SDL_Surface
*
surface
,
const
SDL_Rect
*
rect
);
/**
* Gets the clipping rectangle for the destination surface in a blit.
*
* \c rect must be a pointer to a valid rectangle which will be filled
* with the correct values.
*/
extern
DECLSPEC
void
SDLCALL
SDL_GetClipRect
(
SDL_Surface
*
surface
,
SDL_Rect
*
rect
);
/**
* Creates a new surface of the specified format, and then copies and maps
* the given surface to it so the blit of the converted surface will be as
* fast as possible. If this function fails, it returns NULL.
*
* The \c flags parameter is passed to SDL_CreateRGBSurface() and has those
* semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and
* SDL will try to RLE accelerate colorkey and alpha blits in the resulting
* surface.
*/
extern
DECLSPEC
SDL_Surface
*
SDLCALL
SDL_ConvertSurface
(
SDL_Surface
*
src
,
SDL_PixelFormat
*
fmt
,
Uint32
flags
);
/**
* \brief Copy a block of pixels of one format to another format
*/
extern
DECLSPEC
int
SDLCALL
SDL_ConvertPixels
(
int
width
,
int
height
,
Uint32
src_format
,
const
void
*
src
,
int
src_pitch
,
Uint32
dst_format
,
void
*
dst
,
int
dst_pitch
);
/**
* Draws a point with \c color.
*
* The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
*
* \return 0 on success, or -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_DrawPoint
(
SDL_Surface
*
dst
,
int
x
,
int
y
,
Uint32
color
);
extern
DECLSPEC
int
SDLCALL
SDL_DrawPoints
(
SDL_Surface
*
dst
,
const
SDL_Point
*
points
,
int
count
,
Uint32
color
);
/**
* Blends a point with an RGBA value.
*
* \return 0 on success, or -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_BlendPoint
(
SDL_Surface
*
dst
,
int
x
,
int
y
,
int
blendMode
,
Uint8
r
,
Uint8
g
,
Uint8
b
,
Uint8
a
);
extern
DECLSPEC
int
SDLCALL
SDL_BlendPoints
(
SDL_Surface
*
dst
,
const
SDL_Point
*
points
,
int
count
,
int
blendMode
,
Uint8
r
,
Uint8
g
,
Uint8
b
,
Uint8
a
);
/**
* Draws a line with \c color.
*
* The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
*
* \return 0 on success, or -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_DrawLine
(
SDL_Surface
*
dst
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
Uint32
color
);
extern
DECLSPEC
int
SDLCALL
SDL_DrawLines
(
SDL_Surface
*
dst
,
const
SDL_Point
*
points
,
int
count
,
Uint32
color
);
/**
* Blends an RGBA value along a line.
*
* \return 0 on success, or -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_BlendLine
(
SDL_Surface
*
dst
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
blendMode
,
Uint8
r
,
Uint8
g
,
Uint8
b
,
Uint8
a
);
extern
DECLSPEC
int
SDLCALL
SDL_BlendLines
(
SDL_Surface
*
dst
,
const
SDL_Point
*
points
,
int
count
,
int
blendMode
,
Uint8
r
,
Uint8
g
,
Uint8
b
,
Uint8
a
);
/**
* Draws the given rectangle with \c color.
*
* If \c rect is NULL, the whole surface will be outlined with \c color.
*
* The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
*
* \return 0 on success, or -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_DrawRect
(
SDL_Surface
*
dst
,
const
SDL_Rect
*
rect
,
Uint32
color
);
extern
DECLSPEC
int
SDLCALL
SDL_DrawRects
(
SDL_Surface
*
dst
,
const
SDL_Rect
**
rects
,
int
count
,
Uint32
color
);
/**
* Blends an RGBA value into the outline of the given rectangle.
*
* If \c rect is NULL, the whole surface will have a blended outline.
*
* \return 0 on success, or -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_BlendRect
(
SDL_Surface
*
dst
,
const
SDL_Rect
*
rect
,
int
blendMode
,
Uint8
r
,
Uint8
g
,
Uint8
b
,
Uint8
a
);
extern
DECLSPEC
int
SDLCALL
SDL_BlendRects
(
SDL_Surface
*
dst
,
const
SDL_Rect
**
rects
,
int
count
,
int
blendMode
,
Uint8
r
,
Uint8
g
,
Uint8
b
,
Uint8
a
);
/**
* Performs a fast fill of the given rectangle with \c color.
*
* If \c rect is NULL, the whole surface will be filled with \c color.
*
* The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
*
* \return 0 on success, or -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_FillRect
(
SDL_Surface
*
dst
,
const
SDL_Rect
*
rect
,
Uint32
color
);
extern
DECLSPEC
int
SDLCALL
SDL_FillRects
(
SDL_Surface
*
dst
,
const
SDL_Rect
**
rects
,
int
count
,
Uint32
color
);
/**
* Blends an RGBA value into the given rectangle.
*
* If \c rect is NULL, the whole surface will be blended with the color.
*
* \return This function returns 0 on success, or -1 on error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_BlendFillRect
(
SDL_Surface
*
dst
,
const
SDL_Rect
*
rect
,
int
blendMode
,
Uint8
r
,
Uint8
g
,
Uint8
b
,
Uint8
a
);
extern
DECLSPEC
int
SDLCALL
SDL_BlendFillRects
(
SDL_Surface
*
dst
,
const
SDL_Rect
**
rects
,
int
count
,
int
blendMode
,
Uint8
r
,
Uint8
g
,
Uint8
b
,
Uint8
a
);
#if 0
/**
* Draws the given circle with \c color.
*
* The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
*
* \return 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_DrawCircle
(SDL_Surface * dst, int x, int y, int radius, Uint32 color);
/**
* Blends an RGBA value into the outline of the given circle.
*
* \return 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_BlendCircle
(SDL_Surface * dst, int x, int y, int radius,
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
/**
* Fills the given circle with \c color.
*
* The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
*
* \return 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_FillCircle
(SDL_Surface * dst, int x, int y, int radius, Uint32 color);
/**
* Blends an RGBA value into the given circle.
*
* \return This function returns 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_BlendFillCircle
(SDL_Surface * dst, int x, int y, int radius,
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
/**
* Draws the given ellipse with \c color.
*
* The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
*
* \return 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_DrawEllipse
(SDL_Surface * dst, int x, int y, int w, int h, Uint32 color);
/**
* Blends an RGBA value into the outline of the given ellipse.
*
* \return 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_BlendEllipse
(SDL_Surface * dst, int x, int y, int w, int h,
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
/**
* Fills the given ellipse with \c color.
*
* The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
*
* \return 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_FillEllipse
(SDL_Surface * dst, int x, int y, int w, int h, Uint32 color);
/**
* Blends an RGBA value into the given ellipse.
*
* \return This function returns 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_BlendFillEllipse
(SDL_Surface * dst, int x, int y, int w, int h,
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
#endif // 0
/**
* Performs a fast blit from the source surface to the destination surface.
*
* This assumes that the source and destination rectangles are
* the same size. If either \c srcrect or \c dstrect are NULL, the entire
* surface (\c src or \c dst) is copied. The final blit rectangles are saved
* in \c srcrect and \c dstrect after all clipping is performed.
*
* \return If the blit is successful, it returns 0, otherwise it returns -1.
*
* The blit function should not be called on a locked surface.
*
* The blit semantics for surfaces with and without alpha and colorkey
* are defined as follows:
* \verbatim
RGBA->RGB:
SDL_SRCALPHA set:
alpha-blend (using alpha-channel).
SDL_SRCCOLORKEY ignored.
SDL_SRCALPHA not set:
copy RGB.
if SDL_SRCCOLORKEY set, only copy the pixels matching the
RGB values of the source colour key, ignoring alpha in the
comparison.
RGB->RGBA:
SDL_SRCALPHA set:
alpha-blend (using the source per-surface alpha value);
set destination alpha to opaque.
SDL_SRCALPHA not set:
copy RGB, set destination alpha to source per-surface alpha value.
both:
if SDL_SRCCOLORKEY set, only copy the pixels matching the
source colour key.
RGBA->RGBA:
SDL_SRCALPHA set:
alpha-blend (using the source alpha channel) the RGB values;
leave destination alpha untouched. [Note: is this correct?]
SDL_SRCCOLORKEY ignored.
SDL_SRCALPHA not set:
copy all of RGBA to the destination.
if SDL_SRCCOLORKEY set, only copy the pixels matching the
RGB values of the source colour key, ignoring alpha in the
comparison.
RGB->RGB:
SDL_SRCALPHA set:
alpha-blend (using the source per-surface alpha value).
SDL_SRCALPHA not set:
copy RGB.
both:
if SDL_SRCCOLORKEY set, only copy the pixels matching the
source colour key.
\endverbatim
*
* If either of the surfaces were in video memory, and the blit returns -2,
* the video memory was lost, so it should be reloaded with artwork and
* re-blitted:
* @code
* while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
* while ( SDL_LockSurface(image) < 0 )
* Sleep(10);
* -- Write image pixels to image->pixels --
* SDL_UnlockSurface(image);
* }
* @endcode
*
* This happens under DirectX 5.0 when the system switches away from your
* fullscreen application. The lock will also fail until you have access
* to the video memory again.
*
* You should call SDL_BlitSurface() unless you know exactly how SDL
* blitting works internally and how to use the other blit functions.
*/
#define SDL_BlitSurface SDL_UpperBlit
/**
* This is the public blit function, SDL_BlitSurface(), and it performs
* rectangle validation and clipping before passing it to SDL_LowerBlit()
*/
extern
DECLSPEC
int
SDLCALL
SDL_UpperBlit
(
SDL_Surface
*
src
,
SDL_Rect
*
srcrect
,
SDL_Surface
*
dst
,
SDL_Rect
*
dstrect
);
/**
* This is a semi-private blit function and it performs low-level surface
* blitting only.
*/
extern
DECLSPEC
int
SDLCALL
SDL_LowerBlit
(
SDL_Surface
*
src
,
SDL_Rect
*
srcrect
,
SDL_Surface
*
dst
,
SDL_Rect
*
dstrect
);
/**
* \brief Perform a fast, low quality, stretch blit between two surfaces of the
* same pixel format.
*
* \note This function uses a static buffer, and is not thread-safe.
*/
extern
DECLSPEC
int
SDLCALL
SDL_SoftStretch
(
SDL_Surface
*
src
,
const
SDL_Rect
*
srcrect
,
SDL_Surface
*
dst
,
const
SDL_Rect
*
dstrect
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_surface_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_syswm.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_syswm.h
*
* Include file for SDL custom system window manager hooks.
*/
#ifndef _SDL_syswm_h
#define _SDL_syswm_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_video.h"
#include "SDL_version.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* \file SDL_syswm.h
*
* Your application has access to a special type of event ::SDL_SYSWMEVENT,
* which contains window-manager specific information and arrives whenever
* an unhandled window event occurs. This event is ignored by default, but
* you can enable it with SDL_EventState().
*/
#ifdef SDL_PROTOTYPES_ONLY
struct
SDL_SysWMinfo
;
#else
/* This is the structure for custom window manager events */
#if defined(SDL_VIDEO_DRIVER_X11)
#if defined(__APPLE__) && defined(__MACH__)
/* conflicts with Quickdraw.h */
#define Cursor X11Cursor
#endif
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#if defined(__APPLE__) && defined(__MACH__)
/* matches the re-define above */
#undef Cursor
#endif
/**
* These are the various supported subsystems under UNIX.
*/
typedef
enum
{
SDL_SYSWM_X11
}
SDL_SYSWM_TYPE
;
/**
* The UNIX custom event structure.
*/
struct
SDL_SysWMmsg
{
SDL_version
version
;
SDL_SYSWM_TYPE
subsystem
;
union
{
XEvent
xevent
;
}
event
;
};
/**
* The UNIX custom window manager information structure.
*
* When this structure is returned, it holds information about which
* low level system it is using, and will be one of SDL_SYSWM_TYPE.
*/
struct
SDL_SysWMinfo
{
SDL_version
version
;
SDL_SYSWM_TYPE
subsystem
;
union
{
struct
{
Display
*
display
;
/**< The X11 display */
Window
window
;
/**< The X11 display window */
}
x11
;
}
info
;
};
#elif defined(SDL_VIDEO_DRIVER_WIN32)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
/**
* The windows custom event structure.
*/
struct
SDL_SysWMmsg
{
SDL_version
version
;
HWND
hwnd
;
/**< The window for the message */
UINT
msg
;
/**< The type of message */
WPARAM
wParam
;
/**< WORD message parameter */
LPARAM
lParam
;
/**< LONG message parameter */
};
/**
* The windows custom window manager information structure.
*/
struct
SDL_SysWMinfo
{
SDL_version
version
;
HWND
window
;
/**< The Win32 display window */
};
#elif defined(SDL_VIDEO_DRIVER_RISCOS)
/**
* RISC OS custom event structure.
*/
struct
SDL_SysWMmsg
{
SDL_version
version
;
int
eventCode
;
/**< The window for the message */
int
pollBlock
[
64
];
};
/**
* The RISC OS custom window manager information structure.
*/
struct
SDL_SysWMinfo
{
SDL_version
version
;
int
wimpVersion
;
/**< Wimp version running under */
int
taskHandle
;
/**< The RISC OS task handle */
int
window
;
/**< The RISC OS display window */
};
#elif defined(SDL_VIDEO_DRIVER_PHOTON) || defined(SDL_VIDEO_DRIVER_QNXGF)
#include <sys/neutrino.h>
#if defined(SDL_VIDEO_OPENGL_ES)
#include <gf/gf.h>
#endif
/* SDL_VIDEO_OPENGL_ES */
#include <Ph.h>
/**
* The QNX custom event structure.
*/
struct
SDL_SysWMmsg
{
SDL_version
version
;
int
data
;
};
/**
* The QNX Photon custom window manager information structure.
*/
struct
SDL_SysWMinfo
{
SDL_version
version
;
int
data
;
};
#else
/**
* The generic custom event structure.
*/
struct
SDL_SysWMmsg
{
SDL_version
version
;
int
data
;
};
/**
* The generic custom window manager information structure.
*/
struct
SDL_SysWMinfo
{
SDL_version
version
;
int
data
;
};
#endif
/* video driver type */
#endif
/* SDL_PROTOTYPES_ONLY */
typedef
struct
SDL_SysWMinfo
SDL_SysWMinfo
;
/* Function prototypes */
/**
* \brief This function allows access to driver-dependent window information.
*
* \param windowID The window about which information is being requested
* \param info This structure must be initialized with the SDL version, and is
* then filled in with information about the given window.
*
* \return SDL_TRUE if the function is implemented and the version member of
* the \c info struct is valid, SDL_FALSE otherwise.
*
* You typically use this function like this:
* \code
* SDL_SysWMInfo info;
* SDL_VERSION(&info.version);
* if ( SDL_GetWindowWMInfo(&info) ) { ... }
* \endcode
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_GetWindowWMInfo
(
SDL_Window
*
window
,
SDL_SysWMinfo
*
info
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_syswm_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_thread.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_thread_h
#define _SDL_thread_h
/**
* \file SDL_thread.h
*
* Header for the SDL thread management routines.
*/
#include "SDL_stdinc.h"
#include "SDL_error.h"
/* Thread synchronization primitives */
#include "SDL_mutex.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/* The SDL thread structure, defined in SDL_thread.c */
struct
SDL_Thread
;
typedef
struct
SDL_Thread
SDL_Thread
;
/* The SDL thread ID */
typedef
unsigned
long
SDL_threadID
;
#if defined(__WIN32__) && !defined(HAVE_LIBC)
/**
* \file SDL_thread.h
*
* We compile SDL into a DLL. This means, that it's the DLL which
* creates a new thread for the calling process with the SDL_CreateThread()
* API. There is a problem with this, that only the RTL of the SDL.DLL will
* be initialized for those threads, and not the RTL of the calling
* application!
*
* To solve this, we make a little hack here.
*
* We'll always use the caller's _beginthread() and _endthread() APIs to
* start a new thread. This way, if it's the SDL.DLL which uses this API,
* then the RTL of SDL.DLL will be used to create the new thread, and if it's
* the application, then the RTL of the application will be used.
*
* So, in short:
* Always use the _beginthread() and _endthread() of the calling runtime
* library!
*/
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
#ifndef _WIN32_WCE
#include <process.h>
/* This has _beginthread() and _endthread() defined! */
#endif
#ifdef __GNUC__
typedef
unsigned
long
(
__cdecl
*
pfnSDL_CurrentBeginThread
)
(
void
*
,
unsigned
,
unsigned
(
__stdcall
*
func
)
(
void
*
),
void
*
arg
,
unsigned
,
unsigned
*
threadID
);
typedef
void
(
__cdecl
*
pfnSDL_CurrentEndThread
)
(
unsigned
code
);
#else
typedef
uintptr_t
(
__cdecl
*
pfnSDL_CurrentBeginThread
)
(
void
*
,
unsigned
,
unsigned
(
__stdcall
*
func
)
(
void
*
),
void
*
arg
,
unsigned
,
unsigned
*
threadID
);
typedef
void
(
__cdecl
*
pfnSDL_CurrentEndThread
)
(
unsigned
code
);
#endif
/**
* Create a thread.
*/
extern
DECLSPEC
SDL_Thread
*
SDLCALL
SDL_CreateThread
(
int
(
SDLCALL
*
f
)
(
void
*
),
void
*
data
,
pfnSDL_CurrentBeginThread
pfnBeginThread
,
pfnSDL_CurrentEndThread
pfnEndThread
);
#if defined(_WIN32_WCE)
/**
* Create a thread.
*/
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL)
#else
/**
* Create a thread.
*/
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex)
#endif
#else
/**
* Create a thread.
*/
extern
DECLSPEC
SDL_Thread
*
SDLCALL
SDL_CreateThread
(
int
(
SDLCALL
*
fn
)
(
void
*
),
void
*
data
);
#endif
/**
* Get the thread identifier for the current thread.
*/
extern
DECLSPEC
SDL_threadID
SDLCALL
SDL_ThreadID
(
void
);
/**
* Get the thread identifier for the specified thread.
*
* Equivalent to SDL_ThreadID() if the specified thread is NULL.
*/
extern
DECLSPEC
SDL_threadID
SDLCALL
SDL_GetThreadID
(
SDL_Thread
*
thread
);
/**
* Wait for a thread to finish.
*
* The return code for the thread function is placed in the area
* pointed to by \c status, if \c status is not NULL.
*/
extern
DECLSPEC
void
SDLCALL
SDL_WaitThread
(
SDL_Thread
*
thread
,
int
*
status
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_thread_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_timer.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_timer_h
#define _SDL_timer_h
/**
* \file SDL_timer.h
*
* Header for the SDL time management routines.
*/
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* This is the OS scheduler timeslice, in milliseconds.
*/
#define SDL_TIMESLICE 10
/**
* This is the maximum resolution of the SDL timer on all platforms.
*/
#define TIMER_RESOLUTION 10
/**< Experimentally determined */
/**
* Get the number of milliseconds since the SDL library initialization.
*
* Note that this value wraps if the program runs for more than ~49 days.
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_GetTicks
(
void
);
/**
* Wait a specified number of milliseconds before returning.
*/
extern
DECLSPEC
void
SDLCALL
SDL_Delay
(
Uint32
ms
);
/**
* Function prototype for the timer callback function.
*/
typedef
Uint32
(
SDLCALL
*
SDL_TimerCallback
)
(
Uint32
interval
);
/**
* Set a callback to run after the specified number of milliseconds has
* elapsed. The callback function is passed the current timer interval
* and returns the next timer interval. If the returned value is the
* same as the one passed in, the periodic alarm continues, otherwise a
* new alarm is scheduled. If the callback returns 0, the periodic alarm
* is cancelled.
*
* To cancel a currently running timer, call
* \code SDL_SetTimer(0, NULL); \endcode
*
* The timer callback function may run in a different thread than your
* main code, and so shouldn't call any functions from within itself.
*
* The maximum resolution of this timer is 10 ms, which means that if
* you request a 16 ms timer, your callback will run approximately 20 ms
* later on an unloaded system. If you wanted to set a flag signaling
* a frame update at 30 frames per second (every 33 ms), you might set a
* timer for 30 ms:
* \code
* SDL_SetTimer((33/10)*10, flag_update);
* \endcode
*
* If you use this function, you need to pass ::SDL_INIT_TIMER to SDL_Init().
*
* Under UNIX, you should not use raise or use SIGALRM and this function
* in the same program, as it is implemented using setitimer(). You also
* should not use this function in multi-threaded applications as signals
* to multi-threaded apps have undefined behavior in some implementations.
*
* \return 0 if successful, or -1 if there was an error.
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetTimer
(
Uint32
interval
,
SDL_TimerCallback
callback
);
/**
* \name Peter timers
* New timer API, supports multiple timers
* Written by Stephane Peter <megastep@lokigames.com>
*/
/*@{*/
/**
* Function prototype for the new timer callback function.
*
* The callback function is passed the current timer interval and returns
* the next timer interval. If the returned value is the same as the one
* passed in, the periodic alarm continues, otherwise a new alarm is
* scheduled. If the callback returns 0, the periodic alarm is cancelled.
*/
typedef
Uint32
(
SDLCALL
*
SDL_NewTimerCallback
)
(
Uint32
interval
,
void
*
param
);
/**
* Definition of the timer ID type.
*/
typedef
struct
_SDL_TimerID
*
SDL_TimerID
;
/**
* Add a new timer to the pool of timers already running.
* \return A timer ID, or NULL when an error occurs.
*/
extern
DECLSPEC
SDL_TimerID
SDLCALL
SDL_AddTimer
(
Uint32
interval
,
SDL_NewTimerCallback
callback
,
void
*
param
);
/**
* Remove one of the multiple timers knowing its ID.
* \return A boolean value indicating success or failure.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_RemoveTimer
(
SDL_TimerID
t
);
/*@}*//*Peter timers*/
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_timer_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_touch.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_touch.h
*
* Include file for SDL touch event handling.
*/
#ifndef _SDL_touch_h
#define _SDL_touch_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_video.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
struct
SDL_Finger
{
long
id
;
float
x
;
float
y
;
float
xdelta
;
float
ydelta
;
float
last_x
,
last_y
,
last_pressure
;
/* the last reported coordinates */
SDL_bool
down
;
float
pressure
;
};
typedef
struct
SDL_Touch
SDL_Touch
;
typedef
struct
SDL_Finger
SDL_Finger
;
struct
SDL_Touch
{
/* Free the touch when it's time */
void
(
*
FreeTouch
)
(
SDL_Touch
*
touch
);
/* data common for tablets */
float
pressure_max
,
pressure_min
;
float
x_max
,
x_min
;
float
y_max
,
y_min
;
float
xres
,
yres
,
pressureres
;
float
tilt
;
/* for future use */
float
rotation
;
/* for future use */
/* Data common to all touch */
long
id
;
SDL_Window
*
focus
;
char
*
name
;
Uint8
buttonstate
;
SDL_bool
relative_mode
;
SDL_bool
flush_motion
;
int
num_fingers
;
int
max_fingers
;
SDL_Finger
**
fingers
;
void
*
driverdata
;
};
/* Function prototypes */
/**
* \brief Get the touch object at the given id.
*
*
*/
extern
DECLSPEC
SDL_Touch
*
SDLCALL
SDL_GetTouch
(
long
id
);
/**
* \brief Get the finger object of the given touch, at the given id.
*
*
*/
extern
DECLSPEC
SDL_Finger
*
SDLCALL
SDL_GetFinger
(
SDL_Touch
*
touch
,
long
id
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_mouse_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_types.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_types.h
*
* \deprecated
*/
/* DEPRECATED */
#include "SDL_stdinc.h"
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_version.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_version.h
*
* This header defines the current SDL version.
*/
#ifndef _SDL_version_h
#define _SDL_version_h
#include "SDL_stdinc.h"
#include "SDL_revision.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* \brief Information the version of SDL in use.
*
* Represents the library's version as three levels: major revision
* (increments with massive changes, additions, and enhancements),
* minor revision (increments with backwards-compatible changes to the
* major revision), and patchlevel (increments with fixes to the minor
* revision).
*
* \sa SDL_VERSION
* \sa SDL_GetVersion
*/
typedef
struct
SDL_version
{
Uint8
major
;
/**< major version */
Uint8
minor
;
/**< minor version */
Uint8
patch
;
/**< update version */
}
SDL_version
;
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/
#define SDL_MAJOR_VERSION 1
#define SDL_MINOR_VERSION 3
#define SDL_PATCHLEVEL 0
/**
* \brief Macro to determine SDL version program was compiled against.
*
* This macro fills in a SDL_version structure with the version of the
* library you compiled against. This is determined by what header the
* compiler uses. Note that if you dynamically linked the library, you might
* have a slightly newer or older version at runtime. That version can be
* determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
* is not a macro.
*
* \param x A pointer to a SDL_version struct to initialize.
*
* \sa SDL_version
* \sa SDL_GetVersion
*/
#define SDL_VERSION(x) \
{ \
(x)->major = SDL_MAJOR_VERSION; \
(x)->minor = SDL_MINOR_VERSION; \
(x)->patch = SDL_PATCHLEVEL; \
}
/**
* This macro turns the version numbers into a numeric value:
* \verbatim
(1,2,3) -> (1203)
\endverbatim
*
* This assumes that there will never be more than 100 patchlevels.
*/
#define SDL_VERSIONNUM(X, Y, Z) \
((X)*1000 + (Y)*100 + (Z))
/**
* This is the version number macro for the current SDL version.
*/
#define SDL_COMPILEDVERSION \
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
/**
* This macro will evaluate to true if compiled with SDL at least X.Y.Z.
*/
#define SDL_VERSION_ATLEAST(X, Y, Z) \
(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
/**
* \brief Get the version of SDL that is linked against your program.
*
* If you are using a shared library (DLL) version of SDL, then it is
* possible that it will be different than the version you compiled against.
*
* This is a real function; the macro SDL_VERSION() tells you what version
* of SDL you compiled against:
*
* \code
* SDL_version compiled;
* SDL_version linked;
*
* SDL_VERSION(&compiled);
* SDL_GetVersion(&linked);
* printf("We compiled against SDL version %d.%d.%d ...\n",
* compiled.major, compiled.minor, compiled.patch);
* printf("But we linked against SDL version %d.%d.%d.\n",
* linked.major, linked.minor, linked.patch);
* \endcode
*
* This function may be called safely at any time, even before SDL_Init().
*
* \sa SDL_VERSION
*/
extern
DECLSPEC
void
SDLCALL
SDL_GetVersion
(
SDL_version
*
ver
);
/**
* \brief Get the code revision of SDL that is linked against your program.
*
* This is an arbitrary string (a hash value, actually), and is only useful
* in comparing against other revisions. It is NOT an incrementing number.
*/
extern
DECLSPEC
const
char
*
SDLCALL
SDL_GetRevision
(
void
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_version_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_video.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_video.h
*
* Header file for SDL video functions.
*/
#ifndef _SDL_video_h
#define _SDL_video_h
#include "SDL_stdinc.h"
#include "SDL_pixels.h"
#include "SDL_rect.h"
#include "SDL_surface.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern
"C"
{
/* *INDENT-ON* */
#endif
/**
* \brief The structure that defines a display mode
*
* \sa SDL_GetNumDisplayModes()
* \sa SDL_GetDisplayMode()
* \sa SDL_GetDesktopDisplayMode()
* \sa SDL_GetCurrentDisplayMode()
* \sa SDL_GetClosestDisplayMode()
* \sa SDL_SetWindowDisplayMode()
* \sa SDL_GetWindowDisplayMode()
*/
typedef
struct
{
Uint32
format
;
/**< pixel format */
int
w
;
/**< width */
int
h
;
/**< height */
int
refresh_rate
;
/**< refresh rate (or zero for unspecified) */
void
*
driverdata
;
/**< driver-specific data, initialize to 0 */
}
SDL_DisplayMode
;
/**
* \brief The type used to identify a window
*
* \sa SDL_CreateWindow()
* \sa SDL_CreateWindowFrom()
* \sa SDL_DestroyWindow()
* \sa SDL_GetWindowData()
* \sa SDL_GetWindowFlags()
* \sa SDL_GetWindowGrab()
* \sa SDL_GetWindowPosition()
* \sa SDL_GetWindowSize()
* \sa SDL_GetWindowTitle()
* \sa SDL_HideWindow()
* \sa SDL_MaximizeWindow()
* \sa SDL_MinimizeWindow()
* \sa SDL_RaiseWindow()
* \sa SDL_RestoreWindow()
* \sa SDL_SetWindowData()
* \sa SDL_SetWindowFullscreen()
* \sa SDL_SetWindowGrab()
* \sa SDL_SetWindowIcon()
* \sa SDL_SetWindowPosition()
* \sa SDL_SetWindowSize()
* \sa SDL_SetWindowTitle()
* \sa SDL_ShowWindow()
*/
typedef
struct
SDL_Window
SDL_Window
;
/**
* \brief The flags on a window
*
* \sa SDL_GetWindowFlags()
*/
typedef
enum
{
SDL_WINDOW_FULLSCREEN
=
0x00000001
,
/**< fullscreen window, implies borderless */
SDL_WINDOW_OPENGL
=
0x00000002
,
/**< window usable with OpenGL context */
SDL_WINDOW_SHOWN
=
0x00000004
,
/**< window is visible */
SDL_WINDOW_BORDERLESS
=
0x00000008
,
/**< no window decoration */
SDL_WINDOW_RESIZABLE
=
0x00000010
,
/**< window can be resized */
SDL_WINDOW_MINIMIZED
=
0x00000020
,
/**< window is minimized */
SDL_WINDOW_MAXIMIZED
=
0x00000040
,
/**< window is maximized */
SDL_WINDOW_INPUT_GRABBED
=
0x00000100
,
/**< window has grabbed input focus */
SDL_WINDOW_INPUT_FOCUS
=
0x00000200
,
/**< window has input focus */
SDL_WINDOW_MOUSE_FOCUS
=
0x00000400
,
/**< window has mouse focus */
SDL_WINDOW_FOREIGN
=
0x00000800
/**< window not created by SDL */
}
SDL_WindowFlags
;
/**
* \brief Used to indicate that you don't care what the window position is.
*/
#define SDL_WINDOWPOS_UNDEFINED 0x7FFFFFF
/**
* \brief Used to indicate that the window position should be centered.
*/
#define SDL_WINDOWPOS_CENTERED 0x7FFFFFE
/**
* \brief Event subtype for window events
*/
typedef
enum
{
SDL_WINDOWEVENT_NONE
,
/**< Never used */
SDL_WINDOWEVENT_SHOWN
,
/**< Window has been shown */
SDL_WINDOWEVENT_HIDDEN
,
/**< Window has been hidden */
SDL_WINDOWEVENT_EXPOSED
,
/**< Window has been exposed and should be
redrawn */
SDL_WINDOWEVENT_MOVED
,
/**< Window has been moved to data1, data2
*/
SDL_WINDOWEVENT_RESIZED
,
/**< Window size changed to data1xdata2 */
SDL_WINDOWEVENT_MINIMIZED
,
/**< Window has been minimized */
SDL_WINDOWEVENT_MAXIMIZED
,
/**< Window has been maximized */
SDL_WINDOWEVENT_RESTORED
,
/**< Window has been restored to normal size
and position */
SDL_WINDOWEVENT_ENTER
,
/**< Window has gained mouse focus */
SDL_WINDOWEVENT_LEAVE
,
/**< Window has lost mouse focus */
SDL_WINDOWEVENT_FOCUS_GAINED
,
/**< Window has gained keyboard focus */
SDL_WINDOWEVENT_FOCUS_LOST
,
/**< Window has lost keyboard focus */
SDL_WINDOWEVENT_CLOSE
/**< The window manager requests that the
window be closed */
}
SDL_WindowEventID
;
/**
* \brief Flags used when creating a rendering context
*/
typedef
enum
{
SDL_RENDERER_SINGLEBUFFER
=
0x00000001
,
/**< Render directly to the
window, if possible */
SDL_RENDERER_PRESENTCOPY
=
0x00000002
,
/**< Present uses a copy from
back buffer to the front
buffer */
SDL_RENDERER_PRESENTFLIP2
=
0x00000004
,
/**< Present uses a flip,
swapping back buffer and
front buffer */
SDL_RENDERER_PRESENTFLIP3
=
0x00000008
,
/**< Present uses a flip,
rotating between two back
buffers and a front buffer
*/
SDL_RENDERER_PRESENTDISCARD
=
0x00000010
,
/**< Present leaves the contents
of the backbuffer undefined
*/
SDL_RENDERER_PRESENTVSYNC
=
0x00000020
,
/**< Present is synchronized
with the refresh rate */
SDL_RENDERER_ACCELERATED
=
0x00000040
/**< The renderer uses hardware
acceleration */
}
SDL_RendererFlags
;
/**
* \brief Information on the capabilities of a render driver or context.
*/
typedef
struct
SDL_RendererInfo
{
const
char
*
name
;
/**< The name of the renderer */
Uint32
flags
;
/**< Supported ::SDL_RendererFlags */
Uint32
mod_modes
;
/**< A mask of supported channel modulation */
Uint32
blend_modes
;
/**< A mask of supported blend modes */
Uint32
scale_modes
;
/**< A mask of supported scale modes */
Uint32
num_texture_formats
;
/**< The number of available texture formats */
Uint32
texture_formats
[
20
];
/**< The available texture formats */
int
max_texture_width
;
/**< The maximimum texture width */
int
max_texture_height
;
/**< The maximimum texture height */
}
SDL_RendererInfo
;
/**
* \brief The access pattern allowed for a texture.
*/
typedef
enum
{
SDL_TEXTUREACCESS_STATIC
,
/**< Changes rarely, not lockable */
SDL_TEXTUREACCESS_STREAMING
/**< Changes frequently, lockable */
}
SDL_TextureAccess
;
/**
* \brief The texture channel modulation used in SDL_RenderCopy().
*/
typedef
enum
{
SDL_TEXTUREMODULATE_NONE
=
0x00000000
,
/**< No modulation */
SDL_TEXTUREMODULATE_COLOR
=
0x00000001
,
/**< srcC = srcC * color */
SDL_TEXTUREMODULATE_ALPHA
=
0x00000002
/**< srcA = srcA * alpha */
}
SDL_TextureModulate
;
/**
* \brief The blend mode used in SDL_RenderCopy() and drawing operations.
*/
typedef
enum
{
SDL_BLENDMODE_NONE
=
0x00000000
,
/**< No blending */
SDL_BLENDMODE_MASK
=
0x00000001
,
/**< dst = A ? src : dst
(alpha is mask) */
SDL_BLENDMODE_BLEND
=
0x00000002
,
/**< dst = (src * A) + (dst * (1-A)) */
SDL_BLENDMODE_ADD
=
0x00000004
,
/**< dst = (src * A) + dst */
SDL_BLENDMODE_MOD
=
0x00000008
/**< dst = src * dst */
}
SDL_BlendMode
;
/**
* \brief The texture scale mode used in SDL_RenderCopy().
*/
typedef
enum
{
SDL_TEXTURESCALEMODE_NONE
=
0x00000000
,
/**< No scaling, rectangles must
match dimensions */
SDL_TEXTURESCALEMODE_FAST
=
0x00000001
,
/**< Point sampling or
equivalent algorithm */
SDL_TEXTURESCALEMODE_SLOW
=
0x00000002
,
/**< Linear filtering or
equivalent algorithm */
SDL_TEXTURESCALEMODE_BEST
=
0x00000004
/**< Bicubic filtering or
equivalent algorithm */
}
SDL_TextureScaleMode
;
/**
* \brief An efficient driver-specific representation of pixel data
*/
struct
SDL_Texture
;
typedef
struct
SDL_Texture
SDL_Texture
;
/**
* \brief An opaque handle to an OpenGL context.
*/
typedef
void
*
SDL_GLContext
;
/**
* \brief OpenGL configuration attributes
*/
typedef
enum
{
SDL_GL_RED_SIZE
,
SDL_GL_GREEN_SIZE
,
SDL_GL_BLUE_SIZE
,
SDL_GL_ALPHA_SIZE
,
SDL_GL_BUFFER_SIZE
,
SDL_GL_DOUBLEBUFFER
,
SDL_GL_DEPTH_SIZE
,
SDL_GL_STENCIL_SIZE
,
SDL_GL_ACCUM_RED_SIZE
,
SDL_GL_ACCUM_GREEN_SIZE
,
SDL_GL_ACCUM_BLUE_SIZE
,
SDL_GL_ACCUM_ALPHA_SIZE
,
SDL_GL_STEREO
,
SDL_GL_MULTISAMPLEBUFFERS
,
SDL_GL_MULTISAMPLESAMPLES
,
SDL_GL_ACCELERATED_VISUAL
,
SDL_GL_RETAINED_BACKING
,
SDL_GL_CONTEXT_MAJOR_VERSION
,
SDL_GL_CONTEXT_MINOR_VERSION
}
SDL_GLattr
;
/* Function prototypes */
/**
* \brief Get the number of video drivers compiled into SDL
*
* \sa SDL_GetVideoDriver()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetNumVideoDrivers
(
void
);
/**
* \brief Get the name of a built in video driver.
*
* \note The video drivers are presented in the order in which they are
* normally checked during initialization.
*
* \sa SDL_GetNumVideoDrivers()
*/
extern
DECLSPEC
const
char
*
SDLCALL
SDL_GetVideoDriver
(
int
index
);
/**
* \brief Initialize the video subsystem, optionally specifying a video driver.
*
* \param driver_name Initialize a specific driver by name, or NULL for the
* default video driver.
*
* \param flags FIXME: Still needed?
*
* \return 0 on success, -1 on error
*
* This function initializes the video subsystem; setting up a connection
* to the window manager, etc, and determines the available display modes
* and pixel formats, but does not initialize a window or graphics mode.
*
* \sa SDL_VideoQuit()
*/
extern
DECLSPEC
int
SDLCALL
SDL_VideoInit
(
const
char
*
driver_name
,
Uint32
flags
);
/**
* \brief Shuts down the video subsystem.
*
* This function closes all windows, and restores the original video mode.
*
* \sa SDL_VideoInit()
*/
extern
DECLSPEC
void
SDLCALL
SDL_VideoQuit
(
void
);
/**
* \brief Returns the name of the currently initialized video driver.
*
* \return The name of the current video driver or NULL if no driver
* has been initialized
*
* \sa SDL_GetNumVideoDrivers()
* \sa SDL_GetVideoDriver()
*/
extern
DECLSPEC
const
char
*
SDLCALL
SDL_GetCurrentVideoDriver
(
void
);
/**
* \brief Returns the number of available video displays.
*
* \sa SDL_GetDisplayBounds()
* \sa SDL_SelectVideoDisplay()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetNumVideoDisplays
(
void
);
/**
* \brief Get the desktop area represented by a display, with the primary
* display located at 0,0
*
* \return 0 on success, or -1 if the index is out of range.
*
* \sa SDL_GetNumVideoDisplays()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetDisplayBounds
(
int
index
,
SDL_Rect
*
rect
);
/**
* \brief Set the index of the currently selected display.
*
* \return 0 on success, or -1 if the index is out of range.
*
* \sa SDL_GetNumVideoDisplays()
* \sa SDL_GetCurrentVideoDisplay()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SelectVideoDisplay
(
int
index
);
/**
* \brief Get the index of the currently selected display.
*
* \return The index of the currently selected display.
*
* \sa SDL_GetNumVideoDisplays()
* \sa SDL_SelectVideoDisplay()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetCurrentVideoDisplay
(
void
);
/**
* \brief Returns the number of available display modes for the current display.
*
* \sa SDL_GetDisplayMode()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetNumDisplayModes
(
void
);
/**
* \brief Fill in information about a specific display mode.
*
* \note The display modes are sorted in this priority:
* \li bits per pixel -> more colors to fewer colors
* \li width -> largest to smallest
* \li height -> largest to smallest
* \li refresh rate -> highest to lowest
*
* \sa SDL_GetNumDisplayModes()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetDisplayMode
(
int
index
,
SDL_DisplayMode
*
mode
);
/**
* \brief Fill in information about the desktop display mode for the current
* display.
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetDesktopDisplayMode
(
SDL_DisplayMode
*
mode
);
/**
* \brief Fill in information about the current display mode.
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetCurrentDisplayMode
(
SDL_DisplayMode
*
mode
);
/**
* \brief Get the closest match to the requested display mode.
*
* \param mode The desired display mode
* \param closest A pointer to a display mode to be filled in with the closest
* match of the available display modes.
*
* \return The passed in value \c closest, or NULL if no matching video mode
* was available.
*
* The available display modes are scanned, and \c closest is filled in with the
* closest mode matching the requested mode and returned. The mode format and
* refresh_rate default to the desktop mode if they are 0. The modes are
* scanned with size being first priority, format being second priority, and
* finally checking the refresh_rate. If all the available modes are too
* small, then NULL is returned.
*
* \sa SDL_GetNumDisplayModes()
* \sa SDL_GetDisplayMode()
*/
extern
DECLSPEC
SDL_DisplayMode
*
SDLCALL
SDL_GetClosestDisplayMode
(
const
SDL_DisplayMode
*
mode
,
SDL_DisplayMode
*
closest
);
/**
* \brief Set the display mode used when a fullscreen window is visible
* on the currently selected display. By default the window's
* dimensions and the desktop format and refresh rate are used.
*
* \param mode The mode to use, or NULL for the default mode.
*
* \return 0 on success, or -1 if setting the display mode failed.
*
* \sa SDL_GetWindowDisplayMode()
* \sa SDL_SetWindowFullscreen()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetWindowDisplayMode
(
SDL_Window
*
window
,
const
SDL_DisplayMode
*
mode
);
/**
* \brief Fill in information about the display mode used when a fullscreen
* window is visible on the currently selected display.
*
* \sa SDL_SetWindowDisplayMode()
* \sa SDL_SetWindowFullscreen()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetWindowDisplayMode
(
SDL_Window
*
window
,
SDL_DisplayMode
*
mode
);
/**
* \brief Set the palette entries for indexed display modes.
*
* \return 0 on success, or -1 if the display mode isn't palettized or the
* colors couldn't be set.
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetDisplayPalette
(
const
SDL_Color
*
colors
,
int
firstcolor
,
int
ncolors
);
/**
* \brief Gets the palette entries for indexed display modes.
*
* \return 0 on success, or -1 if the display mode isn't palettized
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetDisplayPalette
(
SDL_Color
*
colors
,
int
firstcolor
,
int
ncolors
);
/**
* \brief Set the gamma correction for each of the color channels on the
* currently selected display.
*
* \return 0 on success, or -1 if setting the gamma isn't supported.
*
* \sa SDL_SetGammaRamp()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetGamma
(
float
red
,
float
green
,
float
blue
);
/**
* \brief Set the gamma ramp for the currently selected display.
*
* \param red The translation table for the red channel, or NULL.
* \param green The translation table for the green channel, or NULL.
* \param blue The translation table for the blue channel, or NULL.
*
* \return 0 on success, or -1 if gamma ramps are unsupported.
*
* Set the gamma translation table for the red, green, and blue channels
* of the video hardware. Each table is an array of 256 16-bit quantities,
* representing a mapping between the input and output for that channel.
* The input is the index into the array, and the output is the 16-bit
* gamma value at that index, scaled to the output color precision.
*
* \sa SDL_GetGammaRamp()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetGammaRamp
(
const
Uint16
*
red
,
const
Uint16
*
green
,
const
Uint16
*
blue
);
/**
* \brief Get the gamma ramp for the currently selected display.
*
* \param red A pointer to a 256 element array of 16-bit quantities to hold
* the translation table for the red channel, or NULL.
* \param green A pointer to a 256 element array of 16-bit quantities to hold
* the translation table for the green channel, or NULL.
* \param blue A pointer to a 256 element array of 16-bit quantities to hold
* the translation table for the blue channel, or NULL.
*
* \return 0 on success, or -1 if gamma ramps are unsupported.
*
* \sa SDL_SetGammaRamp()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetGammaRamp
(
Uint16
*
red
,
Uint16
*
green
,
Uint16
*
blue
);
/**
* \brief Create a window with the specified position, dimensions, and flags.
*
* \param title The title of the window, in UTF-8 encoding.
* \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
* ::SDL_WINDOWPOS_UNDEFINED.
* \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
* ::SDL_WINDOWPOS_UNDEFINED.
* \param w The width of the window.
* \param h The height of the window.
* \param flags The flags for the window, a mask of any of the following:
* ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL,
* ::SDL_WINDOW_SHOWN, ::SDL_WINDOW_BORDERLESS,
* ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED,
* ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED.
*
* \return The id of the window created, or zero if window creation failed.
*
* \sa SDL_DestroyWindow()
*/
extern
DECLSPEC
SDL_Window
*
SDLCALL
SDL_CreateWindow
(
const
char
*
title
,
int
x
,
int
y
,
int
w
,
int
h
,
Uint32
flags
);
/**
* \brief Create an SDL window from an existing native window.
*
* \param data A pointer to driver-dependent window creation data
*
* \return The id of the window created, or zero if window creation failed.
*
* \sa SDL_DestroyWindow()
*/
extern
DECLSPEC
SDL_Window
*
SDLCALL
SDL_CreateWindowFrom
(
const
void
*
data
);
/**
* \brief Get the numeric ID of the window, for logging purposes.
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_GetWindowID
(
SDL_Window
*
window
);
/**
* \brief Get a window from a stored ID, or NULL if it doesn't exist.
*/
extern
DECLSPEC
SDL_Window
*
SDLCALL
SDL_GetWindowFromID
(
Uint32
id
);
/**
* \brief Get the window flags.
*/
extern
DECLSPEC
Uint32
SDLCALL
SDL_GetWindowFlags
(
SDL_Window
*
window
);
/**
* \brief Set the title of the window, in UTF-8 format.
*
* \sa SDL_GetWindowTitle()
*/
extern
DECLSPEC
void
SDLCALL
SDL_SetWindowTitle
(
SDL_Window
*
window
,
const
char
*
title
);
/**
* \brief Get the title of the window, in UTF-8 format.
*
* \sa SDL_SetWindowTitle()
*/
extern
DECLSPEC
const
char
*
SDLCALL
SDL_GetWindowTitle
(
SDL_Window
*
window
);
/**
* \brief Set the icon of the window.
*
* \param icon The icon for the window.
*/
extern
DECLSPEC
void
SDLCALL
SDL_SetWindowIcon
(
SDL_Window
*
window
,
SDL_Surface
*
icon
);
/**
* \brief Associate an arbitrary pointer with the window.
*
* \sa SDL_GetWindowData()
*/
extern
DECLSPEC
void
SDLCALL
SDL_SetWindowData
(
SDL_Window
*
window
,
void
*
userdata
);
/**
* \brief Retrieve the data pointer associated with the window.
*
* \sa SDL_SetWindowData()
*/
extern
DECLSPEC
void
*
SDLCALL
SDL_GetWindowData
(
SDL_Window
*
window
);
/**
* \brief Set the position of the window.
*
* \param window The window to reposition.
* \param x The x coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or
::SDL_WINDOWPOS_UNDEFINED.
* \param y The y coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or
::SDL_WINDOWPOS_UNDEFINED.
*
* \note The window coordinate origin is the upper left of the display.
*
* \sa SDL_GetWindowPosition()
*/
extern
DECLSPEC
void
SDLCALL
SDL_SetWindowPosition
(
SDL_Window
*
window
,
int
x
,
int
y
);
/**
* \brief Get the position of the window.
*
* \sa SDL_SetWindowPosition()
*/
extern
DECLSPEC
void
SDLCALL
SDL_GetWindowPosition
(
SDL_Window
*
window
,
int
*
x
,
int
*
y
);
/**
* \brief Set the size of the window's client area.
*
* \note You can't change the size of a fullscreen window, it automatically
* matches the size of the display mode.
*
* \sa SDL_GetWindowSize()
*/
extern
DECLSPEC
void
SDLCALL
SDL_SetWindowSize
(
SDL_Window
*
window
,
int
w
,
int
h
);
/**
* \brief Get the size of the window's client area.
*
* \sa SDL_SetWindowSize()
*/
extern
DECLSPEC
void
SDLCALL
SDL_GetWindowSize
(
SDL_Window
*
window
,
int
*
w
,
int
*
h
);
/**
* \brief Show the window.
*
* \sa SDL_HideWindow()
*/
extern
DECLSPEC
void
SDLCALL
SDL_ShowWindow
(
SDL_Window
*
window
);
/**
* \brief Hide the window.
*
* \sa SDL_ShowWindow()
*/
extern
DECLSPEC
void
SDLCALL
SDL_HideWindow
(
SDL_Window
*
window
);
/**
* \brief Raise the window above other windows and set the input focus.
*/
extern
DECLSPEC
void
SDLCALL
SDL_RaiseWindow
(
SDL_Window
*
window
);
/**
* \brief Make the window as large as possible.
*
* \sa SDL_RestoreWindow()
*/
extern
DECLSPEC
void
SDLCALL
SDL_MaximizeWindow
(
SDL_Window
*
window
);
/**
* \brief Minimize the window to an iconic representation.
*
* \sa SDL_RestoreWindow()
*/
extern
DECLSPEC
void
SDLCALL
SDL_MinimizeWindow
(
SDL_Window
*
window
);
/**
* \brief Restore the size and position of a minimized or maximized window.
*
* \sa SDL_MaximizeWindow()
* \sa SDL_MinimizeWindow()
*/
extern
DECLSPEC
void
SDLCALL
SDL_RestoreWindow
(
SDL_Window
*
window
);
/**
* \brief Set the window's fullscreen state.
*
* \return 0 on success, or -1 if setting the display mode failed.
*
* \sa SDL_SetWindowDisplayMode()
* \sa SDL_GetWindowDisplayMode()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetWindowFullscreen
(
SDL_Window
*
window
,
int
fullscreen
);
/**
* \brief Set the window's input grab mode.
*
* \param mode This is 1 to grab input, and 0 to release input.
*
* \sa SDL_GetWindowGrab()
*/
extern
DECLSPEC
void
SDLCALL
SDL_SetWindowGrab
(
SDL_Window
*
window
,
int
mode
);
/**
* \brief Get the window's input grab mode.
*
* \return This returns 1 if input is grabbed, and 0 otherwise.
*
* \sa SDL_SetWindowGrab()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetWindowGrab
(
SDL_Window
*
window
);
/**
* \brief Get driver specific information about a window.
*
* \note Include SDL_syswm.h for the declaration of SDL_SysWMinfo.
*/
struct
SDL_SysWMinfo
;
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_GetWindowWMInfo
(
SDL_Window
*
window
,
struct
SDL_SysWMinfo
*
info
);
/**
* \brief Destroy a window.
*/
extern
DECLSPEC
void
SDLCALL
SDL_DestroyWindow
(
SDL_Window
*
window
);
/**
* \brief Get the number of 2D rendering drivers available for the current
* display.
*
* A render driver is a set of code that handles rendering and texture
* management on a particular display. Normally there is only one, but
* some drivers may have several available with different capabilities.
*
* \sa SDL_GetRenderDriverInfo()
* \sa SDL_CreateRenderer()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetNumRenderDrivers
(
void
);
/**
* \brief Get information about a specific 2D rendering driver for the current
* display.
*
* \param index The index of the driver to query information about.
* \param info A pointer to an SDL_RendererInfo struct to be filled with
* information on the rendering driver.
*
* \return 0 on success, -1 if the index was out of range.
*
* \sa SDL_CreateRenderer()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetRenderDriverInfo
(
int
index
,
SDL_RendererInfo
*
info
);
/**
* \brief Create and make active a 2D rendering context for a window.
*
* \param window The window where rendering is displayed.
* \param index The index of the rendering driver to initialize, or -1 to
* initialize the first one supporting the requested flags.
* \param flags ::SDL_RendererFlags.
*
* \return 0 on success, -1 if there was an error creating the renderer.
*
* \sa SDL_SelectRenderer()
* \sa SDL_GetRendererInfo()
* \sa SDL_DestroyRenderer()
*/
extern
DECLSPEC
int
SDLCALL
SDL_CreateRenderer
(
SDL_Window
*
window
,
int
index
,
Uint32
flags
);
/**
* \brief Select the rendering context for a particular window.
*
* \return 0 on success, -1 if the selected window doesn't have a
* rendering context.
*/
extern
DECLSPEC
int
SDLCALL
SDL_SelectRenderer
(
SDL_Window
*
window
);
/**
* \brief Get information about the current rendering context.
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetRendererInfo
(
SDL_RendererInfo
*
info
);
/**
* \brief Create a texture for the current rendering context.
*
* \param format The format of the texture.
* \param access One of the enumerated values in ::SDL_TextureAccess.
* \param w The width of the texture in pixels.
* \param h The height of the texture in pixels.
*
* \return The created texture is returned, or 0 if no rendering context was
* active, the format was unsupported, or the width or height were out
* of range.
*
* \sa SDL_QueryTexture()
* \sa SDL_DestroyTexture()
*/
extern
DECLSPEC
SDL_Texture
*
SDLCALL
SDL_CreateTexture
(
Uint32
format
,
int
access
,
int
w
,
int
h
);
/**
* \brief Create a texture from an existing surface.
*
* \param format The format of the texture, or 0 to pick an appropriate format.
* \param surface The surface containing pixel data used to fill the texture.
*
* \return The created texture is returned, or 0 if no rendering context was
* active, the format was unsupported, or the surface width or height
* were out of range.
*
* \note The surface is not modified or freed by this function.
*
* \sa SDL_QueryTexture()
* \sa SDL_DestroyTexture()
*/
extern
DECLSPEC
SDL_Texture
*
SDLCALL
SDL_CreateTextureFromSurface
(
Uint32
format
,
SDL_Surface
*
surface
);
/**
* \brief Query the attributes of a texture
*
* \param texture A texture to be queried.
* \param format A pointer filled in with the raw format of the texture. The
* actual format may differ, but pixel transfers will use this
* format.
* \param access A pointer filled in with the actual access to the texture.
* \param w A pointer filled in with the width of the texture in pixels.
* \param h A pointer filled in with the height of the texture in pixels.
*
* \return 0 on success, or -1 if the texture is not valid.
*/
extern
DECLSPEC
int
SDLCALL
SDL_QueryTexture
(
SDL_Texture
*
texture
,
Uint32
*
format
,
int
*
access
,
int
*
w
,
int
*
h
);
/**
* \brief Query the pixels of a texture, if the texture does not need to be
* locked for pixel access.
*
* \param texture A texture to be queried, which was created with
* ::SDL_TEXTUREACCESS_STREAMING.
* \param pixels A pointer filled with a pointer to the pixels for the
* texture.
* \param pitch A pointer filled in with the pitch of the pixel data.
*
* \return 0 on success, or -1 if the texture is not valid, or must be locked
* for pixel access.
*/
extern
DECLSPEC
int
SDLCALL
SDL_QueryTexturePixels
(
SDL_Texture
*
texture
,
void
**
pixels
,
int
*
pitch
);
/**
* \brief Set the color palette of an indexed texture.
*
* \param texture The texture to update.
* \param colors The array of RGB color data.
* \param firstcolor The first index to update.
* \param ncolors The number of palette entries to fill with the color data.
*
* \return 0 on success, or -1 if the texture is not valid or not an indexed
* texture.
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetTexturePalette
(
SDL_Texture
*
texture
,
const
SDL_Color
*
colors
,
int
firstcolor
,
int
ncolors
);
/**
* \brief Get the color palette from an indexed texture if it has one.
*
* \param texture The texture to update.
* \param colors The array to fill with RGB color data.
* \param firstcolor The first index to retrieve.
* \param ncolors The number of palette entries to retrieve.
*
* \return 0 on success, or -1 if the texture is not valid or not an indexed
* texture.
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetTexturePalette
(
SDL_Texture
*
texture
,
SDL_Color
*
colors
,
int
firstcolor
,
int
ncolors
);
/**
* \brief Set an additional color value used in render copy operations.
*
* \param texture The texture to update.
* \param r The red source color value multiplied into copy operations.
* \param g The green source color value multiplied into copy operations.
* \param b The blue source color value multiplied into copy operations.
*
* \return 0 on success, or -1 if the texture is not valid or color modulation
* is not supported.
*
* \sa SDL_GetTextureColorMod()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetTextureColorMod
(
SDL_Texture
*
texture
,
Uint8
r
,
Uint8
g
,
Uint8
b
);
/**
* \brief Get the additional color value used in render copy operations.
*
* \param texture The texture to query.
* \param r A pointer filled in with the source red color value.
* \param g A pointer filled in with the source green color value.
* \param b A pointer filled in with the source blue color value.
*
* \return 0 on success, or -1 if the texture is not valid.
*
* \sa SDL_SetTextureColorMod()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetTextureColorMod
(
SDL_Texture
*
texture
,
Uint8
*
r
,
Uint8
*
g
,
Uint8
*
b
);
/**
* \brief Set an additional alpha value used in render copy operations.
*
* \param texture The texture to update.
* \param alpha The source alpha value multiplied into copy operations.
*
* \return 0 on success, or -1 if the texture is not valid or alpha modulation
* is not supported.
*
* \sa SDL_GetTextureAlphaMod()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetTextureAlphaMod
(
SDL_Texture
*
texture
,
Uint8
alpha
);
/**
* \brief Get the additional alpha value used in render copy operations.
*
* \param texture The texture to query.
* \param alpha A pointer filled in with the source alpha value.
*
* \return 0 on success, or -1 if the texture is not valid.
*
* \sa SDL_SetTextureAlphaMod()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetTextureAlphaMod
(
SDL_Texture
*
texture
,
Uint8
*
alpha
);
/**
* \brief Set the blend mode used for texture copy operations.
*
* \param texture The texture to update.
* \param blendMode ::SDL_BlendMode to use for texture blending.
*
* \return 0 on success, or -1 if the texture is not valid or the blend mode is
* not supported.
*
* \note If the blend mode is not supported, the closest supported mode is
* chosen.
*
* \sa SDL_GetTextureBlendMode()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetTextureBlendMode
(
SDL_Texture
*
texture
,
int
blendMode
);
/**
* \brief Get the blend mode used for texture copy operations.
*
* \param texture The texture to query.
* \param blendMode A pointer filled in with the current blend mode.
*
* \return 0 on success, or -1 if the texture is not valid.
*
* \sa SDL_SetTextureBlendMode()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetTextureBlendMode
(
SDL_Texture
*
texture
,
int
*
blendMode
);
/**
* \brief Set the scale mode used for texture copy operations.
*
* \param texture The texture to update.
* \param scaleMode ::SDL_TextureScaleMode to use for texture scaling.
*
* \return 0 on success, or -1 if the texture is not valid or the scale mode is
* not supported.
*
* \note If the scale mode is not supported, the closest supported mode is
* chosen.
*
* \sa SDL_GetTextureScaleMode()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetTextureScaleMode
(
SDL_Texture
*
texture
,
int
scaleMode
);
/**
* \brief Get the scale mode used for texture copy operations.
*
* \param texture The texture to query.
* \param scaleMode A pointer filled in with the current scale mode.
*
* \return 0 on success, or -1 if the texture is not valid.
*
* \sa SDL_SetTextureScaleMode()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetTextureScaleMode
(
SDL_Texture
*
texture
,
int
*
scaleMode
);
/**
* \brief Update the given texture rectangle with new pixel data.
*
* \param texture The texture to update
* \param rect A pointer to the rectangle of pixels to update, or NULL to
* update the entire texture.
* \param pixels The raw pixel data.
* \param pitch The number of bytes between rows of pixel data.
*
* \return 0 on success, or -1 if the texture is not valid.
*
* \note This is a fairly slow function.
*/
extern
DECLSPEC
int
SDLCALL
SDL_UpdateTexture
(
SDL_Texture
*
texture
,
const
SDL_Rect
*
rect
,
const
void
*
pixels
,
int
pitch
);
/**
* \brief Lock a portion of the texture for pixel access.
*
* \param texture The texture to lock for access, which was created with
* ::SDL_TEXTUREACCESS_STREAMING.
* \param rect A pointer to the rectangle to lock for access. If the rect
* is NULL, the entire texture will be locked.
* \param markDirty If this is nonzero, the locked area will be marked dirty
* when the texture is unlocked.
* \param pixels This is filled in with a pointer to the locked pixels,
* appropriately offset by the locked area.
* \param pitch This is filled in with the pitch of the locked pixels.
*
* \return 0 on success, or -1 if the texture is not valid or was created with
* ::SDL_TEXTUREACCESS_STATIC.
*
* \sa SDL_DirtyTexture()
* \sa SDL_UnlockTexture()
*/
extern
DECLSPEC
int
SDLCALL
SDL_LockTexture
(
SDL_Texture
*
texture
,
const
SDL_Rect
*
rect
,
int
markDirty
,
void
**
pixels
,
int
*
pitch
);
/**
* \brief Unlock a texture, uploading the changes to video memory, if needed.
*
* \sa SDL_LockTexture()
* \sa SDL_DirtyTexture()
*/
extern
DECLSPEC
void
SDLCALL
SDL_UnlockTexture
(
SDL_Texture
*
texture
);
/**
* \brief Mark the specified rectangles of the texture as dirty.
*
* \param texture The texture to mark dirty, which was created with
* ::SDL_TEXTUREACCESS_STREAMING.
* \param numrects The number of rectangles pointed to by rects.
* \param rects The pointer to an array of dirty rectangles.
*
* \sa SDL_LockTexture()
* \sa SDL_UnlockTexture()
*/
extern
DECLSPEC
void
SDLCALL
SDL_DirtyTexture
(
SDL_Texture
*
texture
,
int
numrects
,
const
SDL_Rect
*
rects
);
/**
* \brief Set the color used for drawing operations (Fill and Line).
*
* \param r The red value used to draw on the rendering target.
* \param g The green value used to draw on the rendering target.
* \param b The blue value used to draw on the rendering target.
* \param a The alpha value used to draw on the rendering target, usually
* ::SDL_ALPHA_OPAQUE (255).
*
* \return 0 on success, or -1 if there is no rendering context current.
*/
extern
DECLSPEC
int
SDL_SetRenderDrawColor
(
Uint8
r
,
Uint8
g
,
Uint8
b
,
Uint8
a
);
/**
* \brief Get the color used for drawing operations (Fill and Line).
*
* \param r A pointer to the red value used to draw on the rendering target.
* \param g A pointer to the green value used to draw on the rendering target.
* \param b A pointer to the blue value used to draw on the rendering target.
* \param a A pointer to the alpha value used to draw on the rendering target,
* usually ::SDL_ALPHA_OPAQUE (255).
*
* \return 0 on success, or -1 if there is no rendering context current.
*/
extern
DECLSPEC
int
SDL_GetRenderDrawColor
(
Uint8
*
r
,
Uint8
*
g
,
Uint8
*
b
,
Uint8
*
a
);
/**
* \brief Set the blend mode used for drawing operations (Fill and Line).
*
* \param blendMode ::SDL_BlendMode to use for blending.
*
* \return 0 on success, or -1 if there is no rendering context current.
*
* \note If the blend mode is not supported, the closest supported mode is
* chosen.
*
* \sa SDL_GetRenderDrawBlendMode()
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetRenderDrawBlendMode
(
int
blendMode
);
/**
* \brief Get the blend mode used for drawing operations.
*
* \param blendMode A pointer filled in with the current blend mode.
*
* \return 0 on success, or -1 if there is no rendering context current.
*
* \sa SDL_SetRenderDrawBlendMode()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetRenderDrawBlendMode
(
int
*
blendMode
);
/**
* \brief Clear the current rendering target with the drawing color
*/
extern
DECLSPEC
int
SDLCALL
SDL_RenderClear
(
void
);
/**
* \brief Draw a point on the current rendering target.
*
* \param x The x coordinate of the point.
* \param y The y coordinate of the point.
*
* \return 0 on success, or -1 if there is no rendering context current.
*/
extern
DECLSPEC
int
SDLCALL
SDL_RenderDrawPoint
(
int
x
,
int
y
);
/**
* \brief Draw some number of points on the current rendering target.
*
* \param points The points to draw
* \param count The number of points to draw
*
* \return 0 on success, or -1 if there is no rendering context current.
*/
extern
DECLSPEC
int
SDLCALL
SDL_RenderDrawPoints
(
const
SDL_Point
*
points
,
int
count
);
/**
* \brief Draw a line on the current rendering target.
*
* \param x1 The x coordinate of the start point.
* \param y1 The y coordinate of the start point.
* \param x2 The x coordinate of the end point.
* \param y2 The y coordinate of the end point.
*
* \return 0 on success, or -1 if there is no rendering context current.
*/
extern
DECLSPEC
int
SDLCALL
SDL_RenderDrawLine
(
int
x1
,
int
y1
,
int
x2
,
int
y2
);
/**
* \brief Draw a series of connected lines on the current rendering target.
*
* \param points The points along the lines
* \param count The number of points, drawing count-1 lines
*
* \return 0 on success, or -1 if there is no rendering context current.
*/
extern
DECLSPEC
int
SDLCALL
SDL_RenderDrawLines
(
const
SDL_Point
*
points
,
int
count
);
/**
* \brief Draw a rectangle on the current rendering target with the drawing color.
*
* \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
*
* \return 0 on success, or -1 if there is no rendering context current.
*/
extern
DECLSPEC
int
SDLCALL
SDL_RenderDrawRect
(
const
SDL_Rect
*
rect
);
/**
* \brief Draw some number of rectangles in the current rendering target with the drawing color.
*
* \param rects A pointer to an array of destination rectangles.
* \param count The number of rectangles.
*
* \return 0 on success, or -1 if there is no rendering context current.
*/
extern
DECLSPEC
int
SDLCALL
SDL_RenderDrawRects
(
const
SDL_Rect
**
rect
,
int
count
);
/**
* \brief Fill a rectangle on the current rendering target with the drawing color.
*
* \param rect A pointer to the destination rectangle, or NULL for the entire
* rendering target.
*
* \return 0 on success, or -1 if there is no rendering context current.
*/
extern
DECLSPEC
int
SDLCALL
SDL_RenderFillRect
(
const
SDL_Rect
*
rect
);
/**
* \brief Fill some number of rectangles in the current rendering target with the drawing color.
*
* \param rects A pointer to an array of destination rectangles.
* \param count The number of rectangles.
*
* \return 0 on success, or -1 if there is no rendering context current.
*/
extern
DECLSPEC
int
SDLCALL
SDL_RenderFillRects
(
const
SDL_Rect
**
rect
,
int
count
);
/**
* \brief Copy a portion of the texture to the current rendering target.
*
* \param texture The source texture.
* \param srcrect A pointer to the source rectangle, or NULL for the entire
* texture.
* \param dstrect A pointer to the destination rectangle, or NULL for the
* entire rendering target.
*
* \return 0 on success, or -1 if there is no rendering context current, or the
* driver doesn't support the requested operation.
*/
extern
DECLSPEC
int
SDLCALL
SDL_RenderCopy
(
SDL_Texture
*
texture
,
const
SDL_Rect
*
srcrect
,
const
SDL_Rect
*
dstrect
);
/**
* \brief Read pixels from the current rendering target.
*
* \param rect A pointer to the rectangle to read, or NULL for the entire
* render target.
* \param format The desired format of the pixel data, or 0 to use the format
* of the rendering target
* \param pixels A pointer to be filled in with the pixel data
* \param pitch The pitch of the pixels parameter.
*
* \return 0 on success, or -1 if pixel reading is not supported.
*
* \warning This is a very slow operation, and should not be used frequently.
*/
extern
DECLSPEC
int
SDLCALL
SDL_RenderReadPixels
(
const
SDL_Rect
*
rect
,
Uint32
format
,
void
*
pixels
,
int
pitch
);
/**
* \brief Write pixels to the current rendering target.
*
* \param rect A pointer to the rectangle to write, or NULL for the entire
* render target.
* \param format The format of the pixel data, or 0 to use the format
* of the rendering target
* \param pixels A pointer to the pixel data to write.
* \param pitch The pitch of the pixels parameter.
*
* \return 0 on success, or -1 if pixel writing is not supported.
*
* \warning This is a very slow operation, and should not be used frequently.
*/
extern
DECLSPEC
int
SDLCALL
SDL_RenderWritePixels
(
const
SDL_Rect
*
rect
,
Uint32
format
,
const
void
*
pixels
,
int
pitch
);
/**
* \brief Update the screen with rendering performed.
*/
extern
DECLSPEC
void
SDLCALL
SDL_RenderPresent
(
void
);
/**
* \brief Destroy the specified texture.
*
* \sa SDL_CreateTexture()
* \sa SDL_CreateTextureFromSurface()
*/
extern
DECLSPEC
void
SDLCALL
SDL_DestroyTexture
(
SDL_Texture
*
texture
);
/**
* \brief Destroy the rendering context for a window and free associated
* textures.
*
* \sa SDL_CreateRenderer()
*/
extern
DECLSPEC
void
SDLCALL
SDL_DestroyRenderer
(
SDL_Window
*
window
);
/**
* \brief Returns whether the screensaver is currently enabled (default off).
*
* \sa SDL_EnableScreenSaver()
* \sa SDL_DisableScreenSaver()
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_IsScreenSaverEnabled
(
void
);
/**
* \brief Allow the screen to be blanked by a screensaver
*
* \sa SDL_IsScreenSaverEnabled()
* \sa SDL_DisableScreenSaver()
*/
extern
DECLSPEC
void
SDLCALL
SDL_EnableScreenSaver
(
void
);
/**
* \brief Prevent the screen from being blanked by a screensaver
*
* \sa SDL_IsScreenSaverEnabled()
* \sa SDL_EnableScreenSaver()
*/
extern
DECLSPEC
void
SDLCALL
SDL_DisableScreenSaver
(
void
);
/**
* \name OpenGL support functions
*/
/*@{*/
/**
* \brief Dynamically load an OpenGL library.
*
* \param path The platform dependent OpenGL library name, or NULL to open the
* default OpenGL library.
*
* \return 0 on success, or -1 if the library couldn't be loaded.
*
* This should be done after initializing the video driver, but before
* creating any OpenGL windows. If no OpenGL library is loaded, the default
* library will be loaded upon creation of the first OpenGL window.
*
* \note If you do this, you need to retrieve all of the GL functions used in
* your program from the dynamic library using SDL_GL_GetProcAddress().
*
* \sa SDL_GL_GetProcAddress()
* \sa SDL_GL_UnloadLibrary()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GL_LoadLibrary
(
const
char
*
path
);
/**
* \brief Get the address of an OpenGL function.
*/
extern
DECLSPEC
void
*
SDLCALL
SDL_GL_GetProcAddress
(
const
char
*
proc
);
/**
* \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
*
* \sa SDL_GL_LoadLibrary()
*/
extern
DECLSPEC
void
SDLCALL
SDL_GL_UnloadLibrary
(
void
);
/**
* \brief Return true if an OpenGL extension is supported for the current
* context.
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_GL_ExtensionSupported
(
const
char
*
extension
);
/**
* \brief Set an OpenGL window attribute before window creation.
*/
extern
DECLSPEC
int
SDLCALL
SDL_GL_SetAttribute
(
SDL_GLattr
attr
,
int
value
);
/**
* \brief Get the actual value for an attribute from the current context.
*/
extern
DECLSPEC
int
SDLCALL
SDL_GL_GetAttribute
(
SDL_GLattr
attr
,
int
*
value
);
/**
* \brief Create an OpenGL context for use with an OpenGL window, and make it
* current.
*
* \sa SDL_GL_DeleteContext()
*/
extern
DECLSPEC
SDL_GLContext
SDLCALL
SDL_GL_CreateContext
(
SDL_Window
*
window
);
/**
* \brief Set up an OpenGL context for rendering into an OpenGL window.
*
* \note The context must have been created with a compatible window.
*/
extern
DECLSPEC
int
SDLCALL
SDL_GL_MakeCurrent
(
SDL_Window
*
window
,
SDL_GLContext
context
);
/**
* \brief Set the swap interval for the current OpenGL context.
*
* \param interval 0 for immediate updates, 1 for updates synchronized with the
* vertical retrace.
*
* \return 0 on success, or -1 if setting the swap interval is not supported.
*
* \sa SDL_GL_GetSwapInterval()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GL_SetSwapInterval
(
int
interval
);
/**
* \brief Get the swap interval for the current OpenGL context.
*
* \return 0 if there is no vertical retrace synchronization, 1 if the buffer
* swap is synchronized with the vertical retrace, and -1 if getting
* the swap interval is not supported.
*
* \sa SDL_GL_SetSwapInterval()
*/
extern
DECLSPEC
int
SDLCALL
SDL_GL_GetSwapInterval
(
void
);
/**
* \brief Swap the OpenGL buffers for the window, if double-buffering is
* supported.
*/
extern
DECLSPEC
void
SDLCALL
SDL_GL_SwapWindow
(
SDL_Window
*
window
);
/**
* \brief Delete an OpenGL context.
*
* \sa SDL_GL_CreateContext()
*/
extern
DECLSPEC
void
SDLCALL
SDL_GL_DeleteContext
(
SDL_GLContext
context
);
/*@}*//*OpenGL support functions*/
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
/* _SDL_video_h */
/* vi: set ts=4 sw=4 expandtab: */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/begin_code.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file begin_code.h
*
* This file sets things up for C dynamic library function definitions,
* static inlined functions, and structures aligned at 4-byte alignment.
* If you don't like ugly C preprocessor code, don't look at this file. :)
*/
/* This shouldn't be nested -- included it around code only. */
#ifdef _begin_code_h
#error Nested inclusion of begin_code.h
#endif
#define _begin_code_h
/* Some compilers use a special export keyword */
#ifndef DECLSPEC
# if defined(__BEOS__) || defined(__HAIKU__)
# if defined(__GNUC__)
# define DECLSPEC __declspec(dllexport)
# else
# define DECLSPEC __declspec(export)
# endif
# elif defined(__WIN32__)
# ifdef __BORLANDC__
# ifdef BUILD_SDL
# define DECLSPEC
# else
# define DECLSPEC __declspec(dllimport)
# endif
# else
# define DECLSPEC __declspec(dllexport)
# endif
# else
# if defined(__GNUC__) && __GNUC__ >= 4
# define DECLSPEC __attribute__ ((visibility("default")))
# else
# define DECLSPEC
# endif
# endif
#endif
/* By default SDL uses the C calling convention */
#ifndef SDLCALL
#if defined(__WIN32__) && !defined(__GNUC__)
#define SDLCALL __cdecl
#else
#define SDLCALL
#endif
#endif
/* SDLCALL */
/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */
#ifdef __SYMBIAN32__
#undef DECLSPEC
#define DECLSPEC
#endif
/* __SYMBIAN32__ */
/* Force structure packing at 4 byte alignment.
This is necessary if the header is included in code which has structure
packing set to an alternate value, say for loading structures from disk.
The packing is reset to the previous value in close_code.h
*/
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
#ifdef _MSC_VER
#pragma warning(disable: 4103)
#endif
#ifdef __BORLANDC__
#pragma nopackwarning
#endif
#pragma pack(push,4)
#endif
/* Compiler needs structure packing set */
/* Set up compiler-specific options for inlining functions */
#ifndef SDL_INLINE_OKAY
#ifdef __GNUC__
#define SDL_INLINE_OKAY
#else
/* Add any special compiler-specific cases here */
#if defined(_MSC_VER) || defined(__BORLANDC__) || \
defined(__DMC__) || defined(__SC__) || \
defined(__WATCOMC__) || defined(__LCC__) || \
defined(__DECC)
#ifndef __inline__
#define __inline__ __inline
#endif
#define SDL_INLINE_OKAY
#else
#if !defined(__MRC__) && !defined(_SGI_SOURCE)
#ifndef __inline__
#define __inline__ inline
#endif
#define SDL_INLINE_OKAY
#endif
/* Not a funky compiler */
#endif
/* Visual C++ */
#endif
/* GNU C */
#endif
/* SDL_INLINE_OKAY */
/* If inlining isn't supported, remove "__inline__", turning static
inlined functions into static functions (resulting in code bloat
in all files which include the offending header files)
*/
#ifndef SDL_INLINE_OKAY
#define __inline__
#endif
/* Apparently this is needed by several Windows compilers */
#if !defined(__MACH__)
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif
/* NULL */
#endif
/* ! Mac OS X - breaks precompiled headers */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/close_code.h
0 → 100644
View file @
598471cf
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file close_code.h
*
* This file reverses the effects of begin_code.h and should be included
* after you finish any function and structure declarations in your headers
*/
#undef _begin_code_h
/* Reset structure packing at previous byte alignment */
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__)
#ifdef __BORLANDC__
#pragma nopackwarning
#endif
#pragma pack(pop)
#endif
/* Compiler needs structure packing set */
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/doxyfile
0 → 100644
View file @
598471cf
# Doxyfile 1.4.4
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
#
# All text after a hash (#) is considered a comment and will be ignored
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (" ")
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = SDL
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 1.3.0
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = docs
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
# format and will distribute the generated files over these directories.
# Enabling this option can be useful when feeding doxygen a huge amount of
# source files, where putting all generated files in the same directory would
# otherwise cause performance problems for the file system.
CREATE_SUBDIRS = NO
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# The default language is English, other supported languages are:
# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish,
# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese,
# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian,
# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish,
# Swedish, and Ukrainian.
OUTPUT_LANGUAGE = English
# This tag can be used to specify the encoding used in the generated output.
# The encoding is not always determined by the language that is chosen,
# but also whether or not the output is meant for Windows or non-Windows users.
# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
# forces the Windows encoding (this is the default for the Windows binary),
# whereas setting the tag to NO uses a Unix-style encoding (the default for
# all platforms other than Windows).
USE_WINDOWS_ENCODING = NO
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
# include brief member descriptions after the members that are listed in
# the file and class documentation (similar to JavaDoc).
# Set to NO to disable this.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
# the brief description of a member or function before the detailed description.
# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
REPEAT_BRIEF = YES
# This tag implements a quasi-intelligent brief description abbreviator
# that is used to form the text in various listings. Each string
# in this list, if found as the leading text of the brief description, will be
# stripped from the text and the result after processing the whole list, is
# used as the annotated text. Otherwise, the brief description is used as-is.
# If left blank, the following values are used ("$name" is automatically
# replaced with the name of the entity): "The $name class" "The $name widget"
# "The $name file" "is" "provides" "specifies" "contains"
# "represents" "a" "an" "the"
ABBREVIATE_BRIEF =
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# Doxygen will generate a detailed section even if there is only a brief
# description.
ALWAYS_DETAILED_SEC = NO
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
INLINE_INHERITED_MEMB = NO
# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
# path before files name in the file list and in the header files. If set
# to NO the shortest path that makes the file name unique will be used.
FULL_PATH_NAMES = YES
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
# can be used to strip a user-defined part of the path. Stripping is
# only done if one of the specified strings matches the left-hand part of
# the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the
# path to strip.
STRIP_FROM_PATH =
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
# the path mentioned in the documentation of a class, which tells
# the reader which header file to include in order to use a class.
# If left blank only the name of the header file containing the class
# definition is used. Otherwise one should specify the include paths that
# are normally passed to the compiler using the -I flag.
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
# (but less readable) file names. This can be useful is your file systems
# doesn't support long names like on DOS, Mac, or CD-ROM.
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
# comment as the brief description. If set to NO, the JavaDoc
# comments will behave just like the Qt-style comments (thus requiring an
# explicit @brief command for a brief description.
JAVADOC_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
# comments) as a brief description. This used to be the default behaviour.
# The new default is to treat a multi-line C++ comment block as a detailed
# description. Set this tag to YES if you prefer the old behaviour instead.
MULTILINE_CPP_IS_BRIEF = NO
# If the DETAILS_AT_TOP tag is set to YES then Doxygen
# will output the detailed description near the top, like JavaDoc.
# If set to NO, the detailed description appears after the member
# documentation.
DETAILS_AT_TOP = NO
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
# re-implements.
INHERIT_DOCS = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
# a new page for each member. If set to NO, the documentation of a member will
# be part of the file/class/namespace that contains it.
SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 8
# This tag can be used to specify a number of aliases that acts
# as commands in the documentation. An alias has the form "name=value".
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
# put the command \sideeffect (or @sideeffect) in the documentation, which
# will result in a user-defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
ALIASES =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
# For instance, some of the names that are used will be different. The list
# of all members will be omitted, etc.
OPTIMIZE_OUTPUT_FOR_C = YES
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
# only. Doxygen will then generate output that is more tailored for Java.
# For instance, namespaces will be presented as packages, qualified scopes
# will look different, etc.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
# the same type (for instance a group of public functions) to be put as a
# subgroup of that type (e.g. under the Public Functions section). Set it to
# NO to prevent subgrouping. Alternatively, this can be done per class using
# the \nosubgrouping command.
SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available.
# Private class members and static file members will be hidden unless
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = NO
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
EXTRACT_PRIVATE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC = NO
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
# defined locally in source files will be included in the documentation.
# If set to NO only classes defined in header files are included.
EXTRACT_LOCAL_CLASSES = YES
# This flag is only useful for Objective-C code. When set to YES local
# methods, which are defined in the implementation section but not in
# the interface are included in the documentation.
# If set to NO (the default) only methods in the interface are included.
EXTRACT_LOCAL_METHODS = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
# undocumented members of documented classes, files or namespaces.
# If set to NO (the default) these members will be included in the
# various overviews, but no documentation section is generated.
# This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy.
# If set to NO (the default) these classes will be included in the various
# overviews. This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
# friend (class|struct|union) declarations.
# If set to NO (the default) these declarations will be included in the
# documentation.
HIDE_FRIEND_COMPOUNDS = NO
# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
# documentation blocks found inside the body of a function.
# If set to NO (the default) these blocks will be appended to the
# function's detailed documentation block.
HIDE_IN_BODY_DOCS = NO
# The INTERNAL_DOCS tag determines if documentation
# that is typed after a \internal command is included. If the tag is set
# to NO (the default) then the documentation will be excluded.
# Set it to YES to include the internal documentation.
INTERNAL_DOCS = NO
# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
# file names in lower-case letters. If set to YES upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
CASE_SENSE_NAMES = YES
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
# will show members with their full class and namespace scopes in the
# documentation. If set to YES the scope will be hidden.
HIDE_SCOPE_NAMES = NO
# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
# will put a list of the files that are included by a file in the documentation
# of that file.
SHOW_INCLUDE_FILES = YES
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
# is inserted in the documentation for inline members.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
# will sort the (detailed) documentation of file and class members
# alphabetically by member name. If set to NO the members will appear in
# declaration order.
SORT_MEMBER_DOCS = YES
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
# brief documentation of file, namespace and class members alphabetically
# by member name. If set to NO (the default) the members will appear in
# declaration order.
SORT_BRIEF_DOCS = NO
# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
# sorted by fully-qualified names, including namespaces. If set to
# NO (the default), the class list will be sorted only by class name,
# not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
# Note: This option applies only to the class list, not to the
# alphabetical list.
SORT_BY_SCOPE_NAME = NO
# The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
GENERATE_TODOLIST = YES
# The GENERATE_TESTLIST tag can be used to enable (YES) or
# disable (NO) the test list. This list is created by putting \test
# commands in the documentation.
GENERATE_TESTLIST = YES
# The GENERATE_BUGLIST tag can be used to enable (YES) or
# disable (NO) the bug list. This list is created by putting \bug
# commands in the documentation.
GENERATE_BUGLIST = YES
# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
# disable (NO) the deprecated list. This list is created by putting
# \deprecated commands in the documentation.
GENERATE_DEPRECATEDLIST= YES
# The ENABLED_SECTIONS tag can be used to enable conditional
# documentation sections, marked by \if sectionname ... \endif.
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
# the initial value of a variable or define consists of for it to appear in
# the documentation. If the initializer consists of more lines than specified
# here it will be hidden. Use a value of 0 to hide initializers completely.
# The appearance of the initializer of individual variables and defines in the
# documentation can be controlled using \showinitializer or \hideinitializer
# command in the documentation regardless of this setting.
MAX_INITIALIZER_LINES = 30
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
# at the bottom of the documentation of classes and structs. If set to YES the
# list will mention the files that were used to generate the documentation.
SHOW_USED_FILES = YES
# If the sources in your project are distributed over multiple directories
# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
# in the documentation. The default is YES.
SHOW_DIRECTORIES = YES
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from the
# version control system). Doxygen will invoke the program by executing (via
# popen()) the command <command> <input-file>, where <command> is the value of
# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
# provided by doxygen. Whatever the progam writes to standard output
# is used as the file version. See the manual for examples.
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated
# by doxygen. Possible values are YES and NO. If left blank NO is used.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
WARNINGS = YES
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
# automatically be disabled.
WARN_IF_UNDOCUMENTED = YES
# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some
# parameters in a documented function, or documenting parameters that
# don't exist or using markup commands wrongly.
WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be abled to get warnings for
# functions that are documented, but have no documentation for their parameters
# or return value. If set to NO (the default) doxygen will only warn about
# wrong or incomplete parameter documentation, but not about the absence of
# documentation.
WARN_NO_PARAMDOC = NO
# The WARN_FORMAT tag determines the format of the warning messages that
# doxygen can produce. The string should contain the $file, $line, and $text
# tags, which will be replaced by the file and line number from which the
# warning originated and the warning text. Optionally the format may contain
# $version, which will be replaced by the version of the file (if it could
# be obtained via FILE_VERSION_FILTER)
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning
# and error messages should be written. If left blank the output is written
# to stderr.
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag can be used to specify the files and/or directories that contain
# documented source files. You may enter file names like "myfile.cpp" or
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT =
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank the following patterns are tested:
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
FILE_PATTERNS =
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
RECURSIVE = NO
# The EXCLUDE tag can be used to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
# from the input.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories. Note that the wildcards are matched
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
EXCLUDE_PATTERNS =
# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
# the \include command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank all files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude
# commands irrespective of the value of the RECURSIVE tag.
# Possible values are YES and NO. If left blank NO is used.
EXAMPLE_RECURSIVE = NO
# The IMAGE_PATH tag can be used to specify one or more files or
# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command <filter> <input-file>, where <filter>
# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
# input file. Doxygen will then use the output that the filter program writes
# to standard output. If FILTER_PATTERNS is specified, this tag will be
# ignored.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
# filter if there is a match. The filters are a list of the form:
# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
# is applied to all files.
FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will be used to filter the input files when producing source
# files to browse (i.e. when SOURCE_BROWSER is set to YES).
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
# be generated. Documented entities will be cross-referenced with these sources.
# Note: To get rid of all source code in the generated output, make sure also
# VERBATIM_HEADERS is set to NO.
SOURCE_BROWSER = NO
# Setting the INLINE_SOURCES tag to YES will include the body
# of functions and classes directly in the documentation.
INLINE_SOURCES = NO
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
# fragments. Normal C and C++ comments will always remain visible.
STRIP_CODE_COMMENTS = YES
# If the REFERENCED_BY_RELATION tag is set to YES (the default)
# then for each documented function all documented
# functions referencing it will be listed.
REFERENCED_BY_RELATION = YES
# If the REFERENCES_RELATION tag is set to YES (the default)
# then for each documented function all documented entities
# called/used by that function will be listed.
REFERENCES_RELATION = YES
# If the USE_HTAGS tag is set to YES then the references to source code
# will point to the HTML generated by the htags(1) tool instead of doxygen
# built-in source browser. The htags tool is part of GNU's global source
# tagging system (see http://www.gnu.org/software/global/global.html). You
# will need version 4.8.6 or higher.
USE_HTAGS = NO
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
# will generate a verbatim copy of the header file for each class for
# which an include is specified. Set to NO to disable this.
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
# of all compounds will be generated. Enable this if the project
# contains a lot of classes, structs, unions or interfaces.
ALPHABETICAL_INDEX = NO
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all
# classes will be put under the same header in the alphabetical index.
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
# should be ignored while generating the index headers.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
# generate HTML output.
GENERATE_HTML = YES
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `html' will be used as the default path.
HTML_OUTPUT = html
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
# doxygen will generate files with .html extension.
HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
# fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet. Note that doxygen will try to copy
# the style sheet file to the HTML output directory, so don't put your own
# stylesheet in the HTML output directory as well, or it will be erased!
HTML_STYLESHEET =
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
HTML_ALIGN_MEMBERS = YES
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
# of the generated HTML documentation.
GENERATE_HTMLHELP = NO
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
# be used to specify the file name of the resulting .chm file. You
# can add a path in front of the file if the result should not be
# written to the html output directory.
CHM_FILE =
# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
# be used to specify the location (absolute path including file name) of
# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
# the HTML help compiler on the generated index.hhp.
HHC_LOCATION =
# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
# controls if a separate .chi index file is generated (YES) or that
# it should be included in the master .chm file (NO).
GENERATE_CHI = NO
# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
# controls whether a binary table of contents is generated (YES) or a
# normal table of contents (NO) in the .chm file.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members
# to the contents of the HTML help documentation and to the tree view.
TOC_EXPAND = NO
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
# top of each HTML page. The value NO (the default) enables the index and
# the value YES disables it.
DISABLE_INDEX = NO
# This tag can be used to set the number of enum values (range [1..20])
# that doxygen will group on one line in the generated HTML documentation.
ENUM_VALUES_PER_LINE = 4
# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
# generated containing a tree-like index structure (just like the one that
# is generated for HTML Help). For this to work a browser that supports
# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
# probably better off using the HTML help feature.
GENERATE_TREEVIEW = NO
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
# is shown.
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = YES
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `latex' will be used as the default path.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked. If left blank `latex' will be used as the default command name.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
# generate index for LaTeX. If left blank `makeindex' will be used as the
# default command name.
MAKEINDEX_CMD_NAME = makeindex
# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
# LaTeX documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used
# by the printer. Possible values are: a4, a4wide, letter, legal and
# executive. If left blank a4wide will be used.
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
# packages that should be included in the LaTeX output.
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
# the generated latex document. The header should contain everything until
# the first chapter. If it is left blank doxygen will generate a
# standard header. Notice: only use this tag if you know what you are doing!
LATEX_HEADER =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
# This makes the output suitable for online browsing using a pdf viewer.
PDF_HYPERLINKS = NO
# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
# plain latex in the generated Makefile. Set this option to YES to get a
# higher quality PDF documentation.
USE_PDFLATEX = NO
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
# command to the generated LaTeX files. This will instruct LaTeX to keep
# running if errors occur, instead of asking the user for help.
# This option is also used when generating formulas in HTML.
LATEX_BATCHMODE = NO
# If LATEX_HIDE_INDICES is set to YES then doxygen will not
# include the index chapters (such as File Index, Compound Index, etc.)
# in the output.
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
# The RTF output is optimized for Word 97 and may not look very pretty with
# other RTF readers or editors.
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `rtf' will be used as the default path.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
# RTF documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
# will contain hyperlink fields. The RTF file will
# contain links (just like the HTML output) instead of page references.
# This makes the output suitable for online browsing using WORD or other
# programs which support those fields.
# Note: wordpad (write) and others do not support links.
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's
# config file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an rtf document.
# Syntax is similar to doxygen's config file.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages
GENERATE_MAN = YES
# The MAN_OUTPUT tag is used to specify where the man pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `man' will be used as the default path.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to
# the generated man pages (default is the subroutine's section .3)
MAN_EXTENSION = .3
# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
# then it will generate one additional man file for each entity
# documented in the real man page(s). These additional files
# only source the real man page, but without them the man command
# would be unable to find the correct page. The default is NO.
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
# If the GENERATE_XML tag is set to YES Doxygen will
# generate an XML file that captures the structure of
# the code including all documentation.
GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `xml' will be used as the default path.
XML_OUTPUT = xml
# The XML_SCHEMA tag can be used to specify an XML schema,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_SCHEMA =
# The XML_DTD tag can be used to specify an XML DTD,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_DTD =
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
# dump the program listings (including syntax highlighting
# and cross-referencing information) to the XML output. Note that
# enabling this will significantly increase the size of the XML output.
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
# generate an AutoGen Definitions (see autogen.sf.net) file
# that captures the structure of the code including all
# documentation. Note that this feature is still experimental
# and incomplete at the moment.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
# If the GENERATE_PERLMOD tag is set to YES Doxygen will
# generate a Perl module file that captures the structure of
# the code including all documentation. Note that this
# feature is still experimental and incomplete at the
# moment.
GENERATE_PERLMOD = NO
# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
# the necessary Makefile rules, Perl scripts and LaTeX code to be able
# to generate PDF and DVI output from the Perl module output.
PERLMOD_LATEX = NO
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
# nicely formatted so it can be parsed by a human reader. This is useful
# if you want to understand what is going on. On the other hand, if this
# tag is set to NO the size of the Perl module output will be much smaller
# and Perl will parse it just the same.
PERLMOD_PRETTY = YES
# The names of the make variables in the generated doxyrules.make file
# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
# This is useful so different doxyrules.make files included by the same
# Makefile don't overwrite each other's variables.
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
# evaluate all C-preprocessor directives found in the sources and include
# files.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
# names in the source code. If set to NO (the default) only conditional
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_PREDEFINED tags.
EXPAND_ONLY_PREDEF = YES
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by
# the preprocessor.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will
# be used.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that
# are defined before the preprocessor is started (similar to the -D option of
# gcc). The argument of the tag is a list of macros of the form: name
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed. To prevent a macro definition from being
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED = DOXYGEN_SHOULD_IGNORE_THIS=1 \
DECLSPEC= SDLCALL=
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all function-like macros that are alone
# on a line, have an all uppercase name, and do not end with a semicolon. Such
# function macros are typically used for boiler-plate code, and will confuse
# the parser if not removed.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
# The TAGFILES option can be used to specify one or more tagfiles.
# Optionally an initial location of the external documentation
# can be added for each tagfile. The format of a tag file without
# this location is as follows:
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
# TAGFILES = file1=loc1 "file2 = loc2" ...
# where "loc1" and "loc2" can be relative or absolute paths or
# URLs. If a location is present for each tag, the installdox tool
# does not have to be run to correct the links.
# Note that each tag file must have a unique name
# (where the name does NOT include the path)
# If a tag file is not located in the directory in which doxygen
# is run, you must also specify the path to the tagfile here.
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.
GENERATE_TAGFILE =
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
# in the class index. If set to NO only the inherited external classes
# will be listed.
ALLEXTERNALS = NO
# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
# in the modules index. If set to NO, only the current project's groups will
# be listed.
EXTERNAL_GROUPS = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
# or super classes. Setting the tag to NO turns the diagrams off. Note that
# this option is superseded by the HAVE_DOT option below. This is only a
# fallback. It is recommended to install and use dot, since it yields more
# powerful graphs.
CLASS_DIAGRAMS = NO
# If set to YES, the inheritance and collaboration graphs will hide
# inheritance and usage relations if the target is undocumented
# or is not a class.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz, a graph visualization
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = NO
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
# the CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect implementation dependencies (inheritance, containment, and
# class references variables) of the class with other documented classes.
COLLABORATION_GRAPH = YES
# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for groups, showing the direct groups dependencies
GROUP_GRAPHS = YES
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
UML_LOOK = NO
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
TEMPLATE_RELATIONS = NO
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
# tags are set to YES then doxygen will generate a graph for each documented
# file showing the direct and indirect include dependencies of the file with
# other documented files.
INCLUDE_GRAPH = NO
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
# documented header file showing the documented files that directly or
# indirectly include this file.
INCLUDED_BY_GRAPH = YES
# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
# generate a call dependency graph for every global function or class method.
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable call graphs for selected
# functions only using the \callgraph command.
CALL_GRAPH = NO
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
# then doxygen will show the dependencies a directory has on other directories
# in a graphical way. The dependency relations are determined by the #include
# relations between the files in the directories.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. Possible values are png, jpg, or gif
# If left blank png will be used.
DOT_IMAGE_FORMAT = png
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the
# \dotfile command).
DOTFILE_DIRS =
# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_WIDTH = 1024
# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_HEIGHT = 1024
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
# from the root by following a path via at most 3 edges will be shown. Nodes
# that lay further from the root node will be omitted. Note that setting this
# option to 1 or 2 may greatly reduce the computation time needed for large
# code bases. Also note that a graph may be further truncated if the graph's
# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
# the graph is not depth-constrained.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, which results in a white background.
# Warning: Depending on the platform used, enabling this option may lead to
# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
# read).
DOT_TRANSPARENT = NO
# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10)
# support this, this feature is disabled by default.
DOT_MULTI_TARGETS = NO
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
# generate a legend page explaining the meaning of the various boxes and
# arrows in the dot generated graphs.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
# remove the intermediate dot files that are used to generate
# the various graphs.
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
# The SEARCHENGINE tag specifies whether or not a search engine should be
# used. If set to NO the values of all tags below this one will be ignored.
SEARCHENGINE = NO
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/lib/libSDLiPhoneOS.a
0 → 120000
View file @
598471cf
/Users/svp/programs/SDL-gsoc2010_gesture/Xcode-iPhoneOS/SDL/build/Release-iphonesimulator/libSDLiPhoneOS.a
\ No newline at end of file
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/main.c
0 → 100644
View file @
598471cf
#include <stdio.h>
#include <SDL.h>
#include <math.h>
#include <SDL_touch.h>
#include <SDL_gesture.h>
#define PI 3.1415926535897
#define PHI ((sqrt(5)-1)/2)
#define WIDTH 640
#define HEIGHT 480
#define BPP 4
#define DEPTH 32
#define MAXFINGERS 5
#define DOLLARNPOINTS 64
#define DOLLARSIZE 256
//MUST BE A POWER OF 2!
#define EVENT_BUF_SIZE 256
SDL_Event
events
[
EVENT_BUF_SIZE
];
int
eventWrite
;
int
mousx
,
mousy
;
int
keystat
[
512
];
int
bstatus
;
int
colors
[
7
]
=
{
0xFF
,
0xFF00
,
0xFF0000
,
0xFFFF00
,
0x00FFFF
,
0xFF00FF
,
0xFFFFFF
};
long
index2fingerid
[
MAXFINGERS
];
int
fingersDown
;
typedef
struct
{
float
x
,
y
;
}
Point
;
typedef
struct
{
Point
p
;
float
pressure
;
long
id
;
}
Finger
;
typedef
struct
{
Finger
f
;
Point
cv
;
float
dtheta
,
dDist
;
}
TouchPoint
;
typedef
struct
{
//dt + s
Point
d
,
s
;
//direction, start
int
points
;
}
Line
;
typedef
struct
{
float
length
;
int
numPoints
;
Point
p
[
EVENT_BUF_SIZE
];
//To be safe
}
DollarPath
;
typedef
struct
{
float
ang
,
r
;
Point
p
;
}
Knob
;
Knob
knob
;
Finger
finger
[
MAXFINGERS
];
DollarPath
dollarPath
[
MAXFINGERS
];
#define MAXTEMPLATES 4
Point
dollarTemplate
[
MAXTEMPLATES
][
DOLLARNPOINTS
];
int
numDollarTemplates
=
0
;
#ifdef DRAW_VECTOR_EST
Line
gestureLine
[
MAXFINGERS
];
#endif
void
handler
(
int
sig
)
{
printf
(
"\exiting...(%d)
\n
"
,
sig
);
exit
(
0
);
}
void
perror_exit
(
char
*
error
)
{
perror
(
error
);
handler
(
9
);
}
void
setpix
(
SDL_Surface
*
screen
,
int
x
,
int
y
,
unsigned
int
col
)
{
Uint32
*
pixmem32
;
Uint32
colour
;
if
((
unsigned
)
x
>
screen
->
w
)
return
;
if
((
unsigned
)
y
>
screen
->
h
)
return
;
pixmem32
=
(
Uint32
*
)
screen
->
pixels
+
y
*
screen
->
pitch
/
BPP
+
x
;
Uint8
r
,
g
,
b
;
float
a
;
memcpy
(
&
colour
,
pixmem32
,
screen
->
format
->
BytesPerPixel
);
SDL_GetRGB
(
colour
,
screen
->
format
,
&
r
,
&
g
,
&
b
);
//Always returns 0xFFFFFF?
//r = 0;g = 0; b = 0;
a
=
(
col
>>
24
)
&
0xFF
;
if
(
a
==
0
)
a
=
0xFF
;
//Hack, to make things easier.
a
/=
0xFF
;
r
=
r
*
(
1
-
a
)
+
((
col
>>
16
)
&
0xFF
)
*
(
a
);
g
=
g
*
(
1
-
a
)
+
((
col
>>
8
)
&
0xFF
)
*
(
a
);
b
=
b
*
(
1
-
a
)
+
((
col
>>
0
)
&
0xFF
)
*
(
a
);
colour
=
SDL_MapRGB
(
screen
->
format
,
r
,
g
,
b
);
*
pixmem32
=
colour
;
}
void
drawLine
(
SDL_Surface
*
screen
,
int
x0
,
int
y0
,
int
x1
,
int
y1
,
unsigned
int
col
)
{
float
t
;
for
(
t
=
0
;
t
<
1
;
t
+=
1
.
f
/
SDL_max
(
abs
(
x0
-
x1
),
abs
(
y0
-
y1
)))
setpix
(
screen
,
x1
+
t
*
(
x0
-
x1
),
y1
+
t
*
(
y0
-
y1
),
col
);
}
void
drawCircle
(
SDL_Surface
*
screen
,
int
x
,
int
y
,
int
r
,
unsigned
int
c
)
{
float
a
;
int
tx
;
int
ty
;
float
xr
;
for
(
ty
=
-
abs
(
r
);
ty
<=
abs
(
r
);
ty
++
)
{
xr
=
sqrt
(
r
*
r
-
ty
*
ty
);
if
(
r
>
0
)
{
//r > 0 ==> filled circle
for
(
tx
=-
xr
+
.
5
;
tx
<=
xr
-
.
5
;
tx
++
)
{
setpix
(
screen
,
x
+
tx
,
y
+
ty
,
c
);
}
}
else
{
setpix
(
screen
,
x
-
xr
+
.
5
,
y
+
ty
,
c
);
setpix
(
screen
,
x
+
xr
-
.
5
,
y
+
ty
,
c
);
}
}
}
void
drawKnob
(
SDL_Surface
*
screen
,
Knob
k
)
{
//printf("Knob: x = %f, y = %f, r = %f, a = %f\n",k.p.x,k.p.y,k.r,k.ang);
drawCircle
(
screen
,
k
.
p
.
x
*
screen
->
w
,
k
.
p
.
y
*
screen
->
h
,
k
.
r
*
screen
->
w
,
0xFFFFFF
);
drawCircle
(
screen
,(
k
.
p
.
x
+
k
.
r
/
2
*
cos
(
k
.
ang
))
*
screen
->
w
,
(
k
.
p
.
y
+
k
.
r
/
2
*
sin
(
k
.
ang
))
*
screen
->
h
,
k
.
r
/
4
*
screen
->
w
,
0
);
}
void
DrawScreen
(
SDL_Surface
*
screen
,
int
h
)
{
int
x
,
y
,
xm
,
ym
,
c
;
if
(
SDL_MUSTLOCK
(
screen
))
{
if
(
SDL_LockSurface
(
screen
)
<
0
)
return
;
}
for
(
y
=
0
;
y
<
screen
->
h
;
y
++
)
{
for
(
x
=
0
;
x
<
screen
->
w
;
x
++
)
{
//setpixel(screen, x, y, (x*x)/256+3*y+h, (y*y)/256+x+h, h);
//xm = (x+h)%screen->w;
//ym = (y+h)%screen->w;
//c = sin(h/256*2*PI)*x*y/screen->w/screen->h;
//setpix(screen,x,y,255*sin(xm/screen->w*2*PI),sin(h/255*2*PI)*255*y/screen->h,c);
setpix
(
screen
,
x
,
y
,((
x
%
255
)
<<
16
)
+
((
y
%
255
)
<<
8
)
+
(
x
+
y
)
%
255
);
//setpix(screen,x,y,0); //Inefficient, but that's okay...
}
}
drawCircle
(
screen
,
mousx
,
mousy
,
-
30
,
0xFFFFFF
);
drawLine
(
screen
,
0
,
0
,
screen
->
w
,
screen
->
h
,
0xFFFFFF
);
int
i
;
//draw Touch History
TouchPoint
gestureLast
[
MAXFINGERS
];
//printf("------------------Start History------------------\n");
for
(
i
=
0
;
i
<
MAXFINGERS
;
i
++
)
{
gestureLast
[
i
].
f
.
id
=
-
1
;
}
int
numDownFingers
=
0
;
Point
centroid
;
float
gdtheta
,
gdDist
;
for
(
i
=
SDL_max
(
0
,
eventWrite
-
EVENT_BUF_SIZE
);
i
<
eventWrite
;
i
++
)
{
SDL_Event
event
=
events
[
i
&
(
EVENT_BUF_SIZE
-
1
)];
int
age
=
eventWrite
-
i
-
1
;
if
(
event
.
type
==
SDL_FINGERMOTION
||
event
.
type
==
SDL_FINGERDOWN
||
event
.
type
==
SDL_FINGERUP
)
{
SDL_Touch
*
inTouch
=
SDL_GetTouch
(
event
.
tfinger
.
touchId
);
//SDL_Finger* inFinger = SDL_GetFinger(inTouch,event.tfinger.fingerId);
float
x
=
((
float
)
event
.
tfinger
.
x
)
/
inTouch
->
xres
;
float
y
=
((
float
)
event
.
tfinger
.
y
)
/
inTouch
->
yres
;
//draw the touch:
unsigned
int
c
=
colors
[
event
.
tfinger
.
touchId
%
7
];
unsigned
int
col
=
((
unsigned
int
)(
c
*
(.
1
+
.
85
)))
|
((
unsigned
int
)((
0xFF
*
(
1
-
((
float
)
age
)
/
EVENT_BUF_SIZE
)))
&
0xFF
)
<<
24
;
if
(
event
.
type
==
SDL_FINGERMOTION
)
drawCircle
(
screen
,
x
*
screen
->
w
,
y
*
screen
->
h
,
5
,
col
);
else
if
(
event
.
type
==
SDL_FINGERDOWN
)
drawCircle
(
screen
,
x
*
screen
->
w
,
y
*
screen
->
h
,
-
10
,
col
);
/*
//if there is a centroid, draw it
if(numDownFingers > 1) {
unsigned int col =
((unsigned int)(0xFFFFFF)) |
((unsigned int)((0xFF*(1-((float)age)/EVENT_BUF_SIZE))) & 0xFF)<<24;
drawCircle(screen,centroid.x*screen->w,centroid.y*screen->h,5,col);
}
*/
}
}
for
(
i
=
0
;
i
<
MAXFINGERS
;
i
++
)
if
(
finger
[
i
].
p
.
x
>=
0
&&
finger
[
i
].
p
.
y
>=
0
)
if
(
finger
[
i
].
pressure
>
0
)
drawCircle
(
screen
,
finger
[
i
].
p
.
x
*
screen
->
w
,
finger
[
i
].
p
.
y
*
screen
->
h
,
20
,
0xFF
*
finger
[
i
].
pressure
);
else
drawCircle
(
screen
,
finger
[
i
].
p
.
x
*
screen
->
w
,
finger
[
i
].
p
.
y
*
screen
->
h
,
20
,
0xFF
);
keystat
[
32
]
=
0
;
if
(
knob
.
p
.
x
>
0
)
drawKnob
(
screen
,
knob
);
if
(
SDL_MUSTLOCK
(
screen
))
SDL_UnlockSurface
(
screen
);
SDL_Flip
(
screen
);
}
SDL_Surface
*
initScreen
(
int
width
,
int
height
)
{
return
SDL_SetVideoMode
(
width
,
height
,
DEPTH
,
SDL_HWSURFACE
|
SDL_RESIZABLE
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
SDL_Surface
*
screen
;
SDL_Event
event
;
knob
.
r
=
.
1
;
knob
.
ang
=
0
;
TouchPoint
gestureLast
[
MAXFINGERS
];
int
h
,
i
;
memset
(
keystat
,
0
,
512
*
sizeof
(
keystat
[
0
]));
if
(
SDL_Init
(
SDL_INIT_VIDEO
)
<
0
)
return
1
;
if
(
!
(
screen
=
initScreen
(
WIDTH
,
HEIGHT
)))
{
SDL_Quit
();
return
1
;
}
while
(
!
keystat
[
27
])
{
//Poll SDL
while
(
SDL_PollEvent
(
&
event
))
{
//Record _all_ events
events
[
eventWrite
&
(
EVENT_BUF_SIZE
-
1
)]
=
event
;
eventWrite
++
;
switch
(
event
.
type
)
{
case
SDL_QUIT
:
keystat
[
27
]
=
1
;
break
;
case
SDL_KEYDOWN
:
//printf("%i\n",event.key.keysym.sym);
keystat
[
event
.
key
.
keysym
.
sym
]
=
1
;
if
(
event
.
key
.
keysym
.
sym
==
32
)
{
SDL_RecordGesture
(
-
1
);
}
else
if
(
event
.
key
.
keysym
.
sym
==
115
)
{
SDL_RWops
*
src
;
//fp = fopen("gestureSave","w");
src
=
SDL_RWFromFile
(
"gestureSave"
,
"w"
);
printf
(
"Wrote %i templates
\n
"
,
SDL_SaveAllDollarTemplates
(
src
));
//fclose(fp);
SDL_RWclose
(
src
);
}
else
if
(
event
.
key
.
keysym
.
sym
==
108
)
{
SDL_RWops
*
src
;
//fp = fopen("gestureSave","r");
src
=
SDL_RWFromFile
(
"gestureSave"
,
"r"
);
printf
(
"Loaded: %i
\n
"
,
SDL_LoadDollarTemplates
(
-
1
,
src
));
//fclose(fp);
SDL_RWclose
(
src
);
}
//keypress = 1;
break
;
case
SDL_KEYUP
:
//printf("%i\n",event.key.keysym.sym);
keystat
[
event
.
key
.
keysym
.
sym
]
=
0
;
//keypress = 1;
break
;
case
SDL_VIDEORESIZE
:
if
(
!
(
screen
=
initScreen
(
event
.
resize
.
w
,
event
.
resize
.
h
)))
{
SDL_Quit
();
return
1
;
}
break
;
case
SDL_MOUSEMOTION
:
mousx
=
event
.
motion
.
x
;
mousy
=
event
.
motion
.
y
;
break
;
case
SDL_MOUSEBUTTONDOWN
:
bstatus
|=
(
1
<<
(
event
.
button
.
button
-
1
));
break
;
case
SDL_MOUSEBUTTONUP
:
bstatus
&=
~
(
1
<<
(
event
.
button
.
button
-
1
));
break
;
case
SDL_FINGERMOTION
:
;
printf
(
"Finger: %li,x: %f, y: %f
\n
"
,
event
.
tfinger
.
fingerId
,
event
.
tfinger
.
x
,
event
.
tfinger
.
y
);
SDL_Touch
*
inTouch
=
SDL_GetTouch
(
event
.
tfinger
.
touchId
);
//SDL_Finger* inFinger = SDL_GetFinger(inTouch,event.tfinger.fingerId);
for
(
i
=
0
;
i
<
MAXFINGERS
;
i
++
)
if
(
index2fingerid
[
i
]
==
event
.
tfinger
.
fingerId
)
break
;
if
(
i
==
MAXFINGERS
)
break
;
if
(
inTouch
>
0
)
{
finger
[
i
].
p
.
x
=
((
float
)
event
.
tfinger
.
x
)
/
inTouch
->
xres
;
finger
[
i
].
p
.
y
=
((
float
)
event
.
tfinger
.
y
)
/
inTouch
->
yres
;
finger
[
i
].
pressure
=
((
float
)
event
.
tfinger
.
pressure
)
/
inTouch
->
pressureres
;
/*
printf("Finger: %i, Pressure: %f Pressureres: %i\n",
event.tfinger.fingerId,
finger[i].pressure,
inTouch->pressureres);
*/
//printf("Finger: %i, pressure: %f\n",event.tfinger.fingerId,
// finger[event.tfinger.fingerId].pressure);
}
break
;
case
SDL_FINGERDOWN
:
printf
(
"Finger: %li down - x: %f, y: %f
\n
"
,
event
.
tfinger
.
fingerId
,
event
.
tfinger
.
x
,
event
.
tfinger
.
y
);
for
(
i
=
0
;
i
<
MAXFINGERS
;
i
++
)
if
(
index2fingerid
[
i
]
==
-
1
)
{
index2fingerid
[
i
]
=
event
.
tfinger
.
fingerId
;
break
;
}
finger
[
i
].
p
.
x
=
event
.
tfinger
.
x
;
finger
[
i
].
p
.
y
=
event
.
tfinger
.
y
;
break
;
case
SDL_FINGERUP
:
printf
(
"Figner: %li up - x: %f, y: %f
\n
"
,
event
.
tfinger
.
fingerId
,
event
.
tfinger
.
x
,
event
.
tfinger
.
y
);
for
(
i
=
0
;
i
<
MAXFINGERS
;
i
++
)
if
(
index2fingerid
[
i
]
==
event
.
tfinger
.
fingerId
)
{
index2fingerid
[
i
]
=
-
1
;
break
;
}
finger
[
i
].
p
.
x
=
-
1
;
finger
[
i
].
p
.
y
=
-
1
;
break
;
case
SDL_MULTIGESTURE
:
knob
.
p
.
x
=
event
.
mgesture
.
x
;
knob
.
p
.
y
=
event
.
mgesture
.
y
;
knob
.
ang
+=
event
.
mgesture
.
dTheta
;
knob
.
r
+=
event
.
mgesture
.
dDist
;
break
;
case
SDL_DOLLARGESTURE
:
printf
(
"Gesture %lu performed, error: %f
\n
"
,
event
.
dgesture
.
gestureId
,
event
.
dgesture
.
error
);
break
;
case
SDL_DOLLARRECORD
:
printf
(
"Recorded gesture: %lu
\n
"
,
event
.
dgesture
.
gestureId
);
break
;
}
}
DrawScreen
(
screen
,
h
);
for
(
i
=
0
;
i
<
256
;
i
++
)
if
(
keystat
[
i
])
printf
(
"Key %i down
\n
"
,
i
);
}
SDL_Quit
();
return
0
;
}
touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/touchTestIPhone.xcodeproj/project.pbxproj
0 → 100755
View file @
598471cf
// !$*UTF8*$!
{
archiveVersion
=
1
;
classes
=
{
};
objectVersion
=
45
;
objects
=
{
/* Begin PBXBuildFile section */
1D60589F0D05DD5A006BFB54
/* Foundation.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
1D30AB110D05D00D00671497
/* Foundation.framework */
;
};
1DF5F4E00D08C38300B7A737
/* UIKit.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
1DF5F4DF0D08C38300B7A737
/* UIKit.framework */
;
};
28FD15000DC6FC520079059D
/* OpenGLES.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
28FD14FF0DC6FC520079059D
/* OpenGLES.framework */
;
};
28FD15080DC6FC5B0079059D
/* QuartzCore.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
28FD15070DC6FC5B0079059D
/* QuartzCore.framework */
;
};
FD779ED30E26B9B000F39101
/* libSDLiPhoneOS.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FD779ED10E26B9B000F39101
/* libSDLiPhoneOS.a */
;
};
FD779EDE0E26BA1200F39101
/* CoreAudio.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FD779EDD0E26BA1200F39101
/* CoreAudio.framework */
;
};
FD77A07D0E26BD8C00F39101
/* Icon.png in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FD77A07C0E26BD8C00F39101
/* Icon.png */
;
};
FD77A07F0E26BDA900F39101
/* Default.png in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FD77A07E0E26BDA900F39101
/* Default.png */
;
};
FD77A0850E26BDB800F39101
/* AudioToolbox.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FD77A0840E26BDB800F39101
/* AudioToolbox.framework */
;
};
FD77A09D0E26BDE500F39101
/* main.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FD77A09C0E26BDE500F39101
/* main.c */
;
};
FDB8BFC60E5A0F6A00980157
/* CoreGraphics.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FDB8BFC50E5A0F6A00980157
/* CoreGraphics.framework */
;
};
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1D30AB110D05D00D00671497
/* Foundation.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
Foundation.framework
;
path
=
System/Library/Frameworks/Foundation.framework
;
sourceTree
=
SDKROOT
;
};
1D6058910D05DD3D006BFB54
/* touchTestIPhone.app */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.application
;
includeInIndex
=
0
;
path
=
touchTestIPhone.app
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
1DF5F4DF0D08C38300B7A737
/* UIKit.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
UIKit.framework
;
path
=
System/Library/Frameworks/UIKit.framework
;
sourceTree
=
SDKROOT
;
};
28FD14FF0DC6FC520079059D
/* OpenGLES.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
OpenGLES.framework
;
path
=
System/Library/Frameworks/OpenGLES.framework
;
sourceTree
=
SDKROOT
;
};
28FD15070DC6FC5B0079059D
/* QuartzCore.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
QuartzCore.framework
;
path
=
System/Library/Frameworks/QuartzCore.framework
;
sourceTree
=
SDKROOT
;
};
8D1107310486CEB800E47090
/* Info.plist */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.plist.xml
;
path
=
Info.plist
;
sourceTree
=
"<group>"
;
};
FD779ED10E26B9B000F39101
/* libSDLiPhoneOS.a */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
archive.ar
;
name
=
libSDLiPhoneOS.a
;
path
=
lib/libSDLiPhoneOS.a
;
sourceTree
=
"<group>"
;
};
FD779EDD0E26BA1200F39101
/* CoreAudio.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
CoreAudio.framework
;
path
=
System/Library/Frameworks/CoreAudio.framework
;
sourceTree
=
SDKROOT
;
};
FD77A07C0E26BD8C00F39101
/* Icon.png */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
image.png
;
path
=
Icon.png
;
sourceTree
=
"<group>"
;
};
FD77A07E0E26BDA900F39101
/* Default.png */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
image.png
;
path
=
Default.png
;
sourceTree
=
"<group>"
;
};
FD77A0840E26BDB800F39101
/* AudioToolbox.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
AudioToolbox.framework
;
path
=
System/Library/Frameworks/AudioToolbox.framework
;
sourceTree
=
SDKROOT
;
};
FD77A09C0E26BDE500F39101
/* main.c */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.c
;
path
=
main.c
;
sourceTree
=
"<group>"
;
};
FDB8BFC50E5A0F6A00980157
/* CoreGraphics.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
CoreGraphics.framework
;
path
=
System/Library/Frameworks/CoreGraphics.framework
;
sourceTree
=
SDKROOT
;
};
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1D60588F0D05DD3D006BFB54
/* Frameworks */
=
{
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
FD779ED30E26B9B000F39101
/* libSDLiPhoneOS.a in Frameworks */
,
1D60589F0D05DD5A006BFB54
/* Foundation.framework in Frameworks */
,
1DF5F4E00D08C38300B7A737
/* UIKit.framework in Frameworks */
,
28FD15000DC6FC520079059D
/* OpenGLES.framework in Frameworks */
,
28FD15080DC6FC5B0079059D
/* QuartzCore.framework in Frameworks */
,
FD779EDE0E26BA1200F39101
/* CoreAudio.framework in Frameworks */
,
FD77A0850E26BDB800F39101
/* AudioToolbox.framework in Frameworks */
,
FDB8BFC60E5A0F6A00980157
/* CoreGraphics.framework in Frameworks */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
19C28FACFE9D520D11CA2CBB
/* Products */
=
{
isa
=
PBXGroup
;
children
=
(
1D6058910D05DD3D006BFB54
/* touchTestIPhone.app */
,
);
name
=
Products
;
sourceTree
=
"<group>"
;
};
29B97314FDCFA39411CA2CEA
/* CustomTemplate */
=
{
isa
=
PBXGroup
;
children
=
(
29B97315FDCFA39411CA2CEA
/* Sources */
,
29B97317FDCFA39411CA2CEA
/* Resources */
,
FD779EC50E26B99E00F39101
/* Libraries */
,
29B97323FDCFA39411CA2CEA
/* Frameworks */
,
19C28FACFE9D520D11CA2CBB
/* Products */
,
);
name
=
CustomTemplate
;
sourceTree
=
"<group>"
;
};
29B97315FDCFA39411CA2CEA
/* Sources */
=
{
isa
=
PBXGroup
;
children
=
(
FD77A09C0E26BDE500F39101
/* main.c */
,
);
name
=
Sources
;
sourceTree
=
"<group>"
;
};
29B97317FDCFA39411CA2CEA
/* Resources */
=
{
isa
=
PBXGroup
;
children
=
(
FD77A07E0E26BDA900F39101
/* Default.png */
,
FD77A07C0E26BD8C00F39101
/* Icon.png */
,
8D1107310486CEB800E47090
/* Info.plist */
,
);
name
=
Resources
;
sourceTree
=
"<group>"
;
};
29B97323FDCFA39411CA2CEA
/* Frameworks */
=
{
isa
=
PBXGroup
;
children
=
(
FDB8BFC50E5A0F6A00980157
/* CoreGraphics.framework */
,
FD77A0840E26BDB800F39101
/* AudioToolbox.framework */
,
FD779EDD0E26BA1200F39101
/* CoreAudio.framework */
,
28FD15070DC6FC5B0079059D
/* QuartzCore.framework */
,
28FD14FF0DC6FC520079059D
/* OpenGLES.framework */
,
1DF5F4DF0D08C38300B7A737
/* UIKit.framework */
,
1D30AB110D05D00D00671497
/* Foundation.framework */
,
);
name
=
Frameworks
;
sourceTree
=
"<group>"
;
};
FD779EC50E26B99E00F39101
/* Libraries */
=
{
isa
=
PBXGroup
;
children
=
(
FD779ED10E26B9B000F39101
/* libSDLiPhoneOS.a */
,
);
name
=
Libraries
;
sourceTree
=
"<group>"
;
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54
/* touchTestIPhone */
=
{
isa
=
PBXNativeTarget
;
buildConfigurationList
=
1D6058960D05DD3E006BFB54
/* Build configuration list for PBXNativeTarget "touchTestIPhone" */
;
buildPhases
=
(
1D60588D0D05DD3D006BFB54
/* Resources */
,
1D60588E0D05DD3D006BFB54
/* Sources */
,
1D60588F0D05DD3D006BFB54
/* Frameworks */
,
);
buildRules
=
(
);
dependencies
=
(
);
name
=
touchTestIPhone
;
productName
=
touchTestIPhone
;
productReference
=
1D6058910D05DD3D006BFB54
/* touchTestIPhone.app */
;
productType
=
"com.apple.product-type.application"
;
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA
/* Project object */
=
{
isa
=
PBXProject
;
buildConfigurationList
=
C01FCF4E08A954540054247B
/* Build configuration list for PBXProject "touchTestIPhone" */
;
compatibilityVersion
=
"Xcode 3.1"
;
hasScannedForEncodings
=
1
;
mainGroup
=
29B97314FDCFA39411CA2CEA
/* CustomTemplate */
;
projectDirPath
=
""
;
projectRoot
=
""
;
targets
=
(
1D6058900D05DD3D006BFB54
/* touchTestIPhone */
,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
1D60588D0D05DD3D006BFB54
/* Resources */
=
{
isa
=
PBXResourcesBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
FD77A07D0E26BD8C00F39101
/* Icon.png in Resources */
,
FD77A07F0E26BDA900F39101
/* Default.png in Resources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1D60588E0D05DD3D006BFB54
/* Sources */
=
{
isa
=
PBXSourcesBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
FD77A09D0E26BDE500F39101
/* main.c in Sources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54
/* Debug */
=
{
isa
=
XCBuildConfiguration
;
buildSettings
=
{
ALWAYS_SEARCH_USER_PATHS
=
NO
;
COPY_PHASE_STRIP
=
NO
;
GCC_DYNAMIC_NO_PIC
=
NO
;
GCC_OPTIMIZATION_LEVEL
=
0
;
GCC_PRECOMPILE_PREFIX_HEADER
=
YES
;
GCC_PREFIX_HEADER
=
""
;
INFOPLIST_FILE
=
Info.plist
;
LIBRARY_SEARCH_PATHS
=
(
"$(inherited)"
,
"\"$(SRCROOT)/lib\""
,
);
PRODUCT_NAME
=
touchTestIPhone
;
};
name
=
Debug
;
};
1D6058950D05DD3E006BFB54
/* Release */
=
{
isa
=
XCBuildConfiguration
;
buildSettings
=
{
ALWAYS_SEARCH_USER_PATHS
=
NO
;
COPY_PHASE_STRIP
=
YES
;
GCC_PRECOMPILE_PREFIX_HEADER
=
YES
;
GCC_PREFIX_HEADER
=
""
;
INFOPLIST_FILE
=
Info.plist
;
LIBRARY_SEARCH_PATHS
=
(
"$(inherited)"
,
"\"$(SRCROOT)/lib\""
,
);
PRODUCT_NAME
=
touchTestIPhone
;
};
name
=
Release
;
};
C01FCF4F08A954540054247B
/* Debug */
=
{
isa
=
XCBuildConfiguration
;
buildSettings
=
{
ARCHS
=
"$(ARCHS_STANDARD_32_BIT)"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
GCC_C_LANGUAGE_STANDARD
=
c99
;
GCC_WARN_ABOUT_RETURN_TYPE
=
YES
;
GCC_WARN_UNUSED_VARIABLE
=
YES
;
HEADER_SEARCH_PATHS
=
./include
;
LIBRARY_SEARCH_PATHS
=
./lib
;
ONLY_ACTIVE_ARCH
=
YES
;
OTHER_CFLAGS
=
""
;
PREBINDING
=
NO
;
SDKROOT
=
iphonesimulator3.2
;
};
name
=
Debug
;
};
C01FCF5008A954540054247B
/* Release */
=
{
isa
=
XCBuildConfiguration
;
buildSettings
=
{
ARCHS
=
"$(ARCHS_STANDARD_32_BIT)"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
GCC_C_LANGUAGE_STANDARD
=
c99
;
GCC_WARN_ABOUT_RETURN_TYPE
=
YES
;
GCC_WARN_UNUSED_VARIABLE
=
YES
;
HEADER_SEARCH_PATHS
=
./include
;
LIBRARY_SEARCH_PATHS
=
./lib
;
OTHER_CFLAGS
=
""
;
PREBINDING
=
NO
;
SDKROOT
=
iphonesimulator3.2
;
};
name
=
Release
;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1D6058960D05DD3E006BFB54
/* Build configuration list for PBXNativeTarget "touchTestIPhone" */
=
{
isa
=
XCConfigurationList
;
buildConfigurations
=
(
1D6058940D05DD3E006BFB54
/* Debug */
,
1D6058950D05DD3E006BFB54
/* Release */
,
);
defaultConfigurationIsVisible
=
0
;
defaultConfigurationName
=
Release
;
};
C01FCF4E08A954540054247B
/* Build configuration list for PBXProject "touchTestIPhone" */
=
{
isa
=
XCConfigurationList
;
buildConfigurations
=
(
C01FCF4F08A954540054247B
/* Debug */
,
C01FCF5008A954540054247B
/* Release */
,
);
defaultConfigurationIsVisible
=
0
;
defaultConfigurationName
=
Release
;
};
/* End XCConfigurationList section */
};
rootObject
=
29B97313FDCFA39411CA2CEA
/* Project object */
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment