Jump to content
  • Advertisement

Archived

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

Maduray

Please, Bitmap Loading with DirectX

This topic is 5755 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, I''ve just started out my first game and I''m very happy with my first attempt to finnally complete a game but already I have a problem. After initializing DirectX 7.0, thus DirectDraw 7.0 since I''m trying to do a simple 2d game, I created a primary surface, a secondary surface and now I want something on the screen because it really looks empty So hapilly I tried to load my bitmap and after looking in the GDnet articles I find one that tells me to crate an offscreen surface then load my bitmap into that offscreen surface and then blit it into my backbuffer so I can flip it and display it on the screen. However even after doing everything told in the tutorial , it doesn''t work So I just want to know a simple thing, what must a do step by step to see my bitmap on the screen ?? Any help would be very apreciated and I thank you for you time. -You may think you are different than him, yet death unites us all, like it or not.-

Share this post


Link to post
Share on other sites
Advertisement
make a surface, then use the GDI function to load it in, then use the back buffer to blit, then flip with the primarysurface.

IDirectDrawSurface7* background;

background = GDILoadBitmap( "background.bmp" );

Back->Blt(...);
Prim->Flip(...);

GDILoadBitmap() must retrn a value of IDirectDrawSurface7*:

IDirectDrawSurface7* GDILoadBitmap( char* filename ){...}

Share this post


Link to post
Share on other sites
lol hi Pipo ! yes it is me. I''m finnaly back after months without programming so I have forgotten everything. I think I will go on alone now before getting into somthing bigger (like last tim, I''m sorry...) So thanks for your help But this function your talking about can you be more precise about this GDI stuff ? What is the exact funtion name ? parameters ? and this Surface Background : is it a backbuffer, offscreen ? And Do you really do it that way ? Background = TheGdiFunc(...); You assign the return value of the function to a pointer ? (LPDIRECTDRAWSURFACE7 is a pointer , isnt it ?)
Thank you for your time

- Do not spend your time dying , but living -

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!