src/video/SDL_shape_internals.h
author egottlieb
Sat, 14 Aug 2010 20:29:51 -0400
changeset 4850 14870d46ee2d
parent 4837 2e446923c9fb
child 5535 96594ac5fd1a
permissions -rw-r--r--
Mostly seem to have fixed SDL_CalculateShapeTree. Mostly. There still seem to be some rendering artifacts, stepping effects, and such on Windows -- which indicates subtle logic errors in SDL_CalculateShapeTree().

Oh well, back into the salt mine.
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 2010 Eli Gottlieb
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Eli Gottlieb
    20     eligottlieb@gmail.com
    21 */
    22 #include "SDL_config.h"
    23 
    24 #ifndef _SDL_shape_internals_h
    25 #define _SDL_shape_internals_h
    26 
    27 #include "SDL_rect.h"
    28 #include "SDL_shape.h"
    29 #include "SDL_surface.h"
    30 
    31 #include "begin_code.h"
    32 /* Set up for C function definitions, even when using C++ */
    33 #ifdef __cplusplus
    34 /* *INDENT-OFF* */
    35 extern "C" {
    36 /* *INDENT-ON* */
    37 #endif
    38 
    39 typedef struct {
    40 	struct SDL_ShapeTree *upleft,*upright,*downleft,*downright;
    41 } SDL_QuadTreeChildren;
    42 
    43 typedef union {
    44 	SDL_QuadTreeChildren children;
    45 	SDL_Rect shape;
    46 } SDL_ShapeUnion;
    47 
    48 typedef enum { QuadShape,TransparentShape,OpaqueShape } SDL_ShapeKind;
    49 
    50 typedef struct {
    51 	SDL_ShapeKind kind;
    52 	SDL_ShapeUnion data;
    53 } SDL_ShapeTree;
    54 	
    55 typedef void(*SDL_TraversalFunction)(SDL_ShapeTree*,void*);
    56 
    57 extern void SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb);
    58 extern SDL_ShapeTree* SDL_CalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* shape);
    59 extern void SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* closure);
    60 extern void SDL_FreeShapeTree(SDL_ShapeTree** shape_tree);
    61 
    62 /* Ends C function definitions when using C++ */
    63 #ifdef __cplusplus
    64 /* *INDENT-OFF* */
    65 }
    66 /* *INDENT-ON* */
    67 #endif
    68 #include "close_code.h"
    69 
    70 #endif