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
2f0bec32
Commit
2f0bec32
authored
Jun 10, 2011
by
Tim Angus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* SDL_IOS_IDLE_TIMER_DISABLED hint
parent
a36a856b
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
1 deletion
+62
-1
SDL_VS2005.vcproj
VisualC/SDL/SDL_VS2005.vcproj
+4
-0
SDL_VS2008.vcproj
VisualC/SDL/SDL_VS2008.vcproj
+4
-0
SDL_VS2010.vcxproj
VisualC/SDL/SDL_VS2010.vcxproj
+2
-1
project.pbxproj
Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj
+4
-0
SDL_hints.h
include/SDL_hints.h
+14
-0
SDL_hints.c
src/SDL_hints.c
+20
-0
SDL_uikitappdelegate.m
src/video/uikit/SDL_uikitappdelegate.m
+14
-0
No files found.
VisualC/SDL/SDL_VS2005.vcproj
View file @
2f0bec32
...
@@ -907,6 +907,10 @@
...
@@ -907,6 +907,10 @@
RelativePath=
"..\..\src\SDL_hints.c"
RelativePath=
"..\..\src\SDL_hints.c"
>
>
</File>
</File>
<File
RelativePath=
"..\..\src\SDL_hints_c.h"
>
</File>
<File
<File
RelativePath=
"..\..\src\stdlib\SDL_iconv.c"
RelativePath=
"..\..\src\stdlib\SDL_iconv.c"
>
>
...
...
VisualC/SDL/SDL_VS2008.vcproj
View file @
2f0bec32
...
@@ -896,6 +896,10 @@
...
@@ -896,6 +896,10 @@
RelativePath=
"..\..\src\SDL_hints.c"
RelativePath=
"..\..\src\SDL_hints.c"
>
>
</File>
</File>
<File
RelativePath=
"..\..\src\SDL_hints_c.h"
>
</File>
<File
<File
RelativePath=
"..\..\src\stdlib\SDL_iconv.c"
RelativePath=
"..\..\src\stdlib\SDL_iconv.c"
>
>
...
...
VisualC/SDL/SDL_VS2010.vcxproj
View file @
2f0bec32
...
@@ -281,6 +281,7 @@
...
@@ -281,6 +281,7 @@
<ClInclude
Include=
"..\..\src\audio\dummy\SDL_dummyaudio.h"
/>
<ClInclude
Include=
"..\..\src\audio\dummy\SDL_dummyaudio.h"
/>
<ClInclude
Include=
"..\..\src\audio\windx5\SDL_dx5audio.h"
/>
<ClInclude
Include=
"..\..\src\audio\windx5\SDL_dx5audio.h"
/>
<ClInclude
Include=
"..\..\src\SDL_error_c.h"
/>
<ClInclude
Include=
"..\..\src\SDL_error_c.h"
/>
<ClInclude
Include=
"..\..\src\SDL_hints_c.h"
/>
<ClInclude
Include=
"..\..\src\events\SDL_events_c.h"
/>
<ClInclude
Include=
"..\..\src\events\SDL_events_c.h"
/>
<ClInclude
Include=
"..\..\src\SDL_fatal.h"
/>
<ClInclude
Include=
"..\..\src\SDL_fatal.h"
/>
<ClInclude
Include=
"..\..\src\video\SDL_glesfuncs.h"
/>
<ClInclude
Include=
"..\..\src\video\SDL_glesfuncs.h"
/>
...
...
Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj
View file @
2f0bec32
...
@@ -122,6 +122,7 @@
...
@@ -122,6 +122,7 @@
04FFAB8C12E23B8D00BA343D
/* SDL_spinlock.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04FFAB8A12E23B8D00BA343D
/* SDL_spinlock.c */
;
};
04FFAB8C12E23B8D00BA343D
/* SDL_spinlock.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04FFAB8A12E23B8D00BA343D
/* SDL_spinlock.c */
;
};
04FFAB9612E23BDC00BA343D
/* SDL_blendmode.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04FFAB9312E23BDC00BA343D
/* SDL_blendmode.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
04FFAB9612E23BDC00BA343D
/* SDL_blendmode.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04FFAB9312E23BDC00BA343D
/* SDL_blendmode.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
04FFAB9812E23BDC00BA343D
/* SDL_shape.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04FFAB9512E23BDC00BA343D
/* SDL_shape.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
04FFAB9812E23BDC00BA343D
/* SDL_shape.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04FFAB9512E23BDC00BA343D
/* SDL_shape.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
22C905CD13A22646003FE4E4
/* SDL_hints_c.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
22C905CC13A22646003FE4E4
/* SDL_hints_c.h */
;
};
56ED04E1118A8EE200A56AA6
/* SDL_power.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
56ED04E0118A8EE200A56AA6
/* SDL_power.c */
;
};
56ED04E1118A8EE200A56AA6
/* SDL_power.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
56ED04E0118A8EE200A56AA6
/* SDL_power.c */
;
};
56ED04E3118A8EFD00A56AA6
/* SDL_syspower.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
56ED04E2118A8EFD00A56AA6
/* SDL_syspower.m */
;
};
56ED04E3118A8EFD00A56AA6
/* SDL_syspower.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
56ED04E2118A8EFD00A56AA6
/* SDL_syspower.m */
;
};
FD24846D0E5655AE0021E198
/* SDL_uikitkeyboard.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FD24846B0E5655AE0021E198
/* SDL_uikitkeyboard.h */
;
};
FD24846D0E5655AE0021E198
/* SDL_uikitkeyboard.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FD24846B0E5655AE0021E198
/* SDL_uikitkeyboard.h */
;
};
...
@@ -376,6 +377,7 @@
...
@@ -376,6 +377,7 @@
04FFAB8A12E23B8D00BA343D
/* SDL_spinlock.c */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.c
;
path
=
SDL_spinlock.c
;
sourceTree
=
"<group>"
;
};
04FFAB8A12E23B8D00BA343D
/* SDL_spinlock.c */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.c
;
path
=
SDL_spinlock.c
;
sourceTree
=
"<group>"
;
};
04FFAB9312E23BDC00BA343D
/* SDL_blendmode.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
SDL_blendmode.h
;
path
=
../../include/SDL_blendmode.h
;
sourceTree
=
SOURCE_ROOT
;
};
04FFAB9312E23BDC00BA343D
/* SDL_blendmode.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
SDL_blendmode.h
;
path
=
../../include/SDL_blendmode.h
;
sourceTree
=
SOURCE_ROOT
;
};
04FFAB9512E23BDC00BA343D
/* SDL_shape.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
SDL_shape.h
;
path
=
../../include/SDL_shape.h
;
sourceTree
=
SOURCE_ROOT
;
};
04FFAB9512E23BDC00BA343D
/* SDL_shape.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
SDL_shape.h
;
path
=
../../include/SDL_shape.h
;
sourceTree
=
SOURCE_ROOT
;
};
22C905CC13A22646003FE4E4
/* SDL_hints_c.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
SDL_hints_c.h
;
path
=
../../src/SDL_hints_c.h
;
sourceTree
=
"<group>"
;
};
56ED04E0118A8EE200A56AA6
/* SDL_power.c */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.c
;
name
=
SDL_power.c
;
path
=
../../src/power/SDL_power.c
;
sourceTree
=
SOURCE_ROOT
;
};
56ED04E0118A8EE200A56AA6
/* SDL_power.c */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.c
;
name
=
SDL_power.c
;
path
=
../../src/power/SDL_power.c
;
sourceTree
=
SOURCE_ROOT
;
};
56ED04E2118A8EFD00A56AA6
/* SDL_syspower.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
SDL_syspower.m
;
path
=
../../src/power/uikit/SDL_syspower.m
;
sourceTree
=
SOURCE_ROOT
;
};
56ED04E2118A8EFD00A56AA6
/* SDL_syspower.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
SDL_syspower.m
;
path
=
../../src/power/uikit/SDL_syspower.m
;
sourceTree
=
SOURCE_ROOT
;
};
FD0BBFEF0E3933DD00D833B1
/* SDL_uikitview.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
SDL_uikitview.h
;
sourceTree
=
"<group>"
;
};
FD0BBFEF0E3933DD00D833B1
/* SDL_uikitview.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
SDL_uikitview.h
;
sourceTree
=
"<group>"
;
};
...
@@ -971,6 +973,7 @@
...
@@ -971,6 +973,7 @@
FD99B9D60DD52EDC00FB1D6B
/* SDL_fatal.c */
,
FD99B9D60DD52EDC00FB1D6B
/* SDL_fatal.c */
,
FD99B9D70DD52EDC00FB1D6B
/* SDL_fatal.h */
,
FD99B9D70DD52EDC00FB1D6B
/* SDL_fatal.h */
,
0442EC5412FE1C3F004C9285
/* SDL_hints.c */
,
0442EC5412FE1C3F004C9285
/* SDL_hints.c */
,
22C905CC13A22646003FE4E4
/* SDL_hints_c.h */
,
04BAC09B1300C1290055DE28
/* SDL_log.c */
,
04BAC09B1300C1290055DE28
/* SDL_log.c */
,
FD99B9D80DD52EDC00FB1D6B
/* SDL.c */
,
FD99B9D80DD52EDC00FB1D6B
/* SDL.c */
,
);
);
...
@@ -1241,6 +1244,7 @@
...
@@ -1241,6 +1244,7 @@
04BAC0991300C0F70055DE28
/* SDL_log.h in Headers */
,
04BAC0991300C0F70055DE28
/* SDL_log.h in Headers */
,
04BAC09C1300C1290055DE28
/* SDL_assert_c.h in Headers */
,
04BAC09C1300C1290055DE28
/* SDL_assert_c.h in Headers */
,
0417A516130C988500578583
/* SDL_keycode.h in Headers */
,
0417A516130C988500578583
/* SDL_keycode.h in Headers */
,
22C905CD13A22646003FE4E4
/* SDL_hints_c.h in Headers */
,
);
);
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
};
};
...
...
include/SDL_hints.h
View file @
2f0bec32
...
@@ -119,6 +119,20 @@ extern "C" {
...
@@ -119,6 +119,20 @@ extern "C" {
*/
*/
#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC"
#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC"
/**
* \brief A variable controlling whether the idle timer is disabled on iOS.
*
* When an iOS app does not receive touches for some time, the screen is
* dimmed automatically. For games where the accelerometer is the only input
* this is problematic. This functionality can be disabled by setting this
* hint.
*
* This variable can be set to the following values:
* "0" - Enable idle timer
* "1" - Disable idle timer
*/
#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED"
/**
/**
* \brief A variable controlling which orientations are allowed on iOS.
* \brief A variable controlling which orientations are allowed on iOS.
*
*
...
...
src/SDL_hints.c
View file @
2f0bec32
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "SDL_config.h"
#include "SDL_config.h"
#include "SDL_hints.h"
#include "SDL_hints.h"
#include "SDL_hints_c.h"
/* Assuming there aren't many hints set and they aren't being queried in
/* Assuming there aren't many hints set and they aren't being queried in
...
@@ -30,11 +31,26 @@ typedef struct SDL_Hint {
...
@@ -30,11 +31,26 @@ typedef struct SDL_Hint {
char
*
name
;
char
*
name
;
char
*
value
;
char
*
value
;
SDL_HintPriority
priority
;
SDL_HintPriority
priority
;
SDL_HintChangedCb
callback
;
struct
SDL_Hint
*
next
;
struct
SDL_Hint
*
next
;
}
SDL_Hint
;
}
SDL_Hint
;
static
SDL_Hint
*
SDL_hints
;
static
SDL_Hint
*
SDL_hints
;
SDL_bool
SDL_RegisterHintChangedCb
(
const
char
*
name
,
SDL_HintChangedCb
hintCb
)
{
SDL_Hint
*
hint
;
for
(
hint
=
SDL_hints
;
hint
;
hint
=
hint
->
next
)
{
if
(
SDL_strcmp
(
name
,
hint
->
name
)
==
0
)
{
hint
->
callback
=
hintCb
;
return
SDL_TRUE
;
}
}
return
SDL_FALSE
;
}
SDL_bool
SDL_bool
SDL_SetHintWithPriority
(
const
char
*
name
,
const
char
*
value
,
SDL_SetHintWithPriority
(
const
char
*
name
,
const
char
*
value
,
...
@@ -59,6 +75,9 @@ SDL_SetHintWithPriority(const char *name, const char *value,
...
@@ -59,6 +75,9 @@ SDL_SetHintWithPriority(const char *name, const char *value,
return
SDL_FALSE
;
return
SDL_FALSE
;
}
}
if
(
SDL_strcmp
(
hint
->
value
,
value
)
!=
0
)
{
if
(
SDL_strcmp
(
hint
->
value
,
value
)
!=
0
)
{
if
(
hint
->
callback
!=
NULL
)
{
(
*
hint
->
callback
)(
name
,
hint
->
value
,
value
);
}
SDL_free
(
hint
->
value
);
SDL_free
(
hint
->
value
);
hint
->
value
=
SDL_strdup
(
value
);
hint
->
value
=
SDL_strdup
(
value
);
}
}
...
@@ -75,6 +94,7 @@ SDL_SetHintWithPriority(const char *name, const char *value,
...
@@ -75,6 +94,7 @@ SDL_SetHintWithPriority(const char *name, const char *value,
hint
->
name
=
SDL_strdup
(
name
);
hint
->
name
=
SDL_strdup
(
name
);
hint
->
value
=
SDL_strdup
(
value
);
hint
->
value
=
SDL_strdup
(
value
);
hint
->
priority
=
priority
;
hint
->
priority
=
priority
;
hint
->
callback
=
NULL
;
hint
->
next
=
SDL_hints
;
hint
->
next
=
SDL_hints
;
SDL_hints
=
hint
;
SDL_hints
=
hint
;
return
SDL_TRUE
;
return
SDL_TRUE
;
...
...
src/video/uikit/SDL_uikitappdelegate.m
View file @
2f0bec32
...
@@ -20,6 +20,9 @@
...
@@ -20,6 +20,9 @@
*/
*/
#import "../SDL_sysvideo.h"
#import "../SDL_sysvideo.h"
#import "SDL_assert.h"
#import "SDL_hints.h"
#import "../../SDL_hints_c.h"
#import "SDL_uikitappdelegate.h"
#import "SDL_uikitappdelegate.h"
#import "SDL_uikitopenglview.h"
#import "SDL_uikitopenglview.h"
...
@@ -55,6 +58,13 @@ int main(int argc, char **argv) {
...
@@ -55,6 +58,13 @@ int main(int argc, char **argv) {
return
0
;
return
0
;
}
}
static
void
SDL_IdleTimerDisabledChanged
(
const
char
*
name
,
const
char
*
oldValue
,
const
char
*
newValue
)
{
SDL_assert
(
SDL_strcmp
(
name
,
SDL_HINT_IDLE_TIMER_DISABLED
)
==
0
);
BOOL
disable
=
(
*
newValue
!=
'0'
);
[
UIApplication
sharedApplication
].
idleTimerDisabled
=
disable
;
}
@implementation
SDLUIKitDelegate
@implementation
SDLUIKitDelegate
/* convenience method */
/* convenience method */
...
@@ -76,6 +86,10 @@ int main(int argc, char **argv) {
...
@@ -76,6 +86,10 @@ int main(int argc, char **argv) {
-
(
void
)
postFinishLaunch
{
-
(
void
)
postFinishLaunch
{
/* register a callback for the idletimer hint */
SDL_SetHint
(
SDL_HINT_IDLE_TIMER_DISABLED
,
"0"
);
SDL_RegisterHintChangedCb
(
SDL_HINT_IDLE_TIMER_DISABLED
,
&
SDL_IdleTimerDisabledChanged
);
/* run the user's application, passing argc and argv */
/* run the user's application, passing argc and argv */
int
exit_status
=
SDL_main
(
forward_argc
,
forward_argv
);
int
exit_status
=
SDL_main
(
forward_argc
,
forward_argv
);
...
...
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