2019-12-23 14:40:17 +00:00
|
|
|
#ifndef __GL_FRAMEBUFFER
|
|
|
|
#define __GL_FRAMEBUFFER
|
|
|
|
|
|
|
|
#include "gl_sysfb.h"
|
2020-05-31 08:41:59 +00:00
|
|
|
#include "m_png.h"
|
2019-12-23 14:40:17 +00:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace OpenGLRenderer
|
|
|
|
{
|
|
|
|
|
2020-05-31 08:41:59 +00:00
|
|
|
class FHardwareTexture;
|
2019-12-23 14:40:17 +00:00
|
|
|
class FGLDebug;
|
|
|
|
|
|
|
|
class OpenGLFrameBuffer : public SystemGLFrameBuffer
|
|
|
|
{
|
|
|
|
typedef SystemGLFrameBuffer Super;
|
|
|
|
|
2020-05-31 08:41:59 +00:00
|
|
|
void RenderTextureView(FCanvasTexture* tex, std::function<void(IntRect &)> renderFunc) override;
|
|
|
|
|
2019-12-23 14:40:17 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
explicit OpenGLFrameBuffer() {}
|
|
|
|
OpenGLFrameBuffer(void *hMonitor, bool fullscreen) ;
|
|
|
|
~OpenGLFrameBuffer();
|
|
|
|
|
|
|
|
void InitializeState() override;
|
|
|
|
void Update() override;
|
|
|
|
|
2020-05-31 08:41:59 +00:00
|
|
|
void AmbientOccludeScene(float m5) override;
|
|
|
|
void FirstEye() override;
|
|
|
|
void NextEye(int eyecount) override;
|
|
|
|
void SetSceneRenderTarget(bool useSSAO) override;
|
|
|
|
void UpdateShadowMap() override;
|
|
|
|
void WaitForCommands(bool finish) override;
|
|
|
|
void SetSaveBuffers(bool yes) override;
|
|
|
|
void CopyScreenToBuffer(int width, int height, uint8_t* buffer) override;
|
|
|
|
bool FlipSavePic() const override { return true; }
|
|
|
|
|
|
|
|
FRenderState* RenderState() override;
|
|
|
|
void UpdatePalette() override;
|
2019-12-23 14:40:17 +00:00
|
|
|
const char* DeviceName() const override;
|
2020-05-28 23:03:01 +00:00
|
|
|
void SetTextureFilterMode() override;
|
2020-05-31 19:25:52 +00:00
|
|
|
IHardwareTexture *CreateHardwareTexture(int numchannels) override;
|
2020-05-31 08:41:59 +00:00
|
|
|
void PrecacheMaterial(FMaterial *mat, int translation) override;
|
2019-12-23 14:40:17 +00:00
|
|
|
void BeginFrame() override;
|
2020-05-31 08:41:59 +00:00
|
|
|
void SetViewportRects(IntRect *bounds) override;
|
2019-12-23 14:40:17 +00:00
|
|
|
void BlurScene(float amount) override;
|
|
|
|
IVertexBuffer *CreateVertexBuffer() override;
|
|
|
|
IIndexBuffer *CreateIndexBuffer() override;
|
2019-12-28 21:36:47 +00:00
|
|
|
IDataBuffer *CreateDataBuffer(int bindingpoint, bool ssbo, bool needsresize) override;
|
2019-12-23 14:40:17 +00:00
|
|
|
|
2022-04-25 09:13:55 +00:00
|
|
|
void InitLightmap(int LMTextureSize, int LMTextureCount, TArray<uint16_t>& LMTextureData) override;
|
|
|
|
|
2019-12-23 14:40:17 +00:00
|
|
|
// Retrieves a buffer containing image data for a screenshot.
|
|
|
|
// Hint: Pitch can be negative for upside-down images, in which case buffer
|
|
|
|
// points to the last row in the buffer, which will be the first row output.
|
|
|
|
virtual TArray<uint8_t> GetScreenshotBuffer(int &pitch, ESSType &color_type, float &gamma) override;
|
|
|
|
|
|
|
|
void Swap();
|
|
|
|
bool IsHWGammaActive() const { return HWGammaActive; }
|
|
|
|
|
2020-07-23 14:35:54 +00:00
|
|
|
void SetVSync(bool vsync) override;
|
2019-12-23 14:40:17 +00:00
|
|
|
|
2020-05-31 08:41:59 +00:00
|
|
|
void Draw2D() override;
|
2020-06-07 13:02:54 +00:00
|
|
|
void PostProcessScene(bool swscene, int fixedcm, float flash, const std::function<void()> &afterBloomDrawEndScene2D) override;
|
2019-12-23 14:40:17 +00:00
|
|
|
|
|
|
|
bool HWGammaActive = false; // Are we using hardware or software gamma?
|
|
|
|
std::shared_ptr<FGLDebug> mDebug; // Debug API
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-05-31 08:41:59 +00:00
|
|
|
FTexture *WipeStartScreen() override;
|
|
|
|
FTexture *WipeEndScreen() override;
|
|
|
|
|
2019-12-23 14:40:17 +00:00
|
|
|
int camtexcount = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //__GL_FRAMEBUFFER
|