1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-29 03:33:48 +00:00
Aquaria/BBGE/RenderState.h
fgenesis 70b8e69402 remove last traces of GL_BLEND/glBlendFunc() manipulation
everything goes through RenderState now
some calls are left in FTGL but properly invalidated afterwards
2024-01-11 23:05:47 +01:00

51 lines
989 B
C++

#ifndef BBGE_RENDERSTATE_H
#define BBGE_RENDERSTATE_H
#include "Vector.h"
#include "EngineEnums.h"
struct CombinedRenderAndGPUState;
// Only once of these exists at any time.
// It stores the known GPU state so that we don't need so many futile state changes
struct GPUState
{
friend struct CombinedRenderAndGPUState;
GPUState();
void setBlend(BlendType bt);
void invalidateBlend();
private:
BlendType _blendType;
};
// The RenderState is passed through the scene graph as each layer is rendered
// TODO: what needs to end up here? matrix stack too?
struct RenderState
{
GPUState& gpu;
Vector color;
Vector scale;
float alpha;
int pass;
bool forceRenderBorder;
bool forceRenderCenter;
Vector renderBorderColor;
float renderBorderAlpha;
protected:
RenderState(GPUState& gpu);
};
struct CombinedRenderAndGPUState : public RenderState
{
GPUState gpu;
CombinedRenderAndGPUState() : RenderState(gpu) {}
};
#endif