Bugfix and better destruction of WWTDataHandler in module

This commit is contained in:
Ylva Selling
2021-06-09 09:28:34 +02:00
parent d3736aeb82
commit 86fbde2af8
4 changed files with 9 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
uniform sampler2D texture1;
uniform sampler2D texture;
uniform float borderWidth;
uniform vec2 targetDimensions;
uniform bool showCrosshair;
@@ -34,8 +34,8 @@ Fragment getFragment() {
float border_crosshair_bl = step(borderWidth*ratio*4, vs_st.x) * step(borderWidth*ratio*4, (1.0)-vs_st.x);
float border_crosshair_tr = step(borderWidth*4, vs_st.y) * step(borderWidth*4, (1.0)-vs_st.y);
vec3 crosshair_small = vec3(border_crosshair_bl*border_crosshair_tr);
vec3 crosshair_inside_border = vec3(crossLine(crosshair_small.x * crosshair_border_linewidth, (vs_st).x)
vec3 crosshair_inside_border = vec3(crossLine(crosshair_small.x * crosshair_border_linewidth, (vs_st).x)
+ crossLine(crosshair_small.y * crosshair_border_linewidth, (vs_st).y));
vec3 crosshair_and_border = (1.0 - border) + crosshair_inside_border;

View File

@@ -474,10 +474,13 @@ SkyBrowserModule::SkyBrowserModule()
});
}
void SkyBrowserModule::internalDeinitialize() {
SkyBrowserModule::~SkyBrowserModule() {
delete dataHandler;
}
void SkyBrowserModule::internalDeinitialize() {
}
void SkyBrowserModule::internalInitialize(const ghoul::Dictionary& dict) {
const Parameters p = codegen::bake<Parameters>(dict);

View File

@@ -55,7 +55,7 @@ public:
constexpr static const int FROM_URL = 1;
SkyBrowserModule();
virtual ~SkyBrowserModule() = default;
virtual ~SkyBrowserModule();
glm::vec2 getMousePositionInScreenSpaceCoords(glm::vec2& mousePos);
void addRenderable(ScreenSpaceRenderable* object);
WWTDataHandler* getWWTDataHandler();

View File

@@ -39,7 +39,7 @@ namespace {
};
constexpr const std::array<const char*, 8> UniformNames = {
"ModelTransform", "ViewProjectionMatrix", "texture1", "showCrosshair", "showCrosshairInTarget", "borderWidth", "targetDimensions", "borderColor"
"ModelTransform", "ViewProjectionMatrix", "texture", "showCrosshair", "showCrosshairInTarget", "borderWidth", "targetDimensions", "borderColor"
};
constexpr const openspace::properties::Property::PropertyInfo BrowserIDInfo =