// Author: Alex V. Boreskoff <alexboreskoff@mtu-net.ru>, <steps3d@narod.ru>

#ifndef	__FRAME_BUFFER__
#define	__FRAME_BUFFER__

typedef struct
{
	int		bpp;
	int		stencil;
	int		width;
	int		height;
	GLuint	frameBuffer;					// id of framebuffer object
	GLuint	colorBuffer [8];				// texture id or buffer id
	GLuint	depthBuffer;
	GLuint	stencilBuffer;					// 
	GLint	saveViewport [4];				// saved viewport setting during bind
} fbuffer_t;

typedef enum								// flags for depth and stencil buffers
{
	stencil1  = 1,							// 1-bit stencil buffer
	stencil4  = 4,							// 4-bit stencil buffer
	stencil8  = 8,							// 8-bit stencil buffer
	stencil16 = 16							// 16-bit stencil buffer
};
	
typedef enum								// filter modes
{
	filterNearest = 0,
	filterLinear  = 1,
	filterMipmap  = 2
};

//extern	int	frameBuffer;

void FBO_Set	(int FBO_ID, int theWidth, int theHeight, int bpp, int stensil);
void FBO_Init	(void);
void FBO_Delete	(void);

/*
boolean CheckFramebufferStatus	(void);
void	RemoveFrameBuffer		(void);
boolean	FrameBufferBind			(void);
boolean	FrameBufferUnbind		(void);
boolean	FrameBufferAddTexture ( GLenum target, unsigned textureId, int ColorBuffer_N );
boolean	FrameBufferAddDepthTexture ( GLenum target, unsigned textureId );
unsigned FrameBufferCreateColorTexture ( GLenum format, GLenum internalFormat, GLenum clamp, int filter );
unsigned FrameBufferCreateColorRectTexture ( GLenum format, GLenum internalFormat );
const unsigned	getColorBuffer ( int ColorBuffer_N );
*/
#endif
