loading bmp file

Started by
7 comments, last by Evil Steve 13 years, 7 months ago
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++.
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?
as a sprite or as a surface?
:)
as a sprite
Have not used DX really but look up D3DXSprite or Sprite. I dont know if its deprecated anymore.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

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.
... OK, so what is the problem?
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.

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?

This topic is closed to new replies.

Advertisement