Jump to content
  • Advertisement
Sign in to follow this  
the_moo

corona library (or png loading with directdraw) and dev c++ help

This topic is 4944 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey all, im wanting to change my image file format to png so as to save *much* space (compared to bmp) when making my games, so today i was looking for libraries to help me do so. i stumbled across corona and the devpak for dev c++ and can load the image but i have no idea how to use it: that is, i have no idea on how to read the pixel information and use it as i want it (which would be to make a directdraw surface with it on it). if anyone can explain and maybe show by example how i should go about doing this, i would greatly appreciate it. [EDIT]if you cant help with this but can suggest/show another way of loading and using png files, please feel free to let me know also ;)[/EDIT] *Special Note* i just went back in time over half a day and edited my post before i wrote it (according to gamedev) - woohoo! im the first to successfully time travel! (Posted - 4/2/2005 12:18:09 AM and [[Edited by - the_moo on April 1, 2005 8:50:36 AM]] :D :D :D!!!** thanks [Edited by - the_moo on April 3, 2005 12:27:22 AM]

Share this post


Link to post
Share on other sites
Advertisement
sorry, i think i shouldve been a bit more specific:
im using directx and i dont know how to put the pixel information onto a directx surface once the png has been loaded - i know and have the loading working so its just using the information that i cant do. im also using directdraw (old i know) with surfaces and whatnot.

if anyone can still help id greatly appreciate it.

thanks

Share this post


Link to post
Share on other sites
I think the function that you will need to use is D3DXCreateTextureFromFileInMemory. I've never done anything like this before, so I can't give you pointers on that, but I think you should be able to follow from the MSDN site. Basically it will be something like this:

DIRECT3DTEXTURE9 Object;
DIRECT3DDEVICE9 Device;
D3DXCreateTextureFromFileInMemory ( &Device, CoronaPointerToPixels, CoronaFileSize, &Object);

Share this post


Link to post
Share on other sites
unfortunately since im using directdraw, i don't know anything about d3d and was hoping someone would be able to help out with directdraw...

if anyone knows of any other way of doing this im willing to here it too.

thanks again

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!