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
2c8b1ce8
Commit
2c8b1ce8
authored
Jun 22, 2010
by
Eli Gottlieb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Andreas's fixes to the header and stub file for SDL_shape.
parent
00e7bc8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
16 deletions
+22
-16
SDL_shape.h
include/SDL_shape.h
+19
-13
SDL_shape.c
src/video/SDL_shape.c
+3
-3
No files found.
include/SDL_shape.h
View file @
2c8b1ce8
...
@@ -39,11 +39,11 @@ extern "C" {
...
@@ -39,11 +39,11 @@ extern "C" {
/** \file SDL_shape.h
/** \file SDL_shape.h
*
*
* Header file for
shaped windows
.
* Header file for
the shaped window API
.
*/
*/
/**
/**
* \brief Create a
shaped window
with the specified position, dimensions, and flags.
* \brief Create a
window that can be shaped
with the specified position, dimensions, and flags.
*
*
* \param title The title of the window, in UTF-8 encoding.
* \param title The title of the window, in UTF-8 encoding.
* \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
* \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
...
@@ -69,13 +69,18 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,un
...
@@ -69,13 +69,18 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,un
*
*
* \param window The window to query for being shaped.
* \param window The window to query for being shaped.
*
*
* \return SDL_TRUE if the window is a
shaped window and SDL_FALSE otherwise
.
* \return SDL_TRUE if the window is a
window that can be shaped, SDL_FALSE if the window is unshaped or NULL
.
* \sa SDL_CreateShapedWindow
* \sa SDL_CreateShapedWindow
*/
*/
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_
WindowIsShaped
(
const
SDL_Window
*
window
);
extern
DECLSPEC
SDL_bool
SDLCALL
SDL_
IsShapedWindow
(
const
SDL_Window
*
window
);
/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */
/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */
typedef
enum
{
ShapeModeDefault
,
ShapeModeBinarizeAlpha
}
WindowShapeMode
;
typedef
enum
{
/** \brief The default mode, a binarized alpha cutoff of 1. */
ShapeModeDefault
,
/** \brief A binarized alpha cutoff with a given integer value. */
ShapeModeBinarizeAlpha
}
WindowShapeMode
;
/** \brief A union containing parameters for shaped windows. */
/** \brief A union containing parameters for shaped windows. */
typedef
union
{
typedef
union
{
/** \brief a cutoff alpha value for binarization of the window shape's alpha channel. */
/** \brief a cutoff alpha value for binarization of the window shape's alpha channel. */
...
@@ -94,29 +99,30 @@ typedef struct SDL_WindowShapeMode {
...
@@ -94,29 +99,30 @@ typedef struct SDL_WindowShapeMode {
* \brief Set the shape and parameters of a shaped window.
* \brief Set the shape and parameters of a shaped window.
*
*
* \param window The shaped window whose parameters should be set.
* \param window The shaped window whose parameters should be set.
* \param shape A surface encoding the desired shape for the window
as a bitmap mask
.
* \param shape A surface encoding the desired shape for the window.
* \param
parameters
The parameters to set for the shaped window.
* \param
shapeMode
The parameters to set for the shaped window.
*
*
* \return 0 on success, -1 on invalid an invalid shape argument, or -2 if the SDL_Window* given does not reference
* \return 0 on success, -1 on invalid an invalid shape argument, or -2 if the SDL_Window* given does not reference
* a valid shaped window.
* a valid shaped window.
*
*
* \sa SDL_WindowShapeMode
* \sa SDL_WindowShapeMode
* \sa SDL_GetShape
Parameters
.
* \sa SDL_GetShape
dWindowMode
.
*/
*/
extern
DECLSPEC
int
SDLCALL
SDL_SetWindowShape
(
SDL_Window
*
window
,
SDL_Surface
*
shape
,
SDL_WindowShapeMode
parameters
);
extern
DECLSPEC
int
SDLCALL
SDL_SetWindowShape
(
SDL_Window
*
window
,
SDL_Surface
*
shape
,
SDL_WindowShapeMode
*
shapeMode
);
/**
/**
* \brief
S
et the shape parameters of a shaped window.
* \brief
G
et the shape parameters of a shaped window.
*
*
* \param window The shaped window whose parameters should be retrieved.
* \param window The shaped window whose parameters should be retrieved.
* \param shapeMode An empty shape-parameters structure to fill.
* \param shapeMode An empty shape-parameters structure to fill.
*
*
* \return 0 on success, -1 on a null shapeMode, or -2 if the SDL_Window given is not a shaped window.
* \return 0 on success, -1 on a null shapeMode, or -2 if the SDL_Window given is not a shaped window, or -3 if the
* SDL_Window given is a window that can be shaped but isn't.
*
*
* \sa SDL_WindowShapeMode
* \sa SDL_WindowShapeMode
* \sa SDL_Set
ShapeParameters
* \sa SDL_Set
WindowShape
*/
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetShape
Parameters
(
SDL_Window
*
window
,
SDL_WindowShapeMode
*
shapeMode
);
extern
DECLSPEC
int
SDLCALL
SDL_GetShape
dWindowMode
(
SDL_Window
*
window
,
SDL_WindowShapeMode
*
shapeMode
);
/* Ends C function definitions when using C++ */
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
#ifdef __cplusplus
...
...
src/video/SDL_shape.c
View file @
2c8b1ce8
...
@@ -30,11 +30,11 @@ SDL_Window* SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int
...
@@ -30,11 +30,11 @@ SDL_Window* SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int
return
NULL
;
return
NULL
;
}
}
SDL_bool
SDL_
WindowIsShaped
(
const
SDL_Window
*
window
)
{
SDL_bool
SDL_
IsShapedWindow
(
const
SDL_Window
*
window
)
{
return
SDL_FALSE
;
return
SDL_FALSE
;
}
}
int
SDL_SetWindowShape
(
SDL_Window
*
window
,
SDL_Surface
*
shape
,
SDL_WindowShapeMode
parameters
)
{
int
SDL_SetWindowShape
(
SDL_Window
*
window
,
SDL_Surface
*
shape
,
SDL_WindowShapeMode
*
shapeMode
)
{
if
(
window
==
NULL
||
!
SDL_WindowIsShaped
(
window
))
if
(
window
==
NULL
||
!
SDL_WindowIsShaped
(
window
))
return
-
2
;
return
-
2
;
if
(
shape
==
NULL
)
if
(
shape
==
NULL
)
...
@@ -42,7 +42,7 @@ int SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode
...
@@ -42,7 +42,7 @@ int SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode
return
-
3
;
return
-
3
;
}
}
int
SDL_GetShape
Parameters
(
SDL_Window
*
window
,
SDL_WindowShapeMode
*
shapeMode
)
{
int
SDL_GetShape
dWindowMode
(
SDL_Window
*
window
,
SDL_WindowShapeMode
*
shapeMode
)
{
if
(
shapeMode
==
NULL
)
if
(
shapeMode
==
NULL
)
return
-
1
;
return
-
1
;
if
(
window
==
NULL
||
!
SDL_WindowIsShaped
(
window
))
if
(
window
==
NULL
||
!
SDL_WindowIsShaped
(
window
))
...
...
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