Jump to content
  • Advertisement
Sign in to follow this  
phil67rpg

loading bmp file

This topic is 3037 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 am trying to load a bmp file and display it on the screen. However I am trying to draw only a portion of the bmp file to the screen. I am using direct x9 and c++.

Share this post


Link to post
Share on other sites
Advertisement
?UNDEF'D  STATEMENT ERROR IN 174
READY.



REM in other words, what part of "loading a bmp file and draw only a portion of
REM the bmp file to the screen" are you having trouble with?

Share this post


Link to post
Share on other sites
well I am having a problem getting the bmp file to be blitted to the screen.I am trying to draw castles for my warlords game.

Share this post


Link to post
Share on other sites
I think he doesn't understand.

OP:
*Can you load files at all?
*Can you load BMP files? Or can you type it in google? Probably the first few hits will have the specifications you need
*Can you draw a quad on the screen?
*Can you set up texturing?
*Do you know what texture coordinates are?
*Can you adjust these coordinates in a way, that fits to your needs?
*Do you know how to draw a fullscreen quad?
*Can you set up the projection and the viewport for that?
*Do you understand, that it doesn't matter at all what you are trying to draw castles for your Warlord game?

I will be rough as usual: judging by your forum posts you are either a 12 year old, or you should try to get another hobby.

Share this post


Link to post
Share on other sites
Quote:
Original post by phil67rpg
well I am having a problem getting the bmp file to be blitted to the screen.I am trying to draw castles for my warlords game.
1. You don't "blit" to the screen in D3D, that's a 2D concept.

You want to:
1. Create your D3D device.
2. Load the texture with D3DXCreateTextureFromFile()
3. Create a sprite with D3DXCreateSprite()
4. Every loop, you want to:
4a. Clear the backbuffer and z-buffer (pDevice->Create())
4b. Begin rendering (pDevice->BeginScene())
4c. Draw the sprite (pSprite->Draw())
4d. End rendering (pDevice->EndScene())
4e. Present the backbuffer to the frontbuffer (pDevice->Present())

What part of that are you having problems with (And exactly what problems - what compile errors, what output from the debug runtimes, etc)? Or is there some other step you're having problems with?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!