News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Suitable Drawing API?

Started by Mr Hippy, June 09, 2012, 11:49:34 AM

Previous topic - Next topic

Mr Hippy

What is the suitable drawing API in Windows now? Direct2D is supposed to be the successor to GDI/GDI+, but it seems to complex too use with assembly. The whole DirectX API and it's subsystems are geared mostly towards C++. The older technology, GDI, happens to be phased out by Microsoft.

I'm not sure what to use. I may go with SDL.

dedndave

i think you can still use GDI - all the way up to windows 8, at least
if MS abandoned GDI (or GDI+, for that matter), thousands of applications would stop working
they may as well stop calling it windows and name it something else   :P

i might add...
you can do a lot with GDI and GDI+
most everything short of gaming (or similar applications) where 3D rotations and views are required
from there - DirectX, OpenGL, etc

Farabi does some pretty cool stuff - i think he uses OpenGL

Ben

I chose Direct2D for my current app, and yeah, you pretty much need C++ to use it. Unless you can implement OOP in masm! I read an article a while back showing how to do it in C, but it was ridiculously complicated. I figured I'd save myself grief and just do it in C++.

You can't use it on WinXP either from what I understand  :(; though I still think its a better choice than GDI. Not too sure about SDL...

hutch--

You tend to point the right tool at the right place, presentation graphics for applications is best done with a combination of controls and good old fashioned GDI because its simpler, GDI+ has additional capacity with additional complexity where directX is really the tool for animation, gaming and the like. OpenGL is an alternative for animation and gaming.

BogdanOntanu

It is very easy to use DirectX in ASM. And many people here use it for their games.

However DirectX API's are suitable for games and similar applications only. You know ... the kind of application that takes over your full screen and then you start diving into an story and start shooting at things and blowing things up on screen... or maybe start building railroads or skyscrapers kind of stuff.

However, if you want to draw on a "normal" desktop application's "surface" then you should use GDI or GDI+ functions. They are also easy to use in ASM.

One way or another those draw functions are here to stay. It does not matter how they are named and what kind of C++ or Java or Javascript interface they present to the top level programmer. An OS always needs to draw stuff in "windows" or "tiles" and it needs an API interface to do this.

And guess what? It does run on the CPU and the CPU only knows ASM and because of this it is relatively easy to use them in ASM  no matter what lies are told to the top level programmer ;)


Ambition is a lame excuse for the ones not brave enough to be lazy, www.oby.ro

Mr Hippy

Thank you everyone for the responses! Although, when I meant GDI/GDI+ being phased out: I meant that Microsoft deemed it as a "legacy" API. On MSDN, it is suggested for new applications to implement newer technologies like WIC, DirectX, and DirectComposition (http://msdn.microsoft.com/en-us/library/windows/desktop/ee663279%28v=vs.85%29.aspx.)

Being that the Windows Imaging Component (WIC) is a "low-level API for [manipulating, accessing, and converting] digital images"; the DirectX API and it's sub-systems are for a full gaming experience; the DirectComposition API can be used to "create visually engaging user interfaces." There it is -- everything there for a rich user experience.

dedndave

also....
GDI seems to be a little faster than GDI+ for drawing

alloy

Quote from: BogdanOntanu on June 09, 2012, 09:16:40 PM
It is very easy to use DirectX in ASM. And many people here use it for their games.

I'm curious as to how it is easy in assembly. It might be easy in C++ but I do not think it is easy in assembly.

jj2007

Quote from: alloy on December 01, 2013, 02:53:15 AMIt might be easy in C++ but I do not think it is easy in assembly.

Go here and search for DirectX, then come back and repeat your statement ;-)

There is even a thread started by a certain alloy  ::)

alloy

Yep..... I know, I know. Its just that I don't think that in assembler its not so easy. Outside some direct3d code anything I've seen mixing assembly and directx required some c++, some COM, some compiling and in one example some name unmangling.