Jump to content
  • Advertisement
Sign in to follow this  
VooDooTom

Should I use DirectX or GDI for 2D drawing

This topic is 3806 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 there, currently I am workon a mobile computer (Windows Mobile 5) project in which geo referenced vector date should be displayed. The fact that I code for Windows Mobile can be left out I think - my question points in another direction. Something about the data to be displayed: This data consists of points, polylines and polygones - mostly around 10.000 parts. To draw this data I currentliy use GDI with an - kind of - optimized data structure for this scenario. I have an array with all the points I have in there (e.g. all points of each polyline in the right order one after another) and an array which stores the length for every polyline. This way I can go through all polylines fast (at least I think so). Now I discovered that I am able to use DirectX on WindowsMobile which has reduced functionality - comparable to DirectX 8 for desktop PCs. Exactly, there are those two namespaces (I use C# - but would have no problem to make the drawing in C++): Microsoft.WindowsMobile.DirectX: http://msdn2.microsoft.com/de-de/library/microsoft.windowsmobile.directx(VS.80).aspx Microsoft.WindowsMobile.DirectX.Direct3D: http://msdn2.microsoft.com/de-de/library/microsoft.windowsmobile.directx.direct3d(VS.80).aspx Now I do not have any experiences in using DirectX. My question is if it would be faster to draw those polylines (for example) with DirectX that GDI (what I currently use). Moreover, is there a kind of batch polyline drawing (ther is such thing on desktop in the gdi32.dll, but not for mobile use) in DirectX? Thank you in advance, mtg

Share this post


Link to post
Share on other sites
Advertisement
Direct3D exposes a device-independent, hardware accelerated interface to an application. Direct3D applications can exist alongside GDI and both have access to the computer's graphics hardware through the device driver for the graphics card. Unlike GDI though, Direct3D can take advantage of hardware features by creating a HAL (Hardware Abstraction Layer) device, which provides hardware acceleration to graphics pipeline functions. So the answer to your first question is yes; it would be orders of magnitude faster to use Direct3D (or OpenGL, or any other hardware accelerated API for that matter) instead of an API which doesn't take advantage of the underlying hardware, but the gain in performance is directly proportionate to the power of the dedicated or integrated graphics processor on the phone, which I'm not familiar with.

But as always, learning new things takes quite some time and effort and Direct3D is a complex API, *especially* if you're not familiar with the graphics pipeline and basic computer graphics terminology and theory. Besides, how much performance you would gain as a result of this transition is totally dependant on the power, capabilities and feature-set of the underlying graphics processor on your phone (if there is any at all?!). So, I'd suggest you first do some research on the underlying hardware to find out if it offers any hardware acceleration.

Quote:
Moreover, is there a kind of batch polyline drawing (ther is such thing on desktop in the gdi32.dll, but not for mobile use) in DirectX?

Yes, there is.

Besides, OpenGL ES is another viable option which you might like to take a look into.

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.

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!