engine/include/Render/SalmonRender/SalmonRenderInterface.h

92 lines
2.2 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"
2013-01-27 21:31:32 +00:00
#include "include/Render/SalmonRender/Cameras.h"
2013-01-23 20:58:15 +00:00
2013-01-27 21:31:32 +00:00
namespace SE
2013-01-23 20:58:15 +00:00
{
2013-01-19 20:02:34 +00:00
class TSalmonRendererInterface : public TRendererInterface
{
protected:
mat4 CamModelViewMatrix;
mat4 CamInversedModelViewMatrix;
float GlobalShadowAreaHalfSize;
virtual void DrawQuad(const T2DQuad& quad) = 0;
public:
2013-01-23 20:58:15 +00:00
TCamera CameraMover;
//vec3 CamShift;
vec3 CamPos; //Do not change - call CalcCamPosVec instead
//vec3 CamVec; //Do not change - call CalcCamPosVec instead
vec3 GetCamShift()
{
return boost::apply_visitor(TGetCamShiftVisitor(), CameraMover);
}
vec3 GetCamVec()
{
return boost::apply_visitor(TGetCamVecVisitor(), CameraMover);
}
2013-01-19 20:02:34 +00:00
TSalmonRendererInterface();
virtual void InitOpenGL(int screenWidth, int screenHeight, float matrixWidth, float matrixHeight);
2013-01-23 20:58:15 +00:00
void CalcCamPosVec();
2013-01-19 20:02:34 +00:00
virtual void SetUniforms();
void SetPerspectiveFullScreenViewport();
void SetOrthoFullScreenViewport();
2013-01-27 21:31:32 +00:00
void SetPerspectiveProjection(float angle = pi/6.f, float zNear = 1.f, float zFar = 100.f);
void SetOrthoProjection();
2013-01-19 20:02:34 +00:00
mat4 GetModelviewMatrix();
void SetPerspectiveProjectionMatrix(float angle, float aspect, float zNear, float zFar);
void PushPerspectiveProjectionMatrix(float angle, float aspect, float zNear, float zFar);
void SetGLCamView();
void SetGlIdentityView();
void SetGlPosXView();
void SetGlNegXView();
void SetGlPosYView();
void SetGlNegYView();
void SetGlPosZView();
void SetGlNegZView();
vec3 GetCamPos();
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();
};
} //namespace SE
#endif