Hi
I add the teapot.obj from the introjucer to create my binarydata.cpp and binarydata.h.
Binarydata.h looks like this:
namespace BinaryData
{
extern const char* lamp_obj;
const int lamp_objSize = 227066;
extern const char* teapot_obj;
const int teapot_objSize = 95000;
extern const char* Main_cpp;
const int Main_cppSize = 43859;
// Points to the start of a list of resource names.
extern const char* namedResourceList[];
// Number of elements in the namedResourceList array.
extern const int namedResourceListSize;
// If you provide the name of one of the binary resource variables above, this function will
// return the corresponding data and its size (or a null pointer if the name isn't found).
const char* getNamedResource (const char* resourceNameUTF8, int& dataSizeInBytes) throw();
}
as you can see I added a lamp.obj which was parsed with the introjucer as well.
the binarydata.cpp looks like this:
namespace BinaryData
{
//================== lamp.obj ==================
static const unsigned char temp_binary_data_0[] =
{ 35, ... , }const char* lamp_obj = (const char*) temp_binary_data_0;
//================== teapot.obj ==================
static const unsigned char temp_binary_data_1[] =
{ 35,32, ... }
const char* teapot_obj = (const char*) temp_binary_data_1;
//================== Main.cpp ==================
static const unsigned char temp_binary_data_2[] =
{ 13, 10, ... }const char* Main_cpp = (const char*) temp_binary_data_2;
const char* getNamedResource (const char*, int&) throw();
const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw()
{
unsigned int hash = 0;
if (resourceNameUTF8 != 0)
while (*resourceNameUTF8 != 0)
hash = 31 * hash + (unsigned int) *resourceNameUTF8++;
switch (hash)
{
case 0x9e92c210: numBytes = 227066; return lamp_obj;
case 0x754c69fd: numBytes = 95000; return teapot_obj;
case 0x035e963d: numBytes = 43859; return Main_cpp;
default: break;
}
numBytes = 0;
return 0;
}
const int namedResourceListSize = 3;
const char* namedResourceList[] =
{
"lamp_obj",
"teapot_obj",
"Main_cpp"
};
}
I add the WavefrontObjParser.h to my headers and use the following code to get if the data was loaded correctly:
if (shapeFile.load (BinaryData::teapot_obj).wasOk())
which works perfectly with the teapot, however when I call
if (shapeFile.load (BinaryData::lamp_obj).wasOk())
triggers the following breakpoint at the WaveFrontObjParser.h line 316:
Result parseMaterial (Array<Material>& materials, const String& filename)
{
jassert (sourceFile.exists());
The File obviously exists as I shown in the binaryData header and cpp so I do not know what is the problem. I try with obj's created with blender, 3ds and from here: http://people.sc.fsu.edu/~jburkardt/data/obj/ and it is always the same mistake.
Please a little help on why this is happening?
Thank you