terravisor/include/scene.h

52 lines
1.1 KiB
C
Raw Normal View History

2024-08-13 16:25:56 -04:00
#ifndef SCENE_H_
#define SCENE_H_
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
2024-08-15 00:56:29 -04:00
#include <vector>
#include <string>
2024-08-13 16:25:56 -04:00
#include "fbo.h"
2024-08-13 16:25:56 -04:00
class Scene {
2024-08-13 18:09:49 -04:00
public:
Scene(int width, int height);
~Scene();
void Init();
void Display(GLFWwindow* window);
void DrawGui(GLFWwindow* window);
void Idle();
void ReloadShader();
2024-08-15 00:56:29 -04:00
std::vector<int16_t> LoadHGT(const std::string& filename, int width, int height);
2024-08-13 18:09:49 -04:00
int window_width;
int window_height;
private:
void InitBuffers();
void InitQuadBuffers();
2024-08-13 18:09:49 -04:00
void InitShaders();
FBO fbo_;
FBO post_fbo_;
2024-08-13 18:09:49 -04:00
GLuint shader_program_;
GLuint quad_shader_program_;
2024-08-13 18:09:49 -04:00
GLuint vao_;
GLuint quad_vao_;
2024-08-13 18:09:49 -04:00
float angle_;
float scale_;
float aspect_;
float near_z_;
float far_z_;
float fov_;
glm::mat4 view_matrix_;
glm::mat4 projection_matrix_;
void UpdateCamera();
2024-08-15 01:09:37 -04:00
int16_t SwapEndian(int16_t val);
2024-08-15 00:56:29 -04:00
GLuint CreateHeightmapTexture(std::vector<int16_t> data, int width, int height);
2024-08-13 16:25:56 -04:00
};
#endif // SCENE_H_