Jump to content
  • Advertisement

Archived

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

MrBeaner

2D

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

Hello- I am trying to do some simple 2d graphics using DX8. I am displaying to a window, not full screen. I just want to make sure that i understand the process correctly. All i really need to do is use the LoadSurfaceFromFile function which puts info into my LPDIRECT3DSURFACE8 Surface. Then assuming that my surface is the same size as my backbuffer, i just do a CopyRects to the backbuffer, then present it. All i am really trying to do is put an image in the background. I have looked over tutorials, and everything seems to point to this genral pipeline. Are there any pitfalls i should be wary about? What is happening is that i can render a bunch of pixels to the window, but i can''t load an image. I would like to debug it myself (as it is really the only way to learn this ish), so any helpfull guidelines would be appretiated. Thank you!

Share this post


Link to post
Share on other sites
Advertisement
Apparently defining the backbuffer as LOCKABLE is a massive hog on system resources and should probably be avoided.

Instead, create d3d device as normal and create D3DXSprite or BillBoard (textured quad) and put your surface on there as a texture.

Share this post


Link to post
Share on other sites
mm.. if i had to make something like this.. i would do some stuff with orthogonal projection and drawing lovely (i used this word too much today erk erk) rectangular things in it.

you can use the lovely D3DXMatrixOrthoLH or RH for this i suppose.

hmm... i explain nothing. i am lousy HA!

May The Gzoo Be With You!
~Lord Gzoo

[edited by - lord gzoo on June 27, 2002 5:15:04 PM]

Share this post


Link to post
Share on other sites
I read a tut on the orthagonal projection. I wil look at the documentation about it, as well as billboarding and teh D3DXSprite.

Locking the backbuffer is bad? I thought you had to do that in order to prevent anything from writing to that location? Is this something that i should strive to avoid in the future if i want to do more complex drawing?

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!