Archived

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

Khaos Dragon

creating surfaces from file

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