engine/include/Render/SalmonRender/SalmonRenderInterface.h

108 lines
2.8 KiB
C
Raw Normal View History

2013-01-19 20:02:34 +00:00
#ifndef SALMON_RENDER_INTERFACE_H_INCLUDED
#define SALMON_RENDER_INTERFACE_H_INCLUDED
#include "include/Utils/Utils.h"
#include "include/SimpleLand/SimpleLand.h"
#include "include/Render/RenderMisc.h"
#include "include/Render/SalmonRender/BackgroundCubemap.h"
#include "include/Render/RenderInterface.h"
namespace SE
{
class TSalmonRendererInterface : public TRendererInterface
{
protected:
float CamAlpha;
float CamPhi;
float CamDist;
vec3 CamShift;
vec3 CamPos; //Do not change - call CalcCamPosVec instead
vec3 CamVec; //Do not change - call CalcCamPosVec instead
mat4 CamModelViewMatrix;
mat4 CamInversedModelViewMatrix;
float GlobalShadowAreaHalfSize;
2024-06-05 18:19:20 +00:00
cardinal BkgTexID;
std::string BkgShaderName;
2024-06-08 17:56:35 +00:00
float FogBeginDistance;
float FogEndDistance;
vec4 FogColor;
2013-01-19 20:02:34 +00:00
void CalcCamPosVec();
virtual void DrawQuad(const T2DQuad& quad) = 0;
public:
TSalmonRendererInterface();
virtual void InitOpenGL(int screenWidth, int screenHeight, float matrixWidth, float matrixHeight);
virtual void SetUniforms();
void SetPerspectiveFullScreenViewport();
void SetOrthoFullScreenViewport();
mat4 GetModelviewMatrix();
void SetPerspectiveProjectionMatrix(float angle, float aspect, float zNear, float zFar);
void PushPerspectiveProjectionMatrix(float angle, float aspect, float zNear, float zFar);
2024-06-08 17:56:35 +00:00
void SetGLCamAngleView();
2013-01-19 20:02:34 +00:00
void SetGLCamView();
void SetGlIdentityView();
2024-06-08 22:09:40 +00:00
void SetGlPosXView(bool translate = true, bool renderToFrame = false);
void SetGlNegXView(bool translate = true, bool renderToFrame = false);
void SetGlPosYView(bool translate = true, bool renderToFrame = false);
void SetGlNegYView(bool translate = true, bool renderToFrame = false);
void SetGlPosZView(bool translate = true, bool renderToFrame = false);
void SetGlNegZView(bool translate = true, bool renderToFrame = false);
2013-01-19 20:02:34 +00:00
void MoveAlpha(float dAlpha);
void MovePhi(float dPhi);
void MoveDist(float dDist);
void SetAlpha(float alpha);
vec3 GetCamPos();
void MoveForward();
void MoveBackward();
void MoveLeft();
void MoveRight();
virtual void SwitchToScreen();
virtual void SwitchToFrameBuffer(const std::string& frameName);
void SwitchToCubemapBuffer(const std::string& frameName,cardinal cubeSide);
void BeginDrawToDepthBufferGlobal(std::string& globalBufferName);
void BeginDrawToDepthBufferLocal(std::string& localBufferName);
void EndDrawToDepthBuffer();
2024-06-05 18:19:20 +00:00
void SetBackgroundCubemap(cardinal bkgTex) { BkgTexID = bkgTex; }
void SetBackgroundShader(const std::string& shaderName) { BkgShaderName = shaderName; }
void DrawBackground();
2024-06-08 17:56:35 +00:00
float GetFogBeginDistance();
float GetFogEndDistance();
vec4 GetFogColor();
void SetFogBeginDistance(float distance);
void SetFogEndDistance(float distance);
2013-01-19 20:02:34 +00:00
};
} //namespace SE
#endif