Resource memory mapped

What it says on the tin: a place to discuss proposed new features.
Post Reply
fgc13
Gnoblar
Posts: 14
Joined: Wed Aug 06, 2008 11:26 pm
x 2

Resource memory mapped

Post by fgc13 »

Hi!

I want to include resource files directly in .exe like static data. For example myfont.ttf, plane.mesh, texture.jpg, etc. Something like that...

Code: Select all


char* myfont_ttf_mapped_file = "Z:\\memory_partition\\myfont.ttf";
unsigned char[] myfont_ttf_data = {234, 43, 1, 36, 78, 200, ...};
site_t myfont_ttf_size_in_bytes = 55432; 

...

Ogre::FontPtr new_font;
...

new_font->setSource(myfont_ttf_mapped_file);

By this way we'll can distribute our applications with the problem of altering program execution by the user. Any idea? Can Ogre do it? is planned for future versions?

Thanks a million!

User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 9

Post by nullsquared »


User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Another way is to create your own Archive class which exposes resources embedded statically, or use ResourceLoadingListener to intercept resource requests and to serve up streams on memory areas.

So yes, you can do it already, and there are lots of options.

Post Reply