65 lines
1.5 KiB
C++
65 lines
1.5 KiB
C++
#ifndef PIXELPIPELINE_H
|
|
#define PIXELPIPELINE_H
|
|
|
|
#include <pipeline.h>
|
|
#include <glm/mat4x4.hpp>
|
|
#include <glm/vec2.hpp>
|
|
|
|
class FrameBuffer;
|
|
class Texture;
|
|
class Shader;
|
|
class PixelMesh;
|
|
class MapScene;
|
|
class Mesh;
|
|
class Coord;
|
|
|
|
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;
|
|
glm::vec2 debugCursorPos;
|
|
Texture *m_cursorTex;
|
|
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);
|
|
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; }
|
|
|
|
Coord setCursorPosPicking(int mouseX, int mouseY);
|
|
void setCursorPos(const Coord &pos);
|
|
};
|
|
|
|
#endif // PIXELPIPELINE_H
|