Showing posts with label resources. Show all posts
Showing posts with label resources. Show all posts

Friday, January 31, 2014

Managing non-code resources in cross platform projects and cross language projects

For the book, I am writing a fair amount of example code.  The example code uses a lot of non-compiled resources.  Meshes, images, fonts and even shaders sources are all needed for rendering.  I need to be able to access these resources on all my target platforms (Windows, OSX, Linux, Android), and in all my target languages (C++, Java, Android Java).

Accessing these resources at run-time poses several challenges:
  • How do I store the resource so that it's available to my application regardless of platform?
  • How do I specify the resource I want in the application?
On top of these basic problems, which I must solve in order to have the examples work at all, there are two other constraints I would like to support
  • How do I avoid duplicating the resource storage for each of my example applications?
  • How can I enable a debugging mode so that if a resource changes while an application is running, the changes are reflected in the application immediately (without rebuilding or even restarting the application)?