Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
skybox.h
1
#ifndef OE_RENDER_SKYBOX_H
2
#define OE_RENDER_SKYBOX_H
3
4
#include "../common.h"
5
#include <memory>
6
#include "shader.h"
7
#include "mesh.h"
8
#include "cubemap.h"
9
10
namespace
oe::scene
11
{
12
class
Camera;
13
}
14
15
namespace
oe::render
16
{
17
class
Texture;
18
class
Cubemap;
19
class
Shader;
20
class
ScreenQuad;
21
class
Mesh;
22
23
24
// Todo : template ?
25
26
class
Skybox
27
{
28
public
:
29
30
//Skybox(const std::vector<std::string>& filenames);
31
//Skybox(const std::string& equirectangular_file, const bool& is_hdr = true);
32
33
virtual
~Skybox
() {}
34
35
virtual
void
render(
const
oe::scene::Camera
& camera) = 0;
36
};
37
41
class
CubicSkybox
:
public
Skybox
42
{
43
public
:
44
CubicSkybox
(std::shared_ptr<Cubemap> cubemap);
45
46
inline
std::shared_ptr<Cubemap> getCubemap()
const
47
{
48
return
_cubemap;
49
}
50
51
inline
void
setCubemap(std::shared_ptr<oe::render::Cubemap> cubemap)
52
{
53
_cubemap = cubemap;
54
}
55
56
void
render(
const
oe::scene::Camera
& camera)
override
;
57
58
private
:
59
Mesh
_cube;
60
std::shared_ptr<Cubemap> _cubemap =
nullptr
;
61
Shader
_shader;
62
};
63
69
class
FlatSkybox
:
public
Skybox
70
{
71
public
:
72
FlatSkybox
(std::shared_ptr<Texture> texture);
73
74
//Skybox(const std::vector<std::string>& filenames);
75
//Skybox(const std::string& equirectangular_file, const bool& is_hdr = true);
76
~FlatSkybox
();
77
78
std::shared_ptr<Texture> getTexture();
79
void
setTexture(std::shared_ptr<Texture> texture);
80
void
render(
const
oe::scene::Camera
&)
override
;
81
82
private
:
83
render::ScreenQuad
* _screen_quad;
84
oe::render::Shader
* _shader;
85
std::shared_ptr<Texture> _texture =
nullptr
;
86
};
87
}
88
89
#endif
oe::render::CubicSkybox
Standard Cubic skybox.
Definition
skybox.h:42
oe::render::FlatSkybox
Flat skybox.
Definition
skybox.h:70
oe::render::Mesh
GPU mesh wrapper.
Definition
mesh.h:236
oe::render::ScreenQuad
Definition
screen_quad.h:10
oe::render::Shader
Standard shader class.
Definition
shader.h:26
oe::render::Skybox
Definition
skybox.h:27
oe::scene::Camera
The "eye of the scene".
Definition
camera.h:33
oe::render
Render related abstractions (Shader, Framebuffer, Cubemaps, Textures)
Definition
opengl.h:10
oe::scene
Scene related management (Render-agnostic Geometry, Manger, etc...)
Definition
debug.h:19
OxygenEngine
render
skybox.h
Generated by
1.9.8