58 lines
1.3 KiB
C++
58 lines
1.3 KiB
C++
#ifndef PIXELPIPELINE_H
|
|
#define PIXELPIPELINE_H
|
|
|
|
#include <pipeline.h>
|
|
#include <glm/mat4x4.hpp>
|
|
|
|
class FrameBuffer;
|
|
class Texture;
|
|
class Shader;
|
|
class PixelMesh;
|
|
class MapScene;
|
|
class Mesh;
|
|
|
|
class PixelPipeline : public Pipeline
|
|
{
|
|
private:
|
|
FrameBuffer *m_mapFBO;
|
|
Texture *m_mapTex;
|
|
Shader *m_texMapShader;
|
|
Texture *m_skyTexFront;
|
|
Texture *m_skyTexBack;
|
|
Shader *m_skyboxShader;
|
|
MapScene *m_map;
|
|
int m_mapWidth;
|
|
int m_mapHeight;
|
|
const FrameBuffer *m_targetFBO;
|
|
Shader *m_renderShader;
|
|
int m_width;
|
|
int m_height;
|
|
float m_surfaceRatio;
|
|
float m_flatSphere;
|
|
glm::vec3 m_camera;
|
|
bool m_showToreiller;
|
|
|
|
Mesh *m_toreiller;
|
|
glm::mat4 m_proj;
|
|
glm::mat4 m_view;
|
|
|
|
public:
|
|
PixelPipeline(MapScene *map);
|
|
~PixelPipeline();
|
|
|
|
void updateChanges();
|
|
void setTargetFBO(FrameBuffer *fbo) {m_targetFBO = fbo;}
|
|
|
|
virtual void renderGL(Scene *scene);
|
|
virtual void resizeGL(int w, int h);
|
|
|
|
void cameraMove(int x, int y) { m_camera.x -= x/(m_camera.z*m_width); m_camera.y += y/(m_camera.z*m_width); }
|
|
void cameraZoom(int nbScrolls);
|
|
|
|
void setSurfaceRatio(float surfaceRatio) { m_surfaceRatio = surfaceRatio; }
|
|
void setFlatSphere(float flatSphere) { m_flatSphere = flatSphere; }
|
|
void setShowToreiller(bool showToreiller) { m_showToreiller = showToreiller; }
|
|
};
|
|
|
|
#endif // PIXELPIPELINE_H
|