Please, Bitmap Loading with DirectX

Started by
2 comments, last by Maduray 21 years, 6 months ago
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.-
-----** (^_^) **-----
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 ){...}
Maduray? I just noticed it is you
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 -
-----** (^_^) **-----

This topic is closed to new replies.

Advertisement