Board index » delphi » DirectX vs. OpenGl vs. GDI

DirectX vs. OpenGl vs. GDI

I am new to programming graphics in Delphi.  Would someone explain the pros
and cons of using DirectX, OpenGl and the Windows GDI and when one would
choose to use any of the above?

Thanks.

 

Re:DirectX vs. OpenGl vs. GDI


  Easy enough:

  DirectX:  Everyone can use it...  (DirectX is made up of OpenGL and MS's
own API)  --  This is by far the best way to go...  (I'm sure I'll get hosed
for this, but it's fact...  --  OpenGL is nice, but a lot of video cards
simply can't use it's 3d and accelerated functions...  And D3D is easily as
fast as OpenGL is now' adays...  (tho I'd never had said that a few years
ago...))

  OpenGL:  Very fast, and very specialized:  You show me an OpenGL game, and
I'll show you 50 D3D games...  --  But, OpenGL is pretty cool (especially
for CAD applications)...  QuakeGL was very nice, but D3D can now do
everything it did...  (thus the reason MS incorporated it into DirectX)

  Window GDI:  Slow, pointless, etc, etc...  Doesn't count...

--

Jason Wallace
Work:  Jason_Wall...@intuit.com
Home:  Dark...@SLSoftware.reno.nv.us

Quote
"Terry Thompson" <terrythomp...@erols.com> wrote in message

news:849b1r$pvf11@forums.borland.com...
Quote
> I am new to programming graphics in Delphi.  Would someone explain the
pros
> and cons of using DirectX, OpenGl and the Windows GDI and when one would
> choose to use any of the above?

> Thanks.

Re:DirectX vs. OpenGl vs. GDI


Ok, I'm not a guru but would say that:
OpenGl is used for 3d graphics and independent from the OS ( - but Delphi
still is , so that isn't important)
DirectX offers many possibilities (look at D3d, DDraw, DInput, DSound...)
To compare it with OpenGL and the GDI you can look at D3d and DDraw. D3D is
more difficult than OpenGl and works only with win32.
DDraw is - for *really* fast graphics - much better than the GDI, but for
usual graphics it is enough, and it is very easy to program.

Philipp

Re:DirectX vs. OpenGl vs. GDI


If you do not have a need for speed and you are not producing complex
three-dimensional graphics, then you can probably get by with GDI. If you
need smooth animation with more complexity than the GDI is suitable for, but
you are strictly 2-D, you might consider DirectX, but the API is VERY
daunting. For 3-D the choice is between Direct3D (a subset/extension of
DirectX) and OpenGL. Here your trade-offs are:
1) There is a lot more Direct3D code "out there" (mostly C++) for the same
reasons there is more Visual C++ code than there is Delphi code.
2) OpenGL is MUCH easier to use. It is also multi-platform. The graphics
part of your code will be pretty much portable to various flavors of Unix
and to the Mac. Eventually even the Delphi part will be somewhat portable to
Linux (an open-source version of Unix). There is also a vast amount of
OpenGL code that has been written (mostly in C, and a lot in C++, and even
some using MFC); my book can help you get started using Delphi and OpenGL.

Jon
http://home1.gte.net/jqjacobs/index.htm

Quote
Terry Thompson wrote in message <849b1r$pv...@forums.borland.com>...
>I am new to programming graphics in Delphi.  Would someone explain the pros
>and cons of using DirectX, OpenGl and the Windows GDI and when one would
>choose to use any of the above?

Re:DirectX vs. OpenGl vs. GDI


Is there any difference in terms of performance between Direct3D and OpenGL?

I want to develop an architectural drawing app (similar to FloorPlan and
Home Architect) in which I can draw floor plans in 2D and then render the
plan in 3D and do walk throughs.  It would use a library of 2D symbols, that
would be somewhat generic, and allow for a lot more customization of the 3D
rendering (e.g., a door might be a simple flat door, or might have 6 panels,
or have a window pane).  I would like for the animations on the walk through
to be somewhat smooth, but don't need thesame level of smoothness that would
be needed a complex interactive game.  Do you have any thoughts about which
(GDI, Direct3D or OpenGL) might be more appropriate?

Quote
Jon Jacobs <jqjac...@gte.net> wrote in message

news:84ad4e$6n12@forums.borland.com...
Quote
> If you do not have a need for speed and you are not producing complex
> three-dimensional graphics, then you can probably get by with GDI. If you
> need smooth animation with more complexity than the GDI is suitable for,
but
> you are strictly 2-D, you might consider DirectX, but the API is VERY
> daunting. For 3-D the choice is between Direct3D (a subset/extension of
> DirectX) and OpenGL. Here your trade-offs are:
> 1) There is a lot more Direct3D code "out there" (mostly C++) for the same
> reasons there is more Visual C++ code than there is Delphi code.
> 2) OpenGL is MUCH easier to use. It is also multi-platform. The graphics
> part of your code will be pretty much portable to various flavors of Unix
> and to the Mac. Eventually even the Delphi part will be somewhat portable
to
> Linux (an open-source version of Unix). There is also a vast amount of
> OpenGL code that has been written (mostly in C, and a lot in C++, and even
> some using MFC); my book can help you get started using Delphi and OpenGL.

> Jon
> http://home1.gte.net/jqjacobs/index.htm

> Terry Thompson wrote in message <849b1r$pv...@forums.borland.com>...
> >I am new to programming graphics in Delphi.  Would someone explain the
pros
> >and cons of using DirectX, OpenGl and the Windows GDI and when one would
> >choose to use any of the above?

Re:DirectX vs. OpenGl vs. GDI


Hi Jon,

Here is a loaded question.  For developing 3D games...which would YOU
prefer?  I personally would think that OpenGL would be best just because of
what you have outlined in the other threads.

Enjoying your book.  Thanks for writing it for the Delphi Community.

Take Care,
Dana Dill

Quote
"Jon Jacobs" <jqjac...@gte.net> wrote in message

news:84ad4e$6n12@forums.borland.com...
Quote
> If you do not have a need for speed and you are not producing complex
> three-dimensional graphics, then you can probably get by with GDI. If you
> need smooth animation with more complexity than the GDI is suitable for,
but
> you are strictly 2-D, you might consider DirectX, but the API is VERY
> daunting. For 3-D the choice is between Direct3D (a subset/extension of
> DirectX) and OpenGL. Here your trade-offs are:
> 1) There is a lot more Direct3D code "out there" (mostly C++) for the same
> reasons there is more Visual C++ code than there is Delphi code.
> 2) OpenGL is MUCH easier to use. It is also multi-platform. The graphics
> part of your code will be pretty much portable to various flavors of Unix
> and to the Mac. Eventually even the Delphi part will be somewhat portable
to
> Linux (an open-source version of Unix). There is also a vast amount of
> OpenGL code that has been written (mostly in C, and a lot in C++, and even
> some using MFC); my book can help you get started using Delphi and OpenGL.

> Jon
> http://home1.gte.net/jqjacobs/index.htm

> Terry Thompson wrote in message <849b1r$pv...@forums.borland.com>...
> >I am new to programming graphics in Delphi.  Would someone explain the
pros
> >and cons of using DirectX, OpenGl and the Windows GDI and when one would
> >choose to use any of the above?

Re:DirectX vs. OpenGl vs. GDI


Quote
>Here is a loaded question.  For developing 3D games...which would YOU
>prefer?  I personally would think that OpenGL would be best just because of
>what you have outlined in the other threads.

Not too bad as loaded questions go. I use OpenGL for ALL my graphics
development. I have no qualms about using OpenGL for games. Carmack of Id
Software uses OpenGL and, as a matter of policy, will NOT use
DirectDraw/Direct3D. I subscribe to the OpenGL game developer mailing list
and find that a lot of game developers are using OpenGL. I recently bought
MindRover and really like it. I was watching it being developed as I
monitored the list. I MIGHT use DirectDraw/Direct3D if someone held a loaded
gun to my head, but then again...

Quote
>Enjoying your book.  Thanks for writing it for the Delphi Community.

And thank you.

Jon
http://home1.gte.net/jqjacobs/index.htm

Re:DirectX vs. OpenGl vs. GDI


Quote
Terry Thompson wrote:

> Is there any difference in terms of performance between Direct3D and OpenGL?
> [snip]

I would like for the animations on the walk through

Quote
> to be somewhat smooth, but don't need thesame level of smoothness that would
> be needed a complex interactive game.  Do you have any thoughts about which
> (GDI, Direct3D or OpenGL) might be more appropriate?

I've been looking into this for a while, and, in my opinion, Open GL is
the better of the two, mainly because it is easier to program with.  The
API for Open GL is glorious (and portable).  The Direct3D API is rather
{*word*193}.  John Carmack (creator of Quake), has some choice words to say
about the D3D vs. OpenGL debate, that may sway your opinions.  If anyone
knows about these things, then he should!.

Check out:
http://www.scs.ryerson.ca/~h2jang/gfx4.html#ope

Hope this helps,
and good luck with the program, whichever technology you choose!
Steve Mayne.

--
|----------------------------------|
| Steve Mayne - Programmer/Analyst |
|    mail: st...@mayneware.com     |
| visit: http://www.mayneware.com  |
|----------------------------------|

Re:DirectX vs. OpenGl vs. GDI


  Not to burst your bubble, but those comments were made about DirectX back
when DirectX 2 was out (4 revisions ago!)  --  DirectX is the better of the
two, as it works on all systems...  OpenGL doesn't....

--

Jason Wallace
Work:  Jason_Wall...@intuit.com
Home:  Dark...@SLSoftware.reno.nv.us

Quote
"Steve Mayne" <st...@mayneware.com> wrote in message

news:386918DB.FC67F76F@mayneware.com...
Quote

> I've been looking into this for a while, and, in my opinion, Open GL is
> the better of the two, mainly because it is easier to program with.  The
> API for Open GL is glorious (and portable).  The Direct3D API is rather
> {*word*193}.  John Carmack (creator of Quake), has some choice words to say
> about the D3D vs. OpenGL debate, that may sway your opinions.  If anyone
> knows about these things, then he should!.

> Check out:
> http://www.scs.ryerson.ca/~h2jang/gfx4.html#ope

> Hope this helps,
> and good luck with the program, whichever technology you choose!
> Steve Mayne.

> --
> |----------------------------------|
> | Steve Mayne - Programmer/Analyst |
> |    mail: st...@mayneware.com     |
> | visit: http://www.mayneware.com  |
> |----------------------------------|

Re:DirectX vs. OpenGl vs. GDI


Quote
Jason Wallace wrote:

>   Not to burst your bubble, but those comments were made about DirectX back
> when DirectX 2 was out (4 revisions ago!)  --  DirectX is the better of the
> two, as it works on all systems...  OpenGL doesn't....

Ok, ok, so John Carmack's words were 4 revisions ago, but I've been
using OpenGL and DirectX right up to version 5, and still I find the
OpenGL API better to use.  OpenGL can be easily ported to UNIX as well
(that's what I mean when I say 'portable') - what do you mean when you
say DirectX works on all systems and OpenGL doesn't?

I'm just throwing in my 2 pennies worth, sorry to tread on your toes.

Regards,
Steve Mayne.

Re:DirectX vs. OpenGl vs. GDI


Quote
Dana Dill wrote:
> Here is a loaded question.  For developing 3D games...which would YOU
> prefer?  I personally would think that OpenGL would be best just because of
> what you have outlined in the other threads.

I have both Unreal Tournament and Quake 3 Arena. Both are 3D games. Unreal
Tournament works extremely well with my Riva TNT card at 1024 x 768 with hardly
any loss of frame rate. Quake has to run at a lower frame rate (640 x 480 or 800
x 600) to get even acceptable performance.

I used to code for OpenGL but found it messy with Delphi. Now I've tried D3D and
it's a lot easier, I've gotten a lot further. This could be due to my increased
understanding of COM (spent six months learning it on one job).

I can see that D3D is a lot more to learn than OpenGL, and that OpenGL is
multiplatform, however, DirectX is perhaps accelerating beyond OpenGL, IMHO.

Pete

Re:DirectX vs. OpenGl vs. GDI


Hello Pete, acctually the problem is that you card dosn't support FireGL (A
dirivitive of OpenGL) witch is what was used for Quake.  I have a FireGL
3000 AGP card that supports: OpenGL, FireGL, and DirectX (Dosn't hurt that
its also 64 meg, btw the cost $4000.00).  I have no problem running any
graphics program, but when I try to run the same programs on my VooDoo3 PCI
I see a little difference in frame rates, yes the DiretX is faster, but
again this is because of hardware support.  Microsoft has money and theirfor
they have the support.  The biggest question in writing a 3D graphics
program should be how many platforms do you want it to run on.  My game (Eon
Clash) can currently be compiled and ran on allmost 6 platforms simply by
using OpenGL and staying away from "Windows Only" commands.

Quote
"Pete Goodwin" <ime...@yfi.co.uk> wrote in message

news:38712455.2E8EDA20@yfi.co.uk...
Quote
> Dana Dill wrote:

> > Here is a loaded question.  For developing 3D games...which would YOU
> > prefer?  I personally would think that OpenGL would be best just because
of
> > what you have outlined in the other threads.

> I have both Unreal Tournament and Quake 3 Arena. Both are 3D games. Unreal
> Tournament works extremely well with my Riva TNT card at 1024 x 768 with
hardly
> any loss of frame rate. Quake has to run at a lower frame rate (640 x 480
or 800
> x 600) to get even acceptable performance.

> I used to code for OpenGL but found it messy with Delphi. Now I've tried
D3D and
> it's a lot easier, I've gotten a lot further. This could be due to my
increased
> understanding of COM (spent six months learning it on one job).

> I can see that D3D is a lot more to learn than OpenGL, and that OpenGL is
> multiplatform, however, DirectX is perhaps accelerating beyond OpenGL,
IMHO.

> Pete

Re:DirectX vs. OpenGl vs. GDI


Quote
Jeremy Darling wrote:
> Hello Pete, acctually the problem is that you card dosn't support FireGL (A
> dirivitive of OpenGL) witch is what was used for Quake.  I have a FireGL
> 3000 AGP card that supports: OpenGL, FireGL, and DirectX (Dosn't hurt that
> its also 64 meg, btw the cost $4000.00).  I have no problem running any
> graphics program, but when I try to run the same programs on my VooDoo3 PCI
> I see a little difference in frame rates, yes the DiretX is faster, but
> again this is because of hardware support.  Microsoft has money and theirfor
> they have the support.  The biggest question in writing a 3D graphics
> program should be how many platforms do you want it to run on.  My game (Eon
> Clash) can currently be compiled and ran on allmost 6 platforms simply by
> using OpenGL and staying away from "Windows Only" commands.

My perception of multiplatform support is that it's a non-starter. Now we have a
platform that is popular but very non-standard and decidedly NOT open. Windows,
in all its shape and gory, I mean glory.

People want what works, what looks good and what they can afford. Windows gives
them that. Has Unix succeeded in that, so far? Has anything else reached out so
successfully to the masses who buy PC's and run Windows?

I realise the market in Linux is slowly growing. But, for all the hype, its
still UNIX underneath. Funny how the desktops mimic Windows!

Pete.

Re:DirectX vs. OpenGl vs. GDI


Finally a conversation worth having... Yes, as a matter of fact other OS's
have done what PC's have done,  take Mac for instance.  I know that everyone
reading this just went "YUCK", but face it Windows is modled after Mac (Not
the reverse) and Mac has been doing 3D with better image quality for years.
This means that allmost all the graphics developers are using Mac.  (OOPs
that wasn't supposed to get out)  Yes, alot of good graphics have been done
by the PC (Lately) but allmost all the ones you look at and go WOW come from
Mac.  Including some of your wonderfull games.  (The textures and char
animations, not the engines).  Finally, your statistics of windows being the
"Leading OS" is in the united states more or less up until early 90's (If I
rember correctly).  Their are many OS's out their that you arn't even
considering and probably many that most people haven't herd of.  Why is
windows the standard, Money, Power, and Greed.  Microsoft was smart when
they started and cornered all the hardware producers into building hardware
that was "Windows" specific.  Have you ever tried to run a WinModem in a Mac
or on a Unix box (Guess what it wont work), but you can take either of their
modems and run in a PC (Ok some mods are needed if it is a internal Mac).
Again, I'm not a Mac advocate, acctually I hate them, but they do hold
market share and have done so for many years.  How about the old Amiga (Bet
you didn't know that they are one of the most commonly used systems in
television today), their newer systems are used as digital toasters in more
Video Feed centers then any other system.  Should I go on or do you get the
hint.  Windows is NOT HEAVEN, Billy boy ISN'T GOD.

Quote
"Pete Goodwin" <ime...@yfi.co.uk> wrote in message

news:3873CC8A.B1326FA3@yfi.co.uk...
Quote
> Jeremy Darling wrote:

> > Hello Pete, acctually the problem is that you card dosn't support FireGL
(A
> > dirivitive of OpenGL) witch is what was used for Quake.  I have a FireGL
> > 3000 AGP card that supports: OpenGL, FireGL, and DirectX (Dosn't hurt
that
> > its also 64 meg, btw the cost $4000.00).  I have no problem running any
> > graphics program, but when I try to run the same programs on my VooDoo3
PCI
> > I see a little difference in frame rates, yes the DiretX is faster, but
> > again this is because of hardware support.  Microsoft has money and
theirfor
> > they have the support.  The biggest question in writing a 3D graphics
> > program should be how many platforms do you want it to run on.  My game
(Eon
> > Clash) can currently be compiled and ran on allmost 6 platforms simply
by
> > using OpenGL and staying away from "Windows Only" commands.

> My perception of multiplatform support is that it's a non-starter. Now we
have a
> platform that is popular but very non-standard and decidedly NOT open.
Windows,
> in all its shape and gory, I mean glory.

> People want what works, what looks good and what they can afford. Windows
gives
> them that. Has Unix succeeded in that, so far? Has anything else reached
out so
> successfully to the masses who buy PC's and run Windows?

> I realise the market in Linux is slowly growing. But, for all the hype,
its
> still UNIX underneath. Funny how the desktops mimic Windows!

> Pete.

Re:DirectX vs. OpenGl vs. GDI


Quote
In article <84afne$6...@forums.borland.com>, Terry Thompson wrote:
> Is there any difference in terms of performance between Direct3D and OpenGL?

Quake II is OpenGL, and Jedi Knight is Direct3D.  They're both extremely fast
if you've got the right graphics hardware and drivers.

Colin
e-mail :co...@wilsonc.demon.co.uk
web: http://www.wilsonc.demon.co.uk/delphi.htm

Go to page: [1] [2]

Other Threads