Continued work on memory leaks and proper isReady usage

This commit is contained in:
Jonas Strandstedt
2014-12-11 16:48:49 +01:00
parent dc21196f70
commit da4fa44c03
19 changed files with 119 additions and 111 deletions

View File

@@ -47,6 +47,7 @@ public:
GLfloat location[4];
GLfloat tex[2];
GLfloat normal[3];
GLfloat padding[7];
//GLubyte padding[4]; // Pads the struct out to 64 bytes for performance increase
} Vertex;
@@ -60,7 +61,6 @@ private:
GLuint _vBufferID = 7;
GLuint _iBufferID = 8;
GLenum _mode;
unsigned int _isize;
unsigned int _vsize;
Vertex* _varray;

View File

@@ -28,11 +28,11 @@
#include <openspace/rendering/planets/planetgeometry.h>
#include <openspace/properties/vectorproperty.h>
#include <openspace/properties/scalarproperty.h>
#include <openspace/util/powerscaledsphere.h>
namespace openspace {
class RenderablePlanet;
class PowerScaledSphere;
namespace planetgeometry {

View File

@@ -28,22 +28,25 @@
// openspace
#include <openspace/properties/propertyowner.h>
#include <openspace/properties/scalarproperty.h>
#include <openspace/util/powerscaledcoordinate.h>
#include <openspace/util/powerscaledscalar.h>
#include <openspace/util/updatestructures.h>
// ghoul
#include <ghoul/misc/dictionary.h>
// Forward declare to minimize dependencies
namespace ghoul {
namespace opengl {
class ProgramObject;
class Texture;
}
class Dictionary;
}
namespace openspace {
// Forward declare to minimize dependencies
struct RenderData;
struct UpdateData;
class Camera;
class PowerScaledCoordinate;
class Renderable : public properties::PropertyOwner {
public:
static Renderable* createFromDictionary(const ghoul::Dictionary& dictionary);
@@ -68,7 +71,7 @@ public:
protected:
std::string findPath(const std::string& path);
void setPscUniforms(ghoul::opengl::ProgramObject* program, const Camera* camera, const psc& position);
void setPscUniforms(ghoul::opengl::ProgramObject* program, const Camera* camera, const PowerScaledCoordinate& position);
private:
properties::BoolProperty _enabled;

View File

@@ -27,13 +27,8 @@
// open space includes
#include <openspace/rendering/renderable.h>
#include <openspace/properties/stringproperty.h>
// ghoul includes
#include <ghoul/opengl/programobject.h>
#include <ghoul/opengl/texture.h>
//#include <openspace/util/runtimedata.h>
#include <openspace/util/powerscaledcoordinate.h>
namespace openspace {
class RenderableFov : public Renderable{

View File

@@ -29,6 +29,7 @@
#include <openspace/rendering/renderable.h>
#include <openspace/properties/stringproperty.h>
#include <openspace/util/powerscaledcoordinate.h>
// ghoul includes
#include <ghoul/opengl/programobject.h>
@@ -49,9 +50,7 @@ namespace openspace {
void render(const RenderData& data) override;
void update(const UpdateData& data) override;
private:
properties::StringProperty _colorTexturePath;
ghoul::opengl::ProgramObject* _programObject;
ghoul::opengl::Texture* _texture;
void loadTexture();
void fullYearSweep();
@@ -72,7 +71,6 @@ namespace openspace {
void nextIndex();
GLenum _mode;
unsigned int _isize;
unsigned int _vsize;
unsigned int _vtotal;
@@ -80,7 +78,7 @@ namespace openspace {
//Vertex* _varray;
std::vector<float> _varray;
int* _iarray;
std::vector<int> _iarray;
//used for update of trail
psc _pscpos, _pscvel;

View File

@@ -27,8 +27,8 @@
// open space includes
#include <openspace/rendering/renderable.h>
#include <openspace/properties/stringproperty.h>
#include <openspace/util/powerscaledcoordinate.h>
// ghoul includes
#include <ghoul/opengl/programobject.h>

View File

@@ -22,8 +22,8 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef RENDERABLEVOLUME_H
#define RENDERABLEVOLUME_H
#ifndef __RENDERABLEVOLUME_H__
#define __RENDERABLEVOLUME_H__
// open space includes
#include <openspace/rendering/renderable.h>

View File

@@ -70,12 +70,12 @@ private:
ghoul::opengl::Texture* _volume;
ghoul::opengl::Texture* _transferFunction;
GLuint _boxArray;
GLuint _boxArray;
GLuint _vertexPositionBuffer;
ghoul::opengl::ProgramObject *_boxProgram;
glm::vec3 _boxScaling;
psc _pscOffset;
float _w;
GLint _MVPLocation, _modelTransformLocation, _typeLocation;
bool _updateTransferfunction;
int _id;

View File

@@ -30,7 +30,6 @@
#include <openspace/util/powerscaledcoordinate.h>
#include <openspace/util/powerscaledscalar.h>
namespace openspace {
class PowerScaledSphere {