Compiling media into your exe?
Compiling media into your exe?
A long time ago I saw an answer to this but I didn't quite understand the code at the time. But the guy had some code that could compile all the media such as 3d models textures and other images into your project. Anyone know how to do this anymore?
If you do can you please say something because I sure don't know how I would do this lol
If you do can you please say something because I sure don't know how I would do this lol
-
- Posts: 27
- Joined: Mon Jan 09, 2006 11:17 am
Perhaps this link may be of help to you. It is about using resources.
http://www.codeproject.com/KB/cpp/dynar ... ct=1295732
http://www.codeproject.com/KB/cpp/dynar ... ct=1295732
Check out: BuiltInFont.h
And here's the link to the Bin2H software:
http://deadnode.org/sw/bin2h/
P.S
Should be fixed in the header file.
And here's the link to the Bin2H software:
http://deadnode.org/sw/bin2h/
P.S
Should be fixed in the header file.
um...
Did you guys understand that I was asking how do I literally put the media in the exe!? Like storing it into the actual exe and pulling it up from that storage from then on. I have found a code on how to do it before but I never got it to work. I think it was something to do with ill-matched versions of something.
But does someone know a code that actually stores graphics such as jpg,bmps, and meshes such as b3d, 3ds, md2 into the exe itself.
But does someone know a code that actually stores graphics such as jpg,bmps, and meshes such as b3d, 3ds, md2 into the exe itself.
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
I want to do it because...
Not because I want files protected only, but because it would make it better for users as far as keeping everything where it needs to be... You know in case some dumbazz deletes a file or effs it up in some way.
Thats why...
Plus it stops dummies from being able to steal the files. Sure the smart people can do it, but the dumb ones can't or just aren't going to waste their time with it.
Thats why...
Plus it stops dummies from being able to steal the files. Sure the smart people can do it, but the dumb ones can't or just aren't going to waste their time with it.
There are tools that read the ressources of a file and can extract them with one click. So senseless.
However ressources is the keyword you need.
In Visual Studio for example (only the Standard Version and above) you simply add a ressource to your project (Project -> Add item). And then load it with some WinAPI functions (google is your friend). Of course this is not platform indepent. I haven't heard about a way to do this in Linux.
Oh and one thing should be mentioned:
The more and bigger ressources there are in an exe the longer it takes to load. This is because ALL (and I mean ALL) ressources will be loaded when the exe is executed. Even the ressources you don't need at the startup.
So you see storing your media files in a seperate folder/archive/whatever has only advantages. And you can prevent the *really* stupid people from stealing your media by simply changing the extension of your media archive from zip to data for example.
However ressources is the keyword you need.
In Visual Studio for example (only the Standard Version and above) you simply add a ressource to your project (Project -> Add item). And then load it with some WinAPI functions (google is your friend). Of course this is not platform indepent. I haven't heard about a way to do this in Linux.
Oh and one thing should be mentioned:
The more and bigger ressources there are in an exe the longer it takes to load. This is because ALL (and I mean ALL) ressources will be loaded when the exe is executed. Even the ressources you don't need at the startup.
So you see storing your media files in a seperate folder/archive/whatever has only advantages. And you can prevent the *really* stupid people from stealing your media by simply changing the extension of your media archive from zip to data for example.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
Did you miss my post or what?CodyCer0 wrote:Did you guys understand that I was asking how do I literally put the media in the exe!? Like storing it into the actual exe and pulling it up from that storage from then on. I have found a code on how to do it before but I never got it to work. I think it was something to do with ill-matched versions of something.
But does someone know a code that actually stores graphics such as jpg,bmps, and meshes such as b3d, 3ds, md2 into the exe itself.
Irrlicht does it with a bmp.MasterGod wrote:Check out: BuiltInFont.h
And here's the link to the Bin2H software:
http://deadnode.org/sw/bin2h/
P.S
Should be fixed in the header file.
I did it in my engine with a 3ds mesh, exactly the same way..
What else do you need?
You could try Mole Box which packages the application and all of its supplementary files into a single efficient executable file, which runs without extracting packed files to the hard drive
This just a trial version, of course. You may be able to find something like that freeware.
But as other have said, this only protects your files from normal users.
This just a trial version, of course. You may be able to find something like that freeware.
But as other have said, this only protects your files from normal users.
lol. both responses you got before complaining where exactly fitting your question, the first one being about the advanced way, the second one about the simple way.
you really should start reading what people post.
and about the EXE: this is a commandline executable, you really should learn how to use these
you really should start reading what people post.
and about the EXE: this is a commandline executable, you really should learn how to use these
Ok I got it running now, not from a guide on how to use commandline exe's, just troubleshooted my way into running it right.MasterGod wrote:The way I'm suggesting is much more easier and it's exactly what you asked for.
But my question is how would I be able to put this into practice with irrlicht. How would I manage to um like use the value created from this exe to have this act as a replacement for the actual file itself?
About that, I was asleep and or at school at the time these posts were made...loki1985 wrote:lol. both responses you got before complaining where exactly fitting your question, the first one being about the advanced way, the second one about the simple way.
you really should start reading what people post.
and about the EXE: this is a commandline executable, you really should learn how to use these
Dude, read the text on the main page:CodyCer0 wrote:Sorry I should of commented back, I tried the link where he said "Download the tool from here." And it gave me a single exe, I ran it and nothing happened, it just closes right away...MasterGod wrote:The way I'm suggesting is much more easier and it's exactly what you asked for.
The example creates a header file of the bin2h program itself. This header contains an array of the binary data of the data you wish to save.Usage
Download the tool from here.
You must give the input file as the first argument; optionally you may specify the output filename (otherwise this defaults to the input filename with the extension changed to .h), the variable name, and the switch -nosize to suppress the creation of a variable representing the size of the data block created.
...
Example
bin2h bin2h.exe bin2h.h -nosize
This will create a file, bin2h.h, which defines a variable of type unsigned char [] named bin2h, but will not define the variable bin2h_size which would otherwise indicate the size of that array.
It could be another executable file (like in the example) or it can be a jpeg image.
Got it?