[Tizen] Prepare for Tizen 4.0 Build
[platform/core/uifw/dali-demo.git] / examples / atlas / atlas-example.cpp
index 3d46680..503d577 100644 (file)
@@ -200,18 +200,18 @@ private:
     return imageData;
   }
 
-  PixelDataPtr CreatePixelData( const Vector3& color, const unsigned int width, const unsigned int height )
+  PixelData CreatePixelData( const Vector3& color, const unsigned int width, const unsigned int height )
   {
     unsigned int size = width*height;
-    unsigned char* pixels = new unsigned char [size*3u];
+    unsigned int bufferSize = size * Pixel::GetBytesPerPixel(Pixel::RGB888);
+    unsigned char* pixels = new unsigned char [bufferSize];
     for( unsigned int i = 0; i < size; i++ )
     {
       pixels[i*3u] = 0xFF * color.x;
       pixels[i*3u+1u] = 0xFF * color.y;
       pixels[i*3u+2u] = 0xFF * color.z;
     }
-
-    return PixelData::New( pixels, width, height, Pixel::RGB888, PixelData::DELETE_ARRAY );
+    return PixelData::New( pixels, bufferSize, width, height, Pixel::RGB888, PixelData::DELETE_ARRAY );
   }
 
 
@@ -234,7 +234,7 @@ void RunTest( Application& application )
 
 // Entry point for Linux & Tizen applications
 //
-int main( int argc, char **argv )
+int DALI_EXPORT_API main( int argc, char **argv )
 {
   gApplication = Application::New( &argc, &argv, DEMO_THEME_PATH );