Advertisement

Ressources Files

Started by May 01, 2001 09:06 AM
9 comments, last by SKSlayer 23 years, 6 months ago
How to load using the stdio lib functions ressources such as TGA or any format in the EXE (I am not asking about the code to decode a TGA but, just a few lines about how to load a file from ressource with the stdio lib)
(you can find me on IRC : #opengl on undernet)
save_inside_exe("texture.tga");
Standard function from stdio.h.

Advertisement
Err
That''s not really the question
I know how to put a ressource into an exe, but how to load it ... and yeah, forgot
under Win32
(you can find me on IRC : #opengl on undernet)
go check out http://home.clara.net/paulyg/ogl.htm, he details a .TGA loader that is nice.
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
No ! I don''t want no TGA loader !!!!
I want to know how to load TGA as ressource !
(you can find me on IRC : #opengl on undernet)
i also dont know ..
copy the TGA file into your source code..

char mytgafile[] = { 0,10,10,203,50,560, };

i think ....
Advertisement
No, that''s not the question
the question is
How to load a TGA you put in the file as a ressource
(you can find me on IRC : #opengl on undernet)
Maybe you should try reading Milkyway''s post titled ''Resources in Win32'' before posting yet another one on the same topic. ThomW has provided an excellent coding sample on how to load a simple .RAW file.
I think you make a resource file *.rc
and put in something like
''500 TGA "C:\file.tga"''
compile that & link it with you program.
There''s a windows function something like
''LoadResource''
and you supply it with the instance of your program & the resource number.

get that with the macro MAKEINTRESOURCE(resource_number)
or with the string "#resource_number".

you endup with a pointer to the raw data that was in the file.

There''s another function to find out the resource size in bytes but I don''t remember what it was.

I don''t use VC so I don''t know how that applies to u.

I think sdk or something automatically makes a resource file for dialogs and stuff, so just add to that.

the win32sdk help file has info on those functions & macros so you know how to use them, and links to other functions relevent to them.

:eek:

i''m going from memory. don''t quote me on that stuff.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
SK -

It isn''t really that hard. I posted a little piece of code in a thread called Resources in Win32 that loads a RAW texture from a resource as Wavarian mentioned that would prove a good start.

I haven''t actually done this myself, but basically, I would think you would take pbRes and use it the same way you would use a file pointer to the TGA structure. Delete all the code in my previous sample and replace it with code similar to that of any other TGA file-loading sample.

I know I''m being vague, but maybe it will point you in the right direction. If I find some time this weekend (not likely) I can mock something up to help you further since this is something that I''m personally interested in doing as well.

Good luck!

ThomW
www.LMNOpc.com

This topic is closed to new replies.

Advertisement