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
ade868c1
Commit
ade868c1
authored
Feb 28, 2011
by
Sam Lantinga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use boolean value for input grab mode, like we do for fullscreen mode.
parent
ce2aa2ee
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
19 deletions
+16
-19
SDL_video.h
include/SDL_video.h
+4
-4
SDL_video.c
src/video/SDL_video.c
+12
-15
No files found.
include/SDL_video.h
View file @
ade868c1
...
@@ -588,21 +588,21 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window,
...
@@ -588,21 +588,21 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window,
/**
/**
* \brief Set a window's input grab mode.
* \brief Set a window's input grab mode.
*
*
* \param
mode This is 1 to grab input, and 0
to release input.
* \param
grabbed This is SDL_TRUE to grab input, and SDL_FALSE
to release input.
*
*
* \sa SDL_GetWindowGrab()
* \sa SDL_GetWindowGrab()
*/
*/
extern
DECLSPEC
void
SDLCALL
SDL_SetWindowGrab
(
SDL_Window
*
window
,
extern
DECLSPEC
void
SDLCALL
SDL_SetWindowGrab
(
SDL_Window
*
window
,
int
mode
);
SDL_bool
grabbed
);
/**
/**
* \brief Get a window's input grab mode.
* \brief Get a window's input grab mode.
*
*
* \return This returns
1 if input is grabbed, and 0
otherwise.
* \return This returns
SDL_TRUE if input is grabbed, and SDL_FALSE
otherwise.
*
*
* \sa SDL_SetWindowGrab()
* \sa SDL_SetWindowGrab()
*/
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetWindowGrab
(
SDL_Window
*
window
);
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_GetWindowGrab
(
SDL_Window
*
window
);
/**
/**
* \brief Destroy a window.
* \brief Destroy a window.
...
...
src/video/SDL_video.c
View file @
ade868c1
...
@@ -108,9 +108,6 @@ static SDL_VideoDevice *_this = NULL;
...
@@ -108,9 +108,6 @@ static SDL_VideoDevice *_this = NULL;
return retval; \
return retval; \
}
}
/* Various local functions */
static
void
SDL_UpdateWindowGrab
(
SDL_Window
*
window
);
/* Support for framebuffer emulation using an accelerated renderer */
/* Support for framebuffer emulation using an accelerated renderer */
#define SDL_WINDOWTEXTUREDATA "_SDL_WindowTextureData"
#define SDL_WINDOWTEXTUREDATA "_SDL_WindowTextureData"
...
@@ -1672,15 +1669,23 @@ SDL_UpdateWindowSurfaceRects(SDL_Window * window, SDL_Rect * rects,
...
@@ -1672,15 +1669,23 @@ SDL_UpdateWindowSurfaceRects(SDL_Window * window, SDL_Rect * rects,
return
_this
->
UpdateWindowFramebuffer
(
_this
,
window
,
rects
,
numrects
);
return
_this
->
UpdateWindowFramebuffer
(
_this
,
window
,
rects
,
numrects
);
}
}
static
void
SDL_UpdateWindowGrab
(
SDL_Window
*
window
)
{
if
((
window
->
flags
&
SDL_WINDOW_INPUT_FOCUS
)
&&
_this
->
SetWindowGrab
)
{
_this
->
SetWindowGrab
(
_this
,
window
);
}
}
void
void
SDL_SetWindowGrab
(
SDL_Window
*
window
,
int
mode
)
SDL_SetWindowGrab
(
SDL_Window
*
window
,
SDL_bool
grabbed
)
{
{
CHECK_WINDOW_MAGIC
(
window
,
);
CHECK_WINDOW_MAGIC
(
window
,
);
if
((
!!
mode
==
!!
(
window
->
flags
&
SDL_WINDOW_INPUT_GRABBED
)))
{
if
((
!!
grabbed
==
!!
(
window
->
flags
&
SDL_WINDOW_INPUT_GRABBED
)))
{
return
;
return
;
}
}
if
(
mode
)
{
if
(
grabbed
)
{
window
->
flags
|=
SDL_WINDOW_INPUT_GRABBED
;
window
->
flags
|=
SDL_WINDOW_INPUT_GRABBED
;
}
else
{
}
else
{
window
->
flags
&=
~
SDL_WINDOW_INPUT_GRABBED
;
window
->
flags
&=
~
SDL_WINDOW_INPUT_GRABBED
;
...
@@ -1688,15 +1693,7 @@ SDL_SetWindowGrab(SDL_Window * window, int mode)
...
@@ -1688,15 +1693,7 @@ SDL_SetWindowGrab(SDL_Window * window, int mode)
SDL_UpdateWindowGrab
(
window
);
SDL_UpdateWindowGrab
(
window
);
}
}
static
void
SDL_bool
SDL_UpdateWindowGrab
(
SDL_Window
*
window
)
{
if
((
window
->
flags
&
SDL_WINDOW_INPUT_FOCUS
)
&&
_this
->
SetWindowGrab
)
{
_this
->
SetWindowGrab
(
_this
,
window
);
}
}
int
SDL_GetWindowGrab
(
SDL_Window
*
window
)
SDL_GetWindowGrab
(
SDL_Window
*
window
)
{
{
CHECK_WINDOW_MAGIC
(
window
,
0
);
CHECK_WINDOW_MAGIC
(
window
,
0
);
...
...
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