Jump to content
  • Advertisement

Archived

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

Ryu-Jin

Displaying bitmaps

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

Hi. If any of you is nice enough to take the time to help me then I would greatly apreciate. I''m new to game programming (about a year of C++ and the basics of Win32 programming) and I just want to start by displaying (and maybe moving ?) a bitmap on the screen using DirectX in the simplest way possible. Any example code or pseudo-code is very welcomed. Thank you ! -RyuJin

Share this post


Link to post
Share on other sites
Advertisement
Direct X makes it rather easy. If you''re using DirectDraw, you can use a set of utilities included with the SDK, at least it used to be...you need ddutil.h and ddutil.cpp. Include those in your project then create a surface:

LPDIRECTDRAWSURFACE7 myBitmap;

Then load a bitmap into the surface using the DDLoadBitmap function defined in ddutil:

lpDDSGUI = DDLoadBitmap(myBitmap, "filename.bmp", 0, 0);

The first param is your surface name, second is the bitmap file name (Must be in same directory), the two numbers are the x and y offset, they specify how far from the top left corner the bitmap is placed if im not mistaken. Hope that helps, if you can''t fin the ddutil, replay and I''ll see if I can send it.

Share this post


Link to post
Share on other sites
Seems like I cant make it work can anyoen give me more precision please ? How do I initialize DirectDraw ? Surfaces ? etc... ? If its too extensive can u point me to some kind of ressource that can help me achieve this simple task easily ?
Thank you !
-Ryu-Jin

Share this post


Link to post
Share on other sites
Didn''t realize you didn''t know DirectDraw. There''s some great tutorials in the articles & resources section of GameDev under DirectX, there''s a whole DirectDraw section including full source code on initializing DDraw, those should help

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!