src/video/SDL_shape_internals.h
author Ryan C. Gordon <icculus@icculus.org>
Sun, 24 Nov 2013 23:56:17 -0500
changeset 8093 b43765095a6f
parent 6885 700f1b25f77f
child 8149 681eb46b8ac4
permissions -rw-r--r--
Make internal SDL sources include SDL_internal.h instead of SDL_config.h

The new header will include SDL_config.h, but allows for other global stuff.
eligottlieb@4814
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@6885
     3
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
eligottlieb@4814
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
eligottlieb@4814
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
eligottlieb@4814
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
eligottlieb@4814
    20
*/
icculus@8093
    21
#include "../SDL_internal.h"
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;
egottlieb@4830
    53
	
egottlieb@4830
    54
typedef void(*SDL_TraversalFunction)(SDL_ShapeTree*,void*);
eligottlieb@4814
    55
eligottlieb@4817
    56
extern void SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb);
egottlieb@4837
    57
extern SDL_ShapeTree* SDL_CalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* shape);
egottlieb@4830
    58
extern void SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* closure);
egottlieb@4850
    59
extern void SDL_FreeShapeTree(SDL_ShapeTree** shape_tree);
eligottlieb@4814
    60
eligottlieb@4814
    61
/* Ends C function definitions when using C++ */
eligottlieb@4814
    62
#ifdef __cplusplus
eligottlieb@4814
    63
/* *INDENT-OFF* */
eligottlieb@4814
    64
}
eligottlieb@4814
    65
/* *INDENT-ON* */
eligottlieb@4814
    66
#endif
eligottlieb@4814
    67
#include "close_code.h"
eligottlieb@4814
    68
eligottlieb@4814
    69
#endif