2013-04-05 06:13:26 +00:00
|
|
|
#ifndef DEPTHBUFFER_H
|
|
|
|
#define DEPTHBUFFER_H
|
|
|
|
|
|
|
|
#include "Types.h"
|
2013-11-27 10:08:48 +00:00
|
|
|
#include "Textures.h"
|
2013-04-05 06:13:26 +00:00
|
|
|
|
|
|
|
struct DepthBuffer
|
|
|
|
{
|
|
|
|
DepthBuffer *higher, *lower;
|
|
|
|
|
2013-06-04 16:00:03 +00:00
|
|
|
u32 address, width;
|
2013-06-01 13:10:30 +00:00
|
|
|
GLuint renderbuf;
|
2013-10-30 06:07:24 +00:00
|
|
|
CachedTexture *depth_texture;
|
2013-11-12 07:35:26 +00:00
|
|
|
GLuint fbo;
|
2013-04-05 06:13:26 +00:00
|
|
|
};
|
|
|
|
|
2014-09-08 07:46:42 +00:00
|
|
|
struct DepthBufferList
|
2013-04-05 06:13:26 +00:00
|
|
|
{
|
|
|
|
DepthBuffer *top, *bottom, *current;
|
|
|
|
int numBuffers;
|
2014-09-08 07:46:42 +00:00
|
|
|
|
|
|
|
static DepthBufferList & get()
|
|
|
|
{
|
|
|
|
static DepthBufferList depthBufferList;
|
|
|
|
return depthBufferList;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
DepthBufferList() : current(NULL) {}
|
|
|
|
DepthBufferList(const FrameBufferList &);
|
2013-04-05 06:13:26 +00:00
|
|
|
};
|
|
|
|
|
2014-09-08 07:46:42 +00:00
|
|
|
inline
|
|
|
|
DepthBufferList & depthBufferList()
|
|
|
|
{
|
|
|
|
return DepthBufferList::get();
|
|
|
|
}
|
2013-04-05 06:13:26 +00:00
|
|
|
|
2013-12-14 14:30:20 +00:00
|
|
|
extern const GLuint ZlutImageUnit;
|
|
|
|
extern const GLuint TlutImageUnit;
|
|
|
|
extern const GLuint depthImageUnit;
|
|
|
|
|
2013-04-05 06:13:26 +00:00
|
|
|
void DepthBuffer_Init();
|
|
|
|
void DepthBuffer_Destroy();
|
|
|
|
void DepthBuffer_SetBuffer( u32 address );
|
|
|
|
void DepthBuffer_RemoveBuffer( u32 address );
|
2013-12-14 14:30:20 +00:00
|
|
|
void DepthBuffer_ClearBuffer();
|
2014-01-08 16:22:42 +00:00
|
|
|
DepthBuffer *DepthBuffer_FindBuffer( u32 address );
|
2013-04-05 06:13:26 +00:00
|
|
|
|
|
|
|
#endif
|