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

Resource memory mapped

Post by fgc13 » Sun Dec 21, 2008 5:39 pm

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!
0 x

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

Post by nullsquared » Sun Dec 21, 2008 5:53 pm

0 x

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 2
Contact:

Post by sinbad » Mon Dec 22, 2008 12:02 pm

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.
0 x

Post Reply