Jump to content
  • Advertisement
Sign in to follow this  
Code Is Your Friend

Loading or converting a jpg

This topic is 3520 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

After alot of searching and alot of dead ends I have decided to just ask and hope for the best, I am trying to load a jpg to a direct x surface using c++. The problem is for all the sites on google about this, they dont really help. And most were written back in 02 and 03 and mention sites that no longer exist. Now I don't care if its a jpg when it hits the surface, or if you know a way to simple convert it to a bmp. I just want a point in the right direction. anyone? Thanks, Matt

Share this post


Link to post
Share on other sites
Advertisement
There's no such thing as a "DirectX surface". There is however DirectDraw surfaces and Direct3D surfaces. If you're using Direct3D, there's D3DXLoadSurfaceFromFile. If you're using DirectDraw, then you'll have to do the JPEG decoding yourself - which is one of the many reasons that DirectDraw is not recommended, and rendering 2D with Direct3D is preferable.

Share this post


Link to post
Share on other sites
I think the Texture tool in dxsdk can do it too. dds is fine too.

Or you could do your own converter with D3DXCreateTextureFromFile() and D3DXSaveTextureToFile(). This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga.

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!