mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-26 23:55:40 +00:00
6595b9320e
Some games update the tilegen after the ping_ping bit has flipped at 66% of the frame, so we need to split the tilegen drawing up into two stages to get some effects to work. So having the tilegen draw independantly of the 3d chip can make this happen.
57 lines
1 KiB
C++
57 lines
1 KiB
C++
#ifndef FBO_H
|
|
#define FBO_H
|
|
|
|
#include <GL/glew.h>
|
|
#include "VBO.h"
|
|
#include "GLSLShader.h"
|
|
#include "Model.h"
|
|
|
|
namespace New3D {
|
|
|
|
class R3DFrameBuffers {
|
|
|
|
public:
|
|
R3DFrameBuffers();
|
|
~R3DFrameBuffers();
|
|
|
|
void Draw(); // draw and composite the transparent layers
|
|
|
|
bool CreateFBO(int width, int height);
|
|
void DestroyFBO();
|
|
|
|
void BindTexture(Layer layer);
|
|
void SetFBO(Layer layer);
|
|
void StoreDepth();
|
|
void RestoreDepth();
|
|
|
|
private:
|
|
|
|
bool CreateFBODepthCopy(int width, int height);
|
|
GLuint CreateTexture(int width, int height);
|
|
void AllocShaderTrans();
|
|
void AllocShaderBase();
|
|
|
|
void DrawBaseLayer();
|
|
void DrawAlphaLayer();
|
|
|
|
GLuint m_frameBufferID;
|
|
GLuint m_renderBufferID;
|
|
GLuint m_texIDs[3];
|
|
GLuint m_frameBufferIDCopy;
|
|
GLuint m_renderBufferIDCopy;
|
|
Layer m_lastLayer;
|
|
int m_width;
|
|
int m_height;
|
|
|
|
// shaders
|
|
GLSLShader m_shaderBase;
|
|
GLSLShader m_shaderTrans;
|
|
|
|
// vao
|
|
GLuint m_vao; // this really needed if we don't actually use vertex attribs?
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|