aboutsummaryrefslogtreecommitdiff
path: root/apps/openmb/renderer/Skybox.hpp
blob: 656494fe80ce771247b8f2ae02def07e164a3595 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once

#include <glm/glm.hpp>
#include <string>
#include <vector>

#ifdef __APPLE__
#include <OpenGL/gl3.h>
#else
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#endif

namespace renderer {
class Skybox {
  public:
    Skybox();
    ~Skybox();

    bool loadFromDirectory( const std::string& dirPath );

    void draw( const glm::mat4& view, const glm::mat4& proj );

  private:
    bool loadFaces( const std::vector<std::string>& faces );
    void initMesh();

    GLuint mTexID;
    GLuint mVAO;
    GLuint mVBO;
    bool   mInitialized;
};

}   // namespace renderer