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
4922edee
Commit
4922edee
authored
Jul 19, 2010
by
Eli Gottlieb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added #define's for error codes returned from SDL shaped-window API.
parent
68fccc09
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
SDL_shape.h
include/SDL_shape.h
+9
-5
SDL_shape.c
src/video/SDL_shape.c
+4
-4
No files found.
include/SDL_shape.h
View file @
4922edee
...
@@ -42,6 +42,10 @@ extern "C" {
...
@@ -42,6 +42,10 @@ extern "C" {
* Header file for the shaped window API.
* Header file for the shaped window API.
*/
*/
#define SDL_NONSHAPEABLE_WINDOW -1
#define SDL_INVALID_SHAPE_ARGUMENT -2
#define SDL_WINDOW_LACKS_SHAPE -3
/**
/**
* \brief Create a window that can be shaped with the specified position, dimensions, and flags.
* \brief Create a window that can be shaped with the specified position, dimensions, and flags.
*
*
...
@@ -58,7 +62,7 @@ extern "C" {
...
@@ -58,7 +62,7 @@ extern "C" {
* ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED,
* ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED,
* ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset.
* ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset.
*
*
* \return The
id of the window created, or zero
if window creation failed.
* \return The
window created, or NULL
if window creation failed.
*
*
* \sa SDL_DestroyWindow()
* \sa SDL_DestroyWindow()
*/
*/
...
@@ -102,8 +106,8 @@ typedef struct SDL_WindowShapeMode {
...
@@ -102,8 +106,8 @@ typedef struct SDL_WindowShapeMode {
* \param shape A surface encoding the desired shape for the window.
* \param shape A surface encoding the desired shape for the window.
* \param shapeMode 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,
SDL_INVALID_SHAPE_ARGUMENT on invalid an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
* a valid shaped window.
*
if the SDL_Window* given does not reference
a valid shaped window.
*
*
* \sa SDL_WindowShapeMode
* \sa SDL_WindowShapeMode
* \sa SDL_GetShapedWindowMode.
* \sa SDL_GetShapedWindowMode.
...
@@ -117,8 +121,8 @@ extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *s
...
@@ -117,8 +121,8 @@ extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *s
* \param shapeMode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
* \param shapeMode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
*
*
* \return 0 if the window has a shape and, provided shapeMode was not NULL, shapeMode has been filled with the mode
* \return 0 if the window has a shape and, provided shapeMode was not NULL, shapeMode has been filled with the mode
* data,
-1 if the SDL_Window given is not a shaped window, or -2 if the SDL_Window* given is a shapeable
* data,
SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
* window currently lacking a shape.
*
the SDL_Window* given is a shapeable
window currently lacking a shape.
*
*
* \sa SDL_WindowShapeMode
* \sa SDL_WindowShapeMode
* \sa SDL_SetWindowShape
* \sa SDL_SetWindowShape
...
...
src/video/SDL_shape.c
View file @
4922edee
...
@@ -82,10 +82,10 @@ int SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode
...
@@ -82,10 +82,10 @@ int SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode
int
result
;
int
result
;
if
(
window
==
NULL
||
!
SDL_IsShapedWindow
(
window
))
if
(
window
==
NULL
||
!
SDL_IsShapedWindow
(
window
))
//The window given was not a shapeable window.
//The window given was not a shapeable window.
return
-
2
;
return
SDL_NONSHAPEABLE_WINDOW
;
if
(
shape
==
NULL
)
if
(
shape
==
NULL
)
//Invalid shape argument.
//Invalid shape argument.
return
-
1
;
return
SDL_INVALID_SHAPE_ARGUMENT
;
if
(
shapeMode
!=
NULL
)
{
if
(
shapeMode
!=
NULL
)
{
switch
(
shapeMode
->
mode
)
{
switch
(
shapeMode
->
mode
)
{
...
@@ -123,7 +123,7 @@ int SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shapeMode) {
...
@@ -123,7 +123,7 @@ int SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shapeMode) {
return
0
;
return
0
;
else
else
//The window given is shapeable but lacks a shape.
//The window given is shapeable but lacks a shape.
return
-
2
;
return
SDL_WINDOW_LACKS_SHAPE
;
}
}
else
{
else
{
if
(
window
->
shaper
->
alphacutoff
!=
1
)
{
if
(
window
->
shaper
->
alphacutoff
!=
1
)
{
...
@@ -137,5 +137,5 @@ int SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shapeMode) {
...
@@ -137,5 +137,5 @@ int SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shapeMode) {
}
}
else
else
//The window given is not a valid shapeable window.
//The window given is not a valid shapeable window.
return
-
1
;
return
SDL_NONSHAPEABLE_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