qtk/src/skybox.h

55 lines
1.7 KiB
C
Raw Normal View History

2021-09-03 16:56:57 +00:00
/*##############################################################################
## Author: Shaun Reed ##
2022-03-06 16:54:05 +00:00
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
2021-09-03 16:56:57 +00:00
## About: Skybox class using QtOpenGL ##
## ##
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
##############################################################################*/
#ifndef QTK_SKYBOX_H
#define QTK_SKYBOX_H
#include <QImage>
#include <QOpenGLBuffer>
#include <QOpenGLFunctions>
2021-09-03 16:56:57 +00:00
#include <QOpenGLShaderProgram>
#include <QOpenGLTexture>
#include <QOpenGLVertexArrayObject>
#include <camera3d.h>
#include <mesh.h>
#include <qtkapi.h>
2022-11-24 22:26:53 +00:00
#include <texture.h>
namespace Qtk {
class QTKAPI Skybox : protected QOpenGLFunctions {
2022-11-24 22:26:53 +00:00
public:
// Delegate this constructor to use default skybox images
explicit Skybox(const std::string & name = "Skybox");
explicit Skybox(
QOpenGLTexture * cubeMap, const std::string & name = "Skybox");
// Constructor, Destructor
Skybox(
const std::string & right, const std::string & top,
const std::string & front, const std::string & left,
const std::string & bottom, const std::string & back,
const std::string & name = "Skybox");
~Skybox() = default;
void draw();
private:
void init();
Vertices mVertices {};
Indices mIndices {};
QOpenGLShaderProgram mProgram;
QOpenGLVertexArrayObject mVAO;
QOpenGLBuffer mVBO;
Texture mTexture;
};
2022-11-24 22:26:53 +00:00
} // namespace Qtk
2021-09-03 16:56:57 +00:00
2022-11-24 22:26:53 +00:00
#endif // QTK_SKYBOX_H