/*
*     ___                       ___
*    / _ \___ _    _____ ____  / _ \_______ __    __
*   / ___/ _ \ |/|/ / -_) __/ / // / __/ _ `/ |/|/ /
*  /_/   \___/__,__/\__/_/   /____/_/  \_,_/|__,__/
*
*
*   Original Code by John Garrison
*   Written June 10-11,17-18 August 5,6 1999
*   To be released under the LGPL
*
*   Setting of graphics modes and buffers.
*
*   See LICENSE.TXT for more LGPL info
*/

#ifndef _PD_gfx_H
#define _PD_gfx_H

#ifdef __cplusplus
extern "C" {
#endif

#include "powerdraw.h"

#define PD_DEFAULT 0
#define PD_FULLSCREEN 1
#define PD_DEFAULTDIRECT 2
#define PD_FULLSCREENDIRECT 3

int PD_SetGFXMode (int XRes, int YRes, int Bpp, Uint32 Mode);

int PD_CreateDoubleBuffer();
int PD_DestroyDoubleBuffer();
int PD_ShowDoubleBuffer();
int PD_UpdateWholeScreen();
int PD_UpdateScreen(int X, int Y, int W, int H);
int PD_DoesDoubleBufferExist(void);

PD_Surface *PD_CreateSurface(int Width, int Height);
PD_Surface *PD_CreateSurfaceBPP(int Width, int Height, int Bpp);
int PD_DestroySurface (PD_Surface *Surface);
int PD_Blit (PD_Surface *Src, PD_Surface *Dest, Sint32 SrcX, Sint32 SrcY, Sint32 DestX, Sint32 DestY, Uint32 W, Uint32 H);
int PD_BlitAsIs (PD_Surface *Src, PD_Surface *Dest, Sint32 SrcX, Sint32 SrcY, Sint32 DestX, Sint32 DestY, Uint32 W, Uint32 H);
int PD_BlitTransparent (PD_Surface *Src, PD_Surface *Dest, Sint32 SrcX, Sint32 SrcY, Sint32 DestX, Sint32 DestY, Uint32 W, Uint32 H, PD_Color Clear, Uint8 Alpha);
int PD_EasyBlit(int Xpos,int Ypos,PD_Surface *image);
int PD_ClearSurface (PD_Surface *Surface, PD_Color Color);
int PD_SetColorKeys(PD_Surface *Surface, PD_Color Clear, int Alpha);

int PD_SetClippingRect (PD_Surface *Surface, Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2);

PD_Palette PD_InitPalette();
int PD_SetPalette (PD_Surface *Surface, PD_Palette Palette);
int PD_EditPalette (PD_Surface *Surface, PD_RGB *Colors, Uint8 StartColor, Uint16 NumColors);
PD_Palette *PD_GetPalette (PD_Surface *Surface);
PD_RGB PD_FillPaletteEntry (Uint8 R, Uint8 G, Uint8 B);
PD_Color PD_CreateColor (PD_Surface *Surface, Uint8 R, Uint8 G, Uint8 B);
PD_RGB PD_GetRGB (PD_Surface *Surface, PD_Color Color);
int PD_FreePalette (PD_Palette Pal);

PD_Surface *PD_LoadImage(const char *file);

PD_Surface *PD_SurfaceVFlipped (PD_Surface *Surface);
PD_Surface *PD_SurfaceHFlipped (PD_Surface *Surface);
PD_Surface *PD_SurfaceVHFlipped (PD_Surface *Surface);

PD_Surface *PD_RotateSurface (PD_Surface *Surface, int Angle);
PD_Surface *PD_XShearSurface(PD_Surface *Surface, int XShear);
PD_Surface *PD_YShearSurface(PD_Surface *Surface, int YShear);
PD_Surface *PD_ScaleSurfacePart(PD_Surface *Surface, long SrcX1, long SrcY1, long SrcX2, long SrcY2, long Width, long Height);
PD_Surface *PD_ScaleSurfacePartBy(PD_Surface *Surface, long SrcX1, long SrcY1, long SrcX2, long SrcY2, float XFactor, float YFactor);
PD_Surface *PD_ScaleSurface(PD_Surface *Surface, long Width, long Height);
PD_Surface *PD_ScaleSurfaceBy(PD_Surface *Surface, float XFactor, float YFactor);

#ifdef __cplusplus
};
#endif

#endif
