#ifndef	__P_BUFFER__
#define	__P_BUFFER__

#define	MAX_ATTRIBS		20
#define	MAX_PFORMATS	20

enum PBO_Mode
{
	modeAlpha          = 1,
	modeDepth          = 2,
	modeStencil        = 4,
	modeAccum          = 8,
	modeDouble         = 16,
	modeTexture1D      = 32,
	modeTexture2D      = 64,
	modeTextureCubeMap = 128,
	modeTextureMipmap  = 256
};

typedef struct
{
	HDC			hdc;
	HGLRC		hGlRc;
	HPBUFFERARB	hBuffer;
	int			width;
	int			height;
	int			mode;
	boolean		shareObjects;
	HDC			saveHdc;					// save values from from makeCurrent
	HGLRC		saveHglrc;
} pbuffer_t;

typedef struct
{
	int	attrs [2*MAX_ATTRIBS];
	int	numAttrs;
} AttrListint_t;

typedef struct
{
	float	attrs [2*MAX_ATTRIBS];
	int	numAttrs;
} AttrListfloat_t;

void PBO_Set (int theWidth, int theHeight, int theMode, boolean theShareObjects);
void PBO_Init (void);
void PBO_Delete (void);
boolean	PBO_Activate (void);
boolean	PBO_Deactivate (void);
boolean	PBO_BindToTexture (int buf);
boolean	PBO_UnbindFromTexture (int buf);
#endif
