mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-24 22:55:40 +00:00
40c8259130
The standard triangle render requires gl 4.1 core, so should work on mac. The quad renderer runs on 4.5 core. The legacy renderer should still work, and when enabled a regular opengl context will be created, which allows functions marked depreciated in the core profiles to still work. This will only work in windows/linux I think. Apple doesn't support this. A GL 4.1 GPU is now the min required spec. Sorry if you have an OLDER gpu. GL 4.1 is over 12 years old now. This is a big update so I apologise in advance if I accidently broke something :]
62 lines
1.2 KiB
C++
62 lines
1.2 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
|
|
void CompositeBaseLayer();
|
|
void CompositeAlphaLayer();
|
|
void DrawOverTransLayers(); // opaque pixels in next priority layer need to wipe trans pixels
|
|
|
|
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 AllocShaderWipe();
|
|
|
|
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;
|
|
GLSLShader m_shaderWipe;
|
|
|
|
// vao
|
|
GLuint m_vao; // this really needed if we don't actually use vertex attribs?
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|