Moved SDL_shape.h, and building out the API as needed by SDL_Eyes.
authorEli Gottlieb <eligottlieb@gmail.com>
Fri, 21 May 2010 17:28:12 -0400
changeset 47667b50faf23907
parent 4765 5ff305de5834
child 4767 dc3fd9b7fcbc
Moved SDL_shape.h, and building out the API as needed by SDL_Eyes.
include/SDL_shape.h
src/video/SDL_shape.c
src/video/SDL_shape.h
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/SDL_shape.h	Fri May 21 17:28:12 2010 -0400
     1.3 @@ -0,0 +1,55 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 2010 Eli Gottlieb
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Lesser General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2.1 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Lesser General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Lesser General Public
    1.19 +    License along with this library; if not, write to the Free Software
    1.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 +
    1.22 +    Eli Gottlieb
    1.23 +    eligottlieb@gmail.com
    1.24 +*/
    1.25 +
    1.26 +struct SDL_Shaped_Window;
    1.27 +typedef struct SDL_Shaped_Window SDL_Shaped_Window;
    1.28 +
    1.29 +/**
    1.30 + *  \brief Create a shaped window with the specified position, dimensions, and flags.
    1.31 + *  
    1.32 + *  \param title The title of the window, in UTF-8 encoding.
    1.33 + *  \param x     The x position of the window, ::SDL_WINDOWPOS_CENTERED, or 
    1.34 + *               ::SDL_WINDOWPOS_UNDEFINED.
    1.35 + *  \param y     The y position of the window, ::SDL_WINDOWPOS_CENTERED, or 
    1.36 + *               ::SDL_WINDOWPOS_UNDEFINED.
    1.37 + *  \param w     The width of the window.
    1.38 + *  \param h     The height of the window.
    1.39 + *  \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following: 
    1.40 + *               ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL, 
    1.41 + *               ::SDL_WINDOW_SHOWN,      ::SDL_WINDOW_RESIZABLE,
    1.42 + *               ::SDL_WINDOW_MAXIMIZED,  ::SDL_WINDOW_MINIMIZED,
    1.43 + *               ::SDL_WINDOW_INPUT_GRABBED.
    1.44 + *  
    1.45 + *  \return The id of the window created, or zero if window creation failed.
    1.46 + *  
    1.47 + *  \sa SDL_DestroyWindow()
    1.48 + */
    1.49 +extern DECLSPEC SDL_Shaped_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags);
    1.50 +
    1.51 +extern DECLSPEC SDL_Surface * SDLCALL SDL_LockWindowShape(const SDL_Shaped_Window *window);
    1.52 +extern DECLSPEC void SDLCALL SDL_UnlockWindowShape(const SDL_Shaped_Window *window);
    1.53 +extern DECLSPEC int SDLCALL SDL_PresentWindowShape(const SDL_Shaped_Window *window);
    1.54 +
    1.55 +extern DECLSPEC SDL_Window * SDLCALL SDL_LockShapedWindow(const SDL_Shaped_Window *window);
    1.56 +extern DECLSPEC void SDLCALL SDL_UnlockShapedWindow(const SDL_Shaped_Window *window);
    1.57 +
    1.58 +extern DECLSPEC void SDLCALL SDL_DestroyShapedWindow(const SDL_Shaped_Window *window);
     2.1 --- a/src/video/SDL_shape.c	Fri May 21 14:50:04 2010 -0400
     2.2 +++ b/src/video/SDL_shape.c	Fri May 21 17:28:12 2010 -0400
     2.3 @@ -21,3 +21,26 @@
     2.4  */
     2.5  
     2.6  #include "SDL_shape.h"
     2.7 +
     2.8 +struct SDL_Shaped_Window {
     2.9 +	SDL_Window *window;
    2.10 +	SDL_Surface *shape_mask;
    2.11 +}
    2.12 +
    2.13 +SDL_Shaped_Window * SDLCALL SDL_CreateShapedWindow(const char *title,
    2.14 +						   unsigned int x,unsigned int y,
    2.15 +						   unsigned int w,unsigned int h,
    2.16 +						   Uint32 flags) {
    2.17 +	//TODO: Fill in stub of SDL_CreatedShapedWindow
    2.18 +	return NULL;
    2.19 +}
    2.20 +
    2.21 +int SDLCALL SDL_PresentShape(const SDL_Shaped_Window *window) {
    2.22 +	//TODO: Fill in stub of SDL_PresentShape
    2.23 +	return -1;
    2.24 +}
    2.25 +
    2.26 +void SDLCALL SDL_DestroyShapedWindow(const SDL_Shaped_Window *window) {
    2.27 +	//TODO: Fill in stub of SDL_DestroyShapedWindow
    2.28 +	return;
    2.29 +}
     3.1 --- a/src/video/SDL_shape.h	Fri May 21 14:50:04 2010 -0400
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,21 +0,0 @@
     3.4 -/*
     3.5 -    SDL - Simple DirectMedia Layer
     3.6 -    Copyright (C) 2010 Eli Gottlieb
     3.7 -
     3.8 -    This library is free software; you can redistribute it and/or
     3.9 -    modify it under the terms of the GNU Lesser General Public
    3.10 -    License as published by the Free Software Foundation; either
    3.11 -    version 2.1 of the License, or (at your option) any later version.
    3.12 -
    3.13 -    This library is distributed in the hope that it will be useful,
    3.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    3.16 -    Lesser General Public License for more details.
    3.17 -
    3.18 -    You should have received a copy of the GNU Lesser General Public
    3.19 -    License along with this library; if not, write to the Free Software
    3.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    3.21 -
    3.22 -    Eli Gottlieb
    3.23 -    eligottlieb@gmail.com
    3.24 -*/