Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Managed DirectX Drawing Surface?

Status
Not open for further replies.

Insider1984

Technical User
Feb 15, 2002
132
0
0
US
I'm looking at moving away from our custom designed GDI graphics and toward DirectX for a simple display surface that does two things:

1. Display a bmp quickly
2. Display colored points on the bitmap
3. Display rectangles on the bitmap

Seems easy but I haven't had time to look into Managed DirectX and while we only want 2D drawing (with multiple layers) it seems DirectDraw is depreciated and 3D turned 2D is our only hope.

Does anyone know of an easy drawing surface that would work for our needs. A simply dll with a DirectX drawing surface that can display a bmp and points and rectangles?



=====================
Insider
4 year 'on the fly' programmer
C, C++, C#, MFC, Basic, Java ASP.NET
 
Why would you need to move to directX if your only drawing points and rectanlges? Seems like overkill.

Im not too sure about the whole DirectDraw being completely deprecated. Maybe all the fancy functions arent there any more, but that doesnt mean you cant still do simple 2D drawing like points, lines and rects.

But to answer your question, With my limited expirience with Direct3D, I know that drawing a point in 2d Space can be achieved in at least two ways:
1) set the pixel(s) to whatever color you want directly in the back back buffer. The back buffer is basically a 2d image that stores everything being rendered until its told that the rendering/drawing is done and is sent to the screen/device.
2) use a custom vertex of type "Transformed" or "TransformedColored" and render them using DrawPrimitives(PrimitiveTypes.PointList, .....)

The 2nd option allows you to rotate and do other fancy transforms on, but the first, sice you basically go straight to the back buffer, cant do much.

And this may seem redundant, but I've seen people create a GDI+ graphics object using the backbuffer, to allow them all the GDI+ funtions to be applied either before or after thier 3D is executed.
 
As an added tip: everytime you minimze your app and then bring it back up, you have to manually refresh your surface draw.

That should help avoid some headache.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top