Which API for 2D Graphics? The Future?

For everything that's not in any way related to PureBasic. General chat etc...

What's better (Programming Language independent)?

2D API for 2D Graphics (SDL, ...)
3
15%
3D API for 2D Graphics (DirectX, OpenGL, ...)
17
85%
 
Total votes: 20

Violet
Enthusiast
Enthusiast
Posts: 106
Joined: Sun Dec 23, 2007 6:30 pm

Which API for 2D Graphics? The Future?

Post by Violet »

I'm really torn, I cannot decide if I should use 2D APIs like the PureBasic Sprite and Screen Library (SDL) or modern 3D APIs (OpenGL would be my favourite).

"Old" 2D APIs
  • They write the Sprite information directly into the Video Buffer (in SDL called "blitting") which works very fast
  • Since Screen Resolutions are getting very high sprites get smaler on the screen (if they are not scaled somehow, that's something important what's missing)
  • Work nearly everywhere
"New" 2D APIs (in reality 3D APIs like OpenGL)
  • Fully hardware accelerated transformation (rotation and scalation)
  • Fully hardware accelerated effects (alpha blending, different blending modes, anti-aliasing)
  • Automatic Depth Sorting
  • If programmed right, they are resolution independent (ok, there's a point where low resolution images get blurry at a big scalation/resolution)
  • No Driver, No Screen to draw on!
  • 3D Games and APIs are already so popular, DirectX and OpenGL are getting standard APIs for Game Graphics(, aren't they?) and seems they are going to be the future
  • Windowsize independent resolution of the graphical output (A 320x240 Screen can be stretchted to a 800x600 window, the pixels are just interpolated)
What's the better decision? I just can't get familiar with the imagination I programmed a 2D game, which optimum resolution is 640x480 and making it work for 1280x800... because everything will look so small. Since in PureBasic a scaling Option for Sprites is missing (I already know such "work-arounds", but they look really ugly, not like I could smoothly scale an image on a quad with OpenGL) it's not really possible to make a game look always the same (just sharper with higher resolutions).

I already wrote the "Illusion Graphics 2D" Engine based on OpenGL some time ago, just published in the german forums (windows only).

A by-the-way question from is also: if I write a user interface for PureBasic's standard Sprite&Screen Library which works with windows which can overlap, how do I do the Z-Sorting? Example: I press on the button on the foreground window, but how do I detect that this button was pressed, and not the button on the background window at the same position?

I just don't know what to do! :)
best regards,

Violet
Violet
Enthusiast
Enthusiast
Posts: 106
Joined: Sun Dec 23, 2007 6:30 pm

Subforum

Post by Violet »

Oh, I saw... is this maybe the wrong Subforum for this Topic?
best regards,

Violet
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

DirectX is both: DirectDraw (Blitting) and Direct3D (Vectorgraphics)
bye,
Daniel
Violet
Enthusiast
Enthusiast
Posts: 106
Joined: Sun Dec 23, 2007 6:30 pm

Post by Violet »

I knew that, and because of that I wasn't sure to mention DirectX, also it's just windows. In that case the "old" API would be DirectX Blitting and the "new" API Direct3D.
best regards,

Violet
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

Are you planning to offer us your Illusion Graphics 2D engine? Nicht Wahr? :wink:
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
Violet
Enthusiast
Enthusiast
Posts: 106
Joined: Sun Dec 23, 2007 6:30 pm

The Wayne Train! *wayne**wayne*

Post by Violet »

:lol:

I gave up Illusion Graphics because after that I worked with C# and XNA and other stuff, did a trip in game programming until I got stuck. Until I arrived at a point where I didn't know where to, because somehow I lost the ability to make decisions. Not longer just the API was the question, the language, the engine (self-made or other), a.s.o.

I tried to write a UserLibrary (maybe the best way for that) based on OpenGL, a Sprite&Screen library, but I got lost helpess within the linking affair. (see here)
Also my plan was, to maybe make a OpenGL Wrapper for PureBasic, could be useful. But on Linux only (it's much easier there, I think).

The question now is primary for myself, for my own projects, not directly for creating another API. But that would be really fun to integrate a 2D OpenGL based API neatless into PureBasic (on Linux). Just no getting further because no one knows how to handle the linker problems...
best regards,

Violet
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

I'd answer 2D AND 3D Directx API for 2D Graphics.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Violet
Enthusiast
Enthusiast
Posts: 106
Joined: Sun Dec 23, 2007 6:30 pm

Post by Violet »

And why that?
best regards,

Violet
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Because I find DirectX (its 3D and 2D API functions) the best thing for 2D stuff.
No doubt it is faster and more powerful than SDL and other similar libs.

However i don't know if OpenGL has power for 2D graphics, and also i have not made a serious DirectX 3D vs OpenGL comparison, but only a superficial comparison and DirectX is best if well programmed imo.

EDIT:
In short: for the future of 2D graphics i bet for DirectX.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Opengl is suprisingly simple to get going for basic 3d-accelerated 2d graphics, and it pretty nice when it comes to adding 'extras' because as a state-based API you just need to change the states at certain times to achieve certain effects.

I've never really 'directly' used directX so I cant comment there, but I've made plenty of 2d games with openGL and it was pretty simple to do.

Check out my most recent:
http://www.dracsoft.com/#58
Violet
Enthusiast
Enthusiast
Posts: 106
Joined: Sun Dec 23, 2007 6:30 pm

Post by Violet »

Seems like I know, on which I continue programming the next time. 8)
best regards,

Violet
Post Reply