Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Khaos Dragon

creating surfaces from file

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

I noticed that the VB version of DirectDraw7 features a function called CreateSurfacefile which essentially creates a surface from a generic bitmap file (bmp, jpg, gif, etc.) Does anything like this exist in the c++ version? If not how may I go about achieving this?

Share this post

Link to post
Share on other sites
Answer #1 Load the image into a DC with Load Image, and use GetSurfaceFromDC()
Pro - Easy to do
Con - Image must be compiled into exe, as a resource

Answer #2 Write your own bmp parser
Pro - Don''t have to compile image into exe
Con - Boring and you have to write a different parser for each image type

Answer #3 (prefered) Switch to DirectX8 or 9
Pro - Faster, hardware is designed for triangulation, not blitting
Pro - D3DX Library is ver useful, and coding is faster
Con - You have to learn something new

Share this post

Link to post
Share on other sites
well I use dx 9 and open gl for 3d apps, but I just find the ddraw to be very nice for purely 2d. And plus if you''re only doing 2d, is speed much of an issue, not like I''m dealing with tons of polygons here.

And what do you mean image must be compiled as an exe? I''m still what you call a novice programmer so bear with me here.

Share this post

Link to post
Share on other sites

  • 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!