Add generic texture component for renderables

This commit is contained in:
Emma Broman
2021-01-12 15:56:14 +01:00
parent c075dbcdeb
commit 72ebeb7f6f
7 changed files with 209 additions and 107 deletions

View File

@@ -25,19 +25,16 @@
#ifndef __OPENSPACE_MODULE_BASE___RENDERABLEDISC___H__
#define __OPENSPACE_MODULE_BASE___RENDERABLEDISC___H__
#include <openspace/rendering/renderable.h>
#include <openspace/properties/stringproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/rendering/renderable.h>
#include <openspace/rendering/texturecomponent.h>
#include <openspace/util/planegeometry.h>
#include <ghoul/opengl/uniformcache.h>
#include <ghoul/opengl/ghoul_gl.h>
namespace ghoul::filesystem { class File; }
namespace ghoul::opengl {
class ProgramObject;
class Texture;
} // namespace ghoul::opengl
namespace ghoul::opengl { class ProgramObject; }
namespace openspace {
@@ -47,6 +44,7 @@ class RenderableDisc : public Renderable {
public:
RenderableDisc(const ghoul::Dictionary& dictionary);
void initialize() override;
void initializeGL() override;
void deinitializeGL() override;
@@ -58,20 +56,16 @@ public:
static documentation::Documentation Documentation();
private:
void loadTexture();
properties::StringProperty _texturePath;
properties::FloatProperty _size;
properties::FloatProperty _width;
std::unique_ptr<ghoul::opengl::ProgramObject> _shader;
UniformCache(modelViewProjection, opacity, width, texture) _uniformCache;
std::unique_ptr<ghoul::opengl::Texture> _texture;
std::unique_ptr<ghoul::filesystem::File> _textureFile;
std::unique_ptr<PlaneGeometry> _plane;
std::unique_ptr<TextureComponent> _texture;
bool _textureIsDirty = false;
bool _planeIsDirty = false;
};