Fix compile errors on MS-Windows.
[platform/core/uifw/dali-demo.git] / examples / point-mesh / point-mesh-example.cpp
index bdf7d8b..0313f86 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/rendering/renderer.h>
 #include <dali-toolkit/dali-toolkit.h>
 
 // INTERNAL INCLUDES
 #include "shared/view.h"
+#include "shared/utility.h"
 
 using namespace Dali;
 
@@ -82,7 +82,7 @@ Geometry CreateGeometry()
   // Create vertices
   struct Vertex { Vector2 position; float hue; };
 
-  unsigned int numSides = 20;
+  const unsigned int numSides = 20;
   Vertex polyhedraVertexData[numSides];
   float angle=0;
   float sectorAngle = 2.0f * Math::PI / (float) numSides;
@@ -104,7 +104,7 @@ Geometry CreateGeometry()
   // Create the geometry object
   Geometry polyhedraGeometry = Geometry::New();
   polyhedraGeometry.AddVertexBuffer( polyhedraVertices );
-  polyhedraGeometry.SetGeometryType( Geometry::POINTS );
+  polyhedraGeometry.SetType( Geometry::POINTS );
 
   return polyhedraGeometry;
 }
@@ -152,14 +152,14 @@ public:
     // Hide the indicator bar
     application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
 
-    Image image0 = ResourceImage::New( MATERIAL_SAMPLE );
-    Image image1 = ResourceImage::New( MATERIAL_SAMPLE2 );
+    Texture texture0 = DemoHelper::LoadTexture( MATERIAL_SAMPLE );
+    Texture texture1 = DemoHelper::LoadTexture( MATERIAL_SAMPLE2 );
 
     Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
 
     TextureSet textureSet = TextureSet::New();
-    textureSet.SetImage( 0u, image0 );
-    textureSet.SetImage( 1u, image1 );
+    textureSet.SetTexture( 0u, texture0 );
+    textureSet.SetTexture( 1u, texture1 );
 
     Geometry geometry = CreateGeometry();
 
@@ -227,20 +227,10 @@ private:
   Timer    mChangeImageTimer;
 };
 
-void RunTest( Application& application )
+int DALI_EXPORT_API main( int argc, char **argv )
 {
+  Application application = Application::New( &argc, &argv );
   ExampleController test( application );
-
   application.MainLoop();
-}
-
-// Entry point for Linux & SLP applications
-//
-int main( int argc, char **argv )
-{
-  Application application = Application::New( &argc, &argv );
-
-  RunTest( application );
-
   return 0;
 }