Use FileStream API in demo.
[platform/core/uifw/dali-demo.git] / examples / ray-marching / ray-marching-example.cpp
index 4a6f7a3..2a7b959 100644 (file)
@@ -21,7 +21,7 @@
 #include "shared/utility.h"
 #include <stdio.h>
 #include <dali/integration-api/debug.h>
-#include <dali/devel-api/adaptor-framework/file-loader.h>
+#include <dali/devel-api/adaptor-framework/file-stream.h>
 
 using namespace Dali;
 using Dali::Toolkit::TextLabel;
@@ -44,17 +44,15 @@ bool LoadShaderCode( const char* path, const char* filename, std::vector<char>&
   std::string fullpath( path );
   fullpath += filename;
 
-  std::streampos bufferSize = 0;
-  Dali::Vector<char> fileBuffer;
-  if( !Dali::FileLoader::ReadFile( fullpath, bufferSize, fileBuffer, Dali::FileLoader::FileType::BINARY ) )
+  Dali::FileStream fileStream( fullpath, Dali::FileStream::READ | Dali::FileStream::BINARY );
+  FILE* file = fileStream.GetFile();
+  if( !file )
   {
     return false;
   }
 
-  FILE* file = fmemopen( &fileBuffer[0], bufferSize, "rb" );
-
   bool retValue = false;
-  if( ! fseek( file, 0, SEEK_END ) )
+  if( !fseek( file, 0, SEEK_END ) )
   {
     long int size = ftell( file );
 
@@ -69,7 +67,6 @@ bool LoadShaderCode( const char* path, const char* filename, std::vector<char>&
     }
   }
 
-  fclose( file );
   return retValue;
 }