summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ivi-layermanagement-examples/EGLWLMockNavigation/include/MockNavi.h5
-rw-r--r--ivi-layermanagement-examples/EGLWLMockNavigation/src/MockNavi.cpp12
2 files changed, 13 insertions, 4 deletions
diff --git a/ivi-layermanagement-examples/EGLWLMockNavigation/include/MockNavi.h b/ivi-layermanagement-examples/EGLWLMockNavigation/include/MockNavi.h
index 438194d..118f38f 100644
--- a/ivi-layermanagement-examples/EGLWLMockNavigation/include/MockNavi.h
+++ b/ivi-layermanagement-examples/EGLWLMockNavigation/include/MockNavi.h
@@ -23,6 +23,8 @@
#include "IRenderable.h"
#include "IUpdateable.h"
#include "Camera.h"
+#include "ShaderLighting.h"
+#include "ShaderTexture.h"
#include <list>
using std::list;
@@ -33,6 +35,7 @@ class MockNavi : public OpenGLES2App
{
public:
MockNavi(float fps, float animationSpeed, SurfaceConfiguration* config);
+ ~MockNavi();
virtual void update(int currentTimeInMs, int lastFrameTime);
virtual void render();
@@ -45,6 +48,8 @@ private:
int m_houseCount;
list<IRenderable*> m_renderList;
list<IUpdateable*> m_updateList;
+ ShaderLighting* pShader = nullptr;
+ ShaderTexture* pShaderTexture = nullptr;
};
#endif /* _MOCKNAVI_H */
diff --git a/ivi-layermanagement-examples/EGLWLMockNavigation/src/MockNavi.cpp b/ivi-layermanagement-examples/EGLWLMockNavigation/src/MockNavi.cpp
index 66e6863..63ed3d3 100644
--- a/ivi-layermanagement-examples/EGLWLMockNavigation/src/MockNavi.cpp
+++ b/ivi-layermanagement-examples/EGLWLMockNavigation/src/MockNavi.cpp
@@ -23,8 +23,6 @@
#include "Street.h"
#include "Ground.h"
#include "Car.h"
-#include "ShaderLighting.h"
-#include "ShaderTexture.h"
#include <stdlib.h>
#include <unistd.h>
@@ -40,6 +38,12 @@ MockNavi::MockNavi(float fps, float animationSpeed, SurfaceConfiguration* config
generateCity();
}
+MockNavi::~MockNavi()
+{
+ delete pShader;
+ delete pShaderTexture;
+}
+
void MockNavi::update(int currentTimeInMs, int lastFrameTime)
{
m_camera.update(currentTimeInMs, lastFrameTime);
@@ -69,8 +73,8 @@ void MockNavi::render()
void MockNavi::generateCity()
{
float* projection = m_camera.getViewProjectionMatrix();
- ShaderLighting* pShader = new ShaderLighting(projection);
- ShaderTexture* pShaderTexture = new ShaderTexture(projection);
+ pShader = new ShaderLighting(projection);
+ pShaderTexture = new ShaderTexture(projection);
TextureLoader* carTexture = new TextureLoader;
bool carTextureLoaded = carTexture->loadBMP("/usr/share/wayland-ivi-extension/textures/car.bmp");
TextureLoader* streetTexture = new TextureLoader;