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