Request: Load images from memory (solved)

Posted By: Talemon

Request: Load images from memory (solved) - 04/28/14 11:00

Hi, I'm downloading some image files and I need to show them on the screen. If you could implement another version of bmap_create which takes a memory pointer to the contents of a file, I could avoid creating unnecessary files on disk and spending unnecessary time for I/O.

Thanks.
Posted By: txesmi

Re: Request: Load images from memory - 04/28/14 11:20

add_buffer(char* name,void* buffer,long size)
Posted By: Ch40zzC0d3r

Re: Request: Load images from memory - 04/28/14 11:40

Use the directx function (D3DXCreateTextureFromFileInMemory) to generate a texture of your memory (bytes) and then generate the new bitmap struct info yourself, no engine function is needed to do this tongue
Posted By: Talemon

Re: Request: Load images from memory - 04/28/14 11:40

I didn't know that, thanks to both of you!
Posted By: txesmi

Re: Request: Load images from memory - 04/28/14 11:54

Originally Posted By: Ch40zzC0d3r
then generate the new bitmap struct info yourself

Is this possible? Can you really fill with no potential troubles the private C_LINK struct contained into all engine structs? How far is the C_LINK data needed to render the image?
Posted By: Uhrwerk

Re: Request: Load images from memory - 04/28/14 18:04

Originally Posted By: Ch40zzC0d3r
Use the directx function (D3DXCreateTextureFromFileInMemory) to generate a texture of your memory (bytes) and then generate the new bitmap struct info yourself, no engine function is needed to do this tongue
Please don't never ever mess with the engines internal data structures! There are function for these purposes!
Posted By: Ch40zzC0d3r

Re: Request: Load images from memory - 04/28/14 19:14

All I can say is that these "hacks" are working fine with this engine, idk how much I messed up during my coding in C++ grin
I hooked 14 functions and game runs fine, I fixed some bugs myself because there was no update for a long time tongue
I cant remember how I did it last time since I cant find some projects -.-
But I dont think I even filled C_LINK struct, the draw functions just use the infos like height/width and the pixel buffer pointer.
Posted By: sivan

Re: Request: Load images from memory - 04/28/14 19:42

sounds interesting.
Posted By: Uhrwerk

Re: Request: Load images from memory - 04/28/14 21:45

Sounds horribly wrong. I warned you. Do whatever you want...
© 2024 lite-C Forums