Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Loading images,mesh and memblocks from memory?

Author
Message
marlou
15
Years of Service
User Offline
Joined: 17th Jan 2009
Location:
Posted: 4th Sep 2009 09:57
I was just wondering if there is a way to load an image,mesh or memblock from memory.

make a prototype like something like..
void LoadImageFromMemory( int iID,void* memory,long int size);

Has anybody got something working?
Any ideas how to begin?
what commands to use?
Pls post..^^
Unoptimized methods are fine...

When a person has nothing but a dream, can he dare to dream.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 4th Sep 2009 10:07
I think you'll need to be a little more specific in your description...

When you load any asset into GDK from disk, it is already residing in memory, so Im guessing thats not what you meant, but im not sure there is another way to load something.... to load something from memory, it has to be there, and for a program to put something into memory, it has to know what it is, ie. already be loaded..... you can see the pattern ?

Your program will have to load the asset from somewhere initially, thats what im getting at, where would you be getting your data from to put it into memory initially ??

If it ain't broke.... DONT FIX IT !!!
marlou
15
Years of Service
User Offline
Joined: 17th Jan 2009
Location:
Posted: 4th Sep 2009 10:30
Quote: "where would you be getting your data from to put it into memory initially ??"

from an encrypted or compressed file..I just found a way to encrypt and compress files into a single file and a way to decompress them into memory..
Now my problem is to load the files into GDK from the memory where the extraction occured.

When a person has nothing but a dream, can he dare to dream.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 4th Sep 2009 15:24
Are you talking about a format thatworks in a similar manner to blizzard's MPQ ?

That works in the manner u describe, you compress all your files into one large file, but they essentially becomes "blocks" in the file rather than individual files with names/paths etc...

If this is the case, depending on the type of asset it is, would determine how you would load it. For instance, if it was an image, you could load the "block" that contained the image data, create a blank GDK image, and just copy the pixel info over... that would work in a similar way for meshes, although memblocks are a GDK think, so I dont know that it would work...

If it ain't broke.... DONT FIX IT !!!
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 4th Sep 2009 19:26 Edited at: 4th Sep 2009 19:32
You could make a memblock in gdk of the right size get the pointer and use memcpy but it would be have to be stored in the right format depending on what asset you were loading as mista wilson said , so you could then use dbMakeImageFromMemblock() etc.

chunks

Edit: I just remembered there is a post on here which shows how to load custom media , some of the stuff in there might be usefull to you.

http://forum.thegamecreators.com/?m=forum_view&t=123392&b=22

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
acurrate eye
15
Years of Service
User Offline
Joined: 28th Aug 2009
Location: ur house under your pillow was under bed
Posted: 9th Sep 2009 01:12
i have the same problem like its loaded but the game in the application in the debug its not working why or isnt this what you are asking its like the linking is not working

kyle

Login to post a reply

Server time is: 2024-11-20 15:29:40
Your offset time is: 2024-11-20 15:29:40