mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 11:39:49 -06:00
Add generic texture component for renderables
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user