Sign in to follow this  

C# + Some directdraw questions

This topic is 4416 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 all, I am developing a graphics engine using DirectDraw and C#. It is working very nice, but I have a few questions: 1) I have a big island with some bugs. I want them to rotate. How can I rotate a bitmap surface? 2) My graphics engine is able to resize and draw everything in the right size. However, when I am using large images which are getting very small, it looks very ugly. (wrong, as it should be). Is there anything I can do about this? Thanks!

Share this post


Link to post
Share on other sites
Quote:
Original post by Tischnoetentoet
1) I have a big island with some bugs. I want them to rotate. How can I rotate a bitmap surface?

In DirectDraw, you can't. You have to rotate a virtual quad, and write a texture mapper that locks the target surface and maps the bmp into it. Basically, a mini -software-rasterizer.

Quote:
2) My graphics engine is able to resize and draw everything in the right size. However, when I am using large images which are getting very small, it looks very ugly. (wrong, as it should be). Is there anything I can do about this?

Make the original bitmap small in size. In general, a 2D asset should have a size the same as or near to the one it has in game.

Share this post


Link to post
Share on other sites
Hello,

Thanks for the reply! Too bad that option 1) is not possible in directdraw.

I have one question left. I am using this code


// Create our destination rectangle
pntTarget = m_oRenderTarget.PointToScreen(m_oRenderTarget.Location);
oDestRect = new Rectangle(pntTarget, m_oRenderTarget.Size);

// Try to draw
try
{
m_oSurfacePrimary.Draw(oDestRect, m_oSurfaceSecondary, DrawFlags.DoNotWait);
}
catch (SurfaceLostException)
{
// Create the surfaces
CreateSurfaces();
}



The strange thing is that the destrect function is failing. When I don't use the destrect, everything works, but when using destrect, the surface is not drawn in the rectangle I want it to be.

Any idea what I am doing wrong?

[Edited by - Muhammad Haggag on November 12, 2005 10:09:42 PM]

Share this post


Link to post
Share on other sites

This topic is 4416 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this