FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Is DirectX better or Opengl





mukesh.cv19@gmail.com
For a beginner is it better if he learns direcrX or Opengl ... for graphics
programming ...

i know c ++ ,Vb,

Should i know anything else before starting ...

waiting for ur reply s


Idea Idea Idea
Indi
mukesh.cv19@gmail.com wrote:
For a beginner is it better if he learns direcrX or Opengl ... for graphics
programming ...

i know c ++ ,Vb,

Should i know anything else before starting ...

waiting for ur reply s


Idea Idea Idea

DirectX is not for graphics. Direct3D is the DirectX component for graphics. You can use DirectX and OpenGL together by using DirectX for everything non-graphical and OpenGL for the graphics.

People are religious about whether Direct3D or OpenGL is better. They're both similarly functional and similarly fast, and as of D3D8, similarly easy, so really there's no great difference between them.

HOWEVER! Direct3D will only be available on Windows platforms (Win2K, WinXP, XBox, etc.). OpenGL is avaliable EVERYWHERE (all Windows platforms, Mac, Linux, Playstation, Wii, etc. etc.).

So if you're only writing for Windows platforms, doesn't really matter which. Otherwise, go OpenGL.

My personal opinion? OpenGL is easier for beginners. It's also more portable. Also, I've always found that it's extension mechanism was more flexible than waiting for the next DX release. But all of that is just personal opinion. i got turned off of D3D way back when it was fugly, and i never really found a cause to go back

For more detail, you can check here: http://en.wikipedia.org/wiki/Direct3D_vs._OpenGL

If you do choose to go OpenGL, i recommend NeHe.

As for what else you have to know before you get started: the more the better. You should know whatever language you're going to use WELL. You should know how to write at least basic GUI programs for whatever platform you're writing for. You should know at least a little bit about 3D graphics, like what polygons are, and what the basic transformations on a polygon are, and a little 3D algebra and geometry won't hurt.

Really and truly, if you're using Windows, C++ and OpenGL, i say just dive right in to the NeHe tutorials. Follow them closely and you should be ok. You don't really need THAT much other knowledge (although, of course, it won't hurt).
spam
a real good way to start opengl is to use it from python, because python is an easy to learn language and has a module pyopengl that loads in easily and gives you access to the full opengl library Smile and you can even download the first 10 of the NeHe tutorials in python ... winner..
deepak
OpenGL is much better than DirectX. But talking in terms of performance on windows, its proven DirectX is much powerful and easier for developers. I'd suggest you to use OpenGL either in C++ or with python.
Liu
I don't have much experience with Direct, but I've done a project in JOGL (Java's OpenGL) and straight out OpenGL in C++.

http://nehe.gamedev.net/

is a great learning resource which makes the learning process easy.
umeshtangnu
mukesh.cv19@gmail.com wrote:
For a beginner is it better if he learns direcrX or Opengl ... for graphics
programming ...

i know c ++ ,Vb,

Should i know anything else before starting ...

waiting for ur reply s


Idea Idea Idea


well people may say opengl is good or directx is better but the fact remains that both have their own strengths and weaknesses like opengl runs on all platforns and is relatively easy(for me) but most of its implementations are generic and/or software based(as in windows) also you wont get nice tutes for this (most of them have not been updated in years except nehe) likewise directx is good swiss army knife but its opens only windows 's based systems

so you have to think what application domain you are working for and select your framework for it for
tony
deepak wrote:
OpenGL is much better than DirectX. But talking in terms of performance on windows, its proven DirectX is much powerful and easier for developers. I'd suggest you to use OpenGL either in C++ or with python.


I'm not sure about this. OpenGL has improved significantly of late imo.
Indi
tony wrote:
deepak wrote:
OpenGL is much better than DirectX. But talking in terms of performance on windows, its proven DirectX is much powerful and easier for developers. I'd suggest you to use OpenGL either in C++ or with python.


I'm not sure about this. OpenGL has improved significantly of late imo.

Feh, it's an endless struggle that neither will ever win. First D3D was faster, then SGI made an improved OpenGL implementation that was faster, then D3D went hardware first (and better) and was slightly faster, then OpenGL followed with a better hardware interface and was slightly faster, then D3D made their hardware interface run in kernel mode and was slightly faster because OpenGL had to switch between user and kernel mode, then OpenGL implementations started using marshalling to limit mode switches and now they're slightly faster than D3D implementations.

And D3D 10 in Vista will have marshalling, so it will be as fast OpenGL again... or maybe slightly faster. And it goes on and on and on and on.

Give it up people. -_- Pick a platform and go with it. Neither one is really faster - and if one is now, next year that will be changed, and then again the year after that and so on ad nauseum.

Is one easier than the other? No, not really. That's pretty much personal preference. It used to be that OpenGL was MUCH better than D3D, but that changed with D3D 7 and 8. Now there is no real difference.

It pretty much boils down to this. Is your program Windows-only? No? Then use OpenGL. You're done.

Now, if your program is Windows-only, you have a choice between D3D and OpenGL. Which one should you go with? *shrug* Take your pick.

The truth is the REAL best option is neither. You should either be using an engine or writing an engine to be independent of the API. A truly good engine should be able to use both an OpenGL and a D3D renderer.
ltwomba
Personally I don't think any one is better than other... I mean Direct3D is just for Windows so if you're looking for another platform take OpenGL. I also think it's easier to learn OpenGL.
But if you don't 'speak' any programming language you'll have to learn some to code with Direct3D or OpenGL. As others said Python is quite easy, so you'd take OpenGL. If you want to use Direct3D, you'll need C++ or C# or VB (easiest of the three). C++ is the most difficult, but the most powerful too for games...
Flakky
DirectX has more updates, so more compatibility and control.
Be aware of the fact that OpenGL currently is at version 2.1 while DirectX is at version 9c (if I am correct).

Furthermore, OpenAL (audio component) appears to be not as good as DirectX.
Indi
Flakky wrote:
DirectX has more updates, so more compatibility and control.
Be aware of the fact that OpenGL currently is at version 2.1 while DirectX is at version 9c (if I am correct).

Er, more updates means less compatibility. If you only have one version, compatibility is hardly a problem... but 10+?

OpenGL doesn't update as often as D3D because it doesn't need to. It includes a flexible extension system that means you can get modern day state of the art features even in OpenGL 1.0. OpenGL only updates when common extensions are incorporated into the core.

Incidently, DirectX is at 9.0c, yes, but there's also DirectX 9-X and DirectX 10.

Flakky wrote:
Furthermore, OpenAL (audio component) appears to be not as good as DirectX.

You can use OpenGL and DirectSound(3D)/DirectMusic or any of the other DirectX API's together with no headaches.
darth_revan
Indi wrote:

You can use OpenGL and DirectSound(3D)/DirectMusic or any of the other DirectX API's together with no headaches.

Indi wrote:
DirectX is not for graphics. Direct3D is the DirectX component for graphics. You can use DirectX and OpenGL together by using DirectX for everything non-graphical and OpenGL for the graphics.


But, wouldn't it be so slow if I use them together? Using DirectSound/DirectMusic with DirectDraw or Direct3D wouldn't be better?

I know C and C++, I know few things about C++'s graphic interface and i'm trying to learn openGL now (i visited nehe's site -nehe.gamedev.net- and i have few e-books -openGL super bible! and the red book-) I tried to learn DirectX with "Learn DirectX 7 in 24 hours" but the codes were always consisting of bugs and mistakes. I got tired of asking what's wrong in forums, so i stopped. I'm now using The Red Book to learn openGL. Can anyone recommend me a book or website to learn DirectX?
Flakky
darth_revan wrote:
Can anyone recommend me a book or website to learn DirectX?
I have a book which is really good at learning C++ and DirectX (version 8.1) together.
The name of the book is Game Progamming All in one, written by Bruno Miguel Teixeira de Sousa, published by Premier Press, part of the Game Development series and the series editor is Andre LaMothe (he worked for NASA and had many other important jobs).
It explains everything from the beginning of programming and every aspect. The book has 952 pages (excluding pages of content and the Introduction) and you need Microsoft Visual C++ 6.0 or higher.
The prices are: 49.99 U.S Dollar/ 77.95 Canadian Dollar/ 36.99 U.K. Pounds


According to the book (about DirectX, OpenXX and the Windows API):
1 is DirectX, 2 is OpenXX and 3 is Windows API.
Quote:
2D: 1, 2 and 3
3D: 1 and 2
Audio: 1, 2 (not all hardware devices) and 3
Input: 1, 2 (not all hardware devices) and 3
Networking: 1 and 3 (very hard to work with)
Compatibility: 1 (almost all hardware), 2 (some manufactures neglect OpenGL support), 3 (almost all hardware)
Portable: 1 (Windows OS), 2 (almost all operating systems), 3 (Windows OS and Xbox)
Difficulty: 1 (easy), 2 (easy), 3 (intermediate)
Documentation: 1 (very well), 2 (well), 3 (well)
Speed: 1 (fast), 2 (fast), 3 (slow)

I wrote down the Windows API list as well in case you need it.
Indi
darth_revan wrote:
Indi wrote:

You can use OpenGL and DirectSound(3D)/DirectMusic or any of the other DirectX API's together with no headaches.

Indi wrote:
DirectX is not for graphics. Direct3D is the DirectX component for graphics. You can use DirectX and OpenGL together by using DirectX for everything non-graphical and OpenGL for the graphics.


But, wouldn't it be so slow if I use them together? Using DirectSound/DirectMusic with DirectDraw or Direct3D wouldn't be better?

No. You get no performance gains from using DirectGraphics along with any other parts of DirectX. Every part of DirectX is independent. You could use Direct3D for graphics and OpenAL for sound if you like (though i can't imagine why you would), and it would make no difference for speed.
ltwomba
darth_revan wrote:
Can anyone recommend me a book or website to learn DirectX?

I suggest, to begin with: Introduction to 3D Game Programming with DirectX 9.0, by Frank D. Luna (only about Direct3D).
And then, you will find easy to read: Programming RPGs With DirectX 9.0, by Jim Adams (also talks about DirectX Audio, DirectShow and DirectInput, and gives tips for game designers).
loosu
I am a noob with this subject .
But as far as i know ,

DirectX degrades gracefully with good performance in windows machines.

OpenGL , requires special hardware in order to function fully .

So , DirectX though harder to code , is rather , seems fast . OpenGL is better when the hardware is available .

Choose wisely and stay on the side .

Dont forget that OPENGL is absoulutely portable .
Indi
loosu wrote:
DirectX degrades gracefully with good performance in windows machines.

By "DirectX" i assume you mean Direct3D.

If by degrades gracefully, you mean falls back on emulation for features it doesn't support, so does OpenGL. Any parts of the core OpenGL spec that are not implemented in hardware will be implemented in software. Same as with Direct3D. The only difference is that you can query Direct3D to find out if you're running a hardware or software implementation by seeing if your using the hardware emulation layer or the hardware abstraction layer. In OpenGL, you won't know whether you're using a feature in hardware or software, but it will always work (providing your system supports whatever version of OpenGL you're using). In Direct3D, it will also always work, and you can find out if you're using hardware or software (provided your operating system supports the version of Direct3D you're using).

Of course if you're operating system does not support the version of OpenGL or Direct3D you're using, you're SOL.

Things are a little different when dealing with extensions - at least it was in the past. When you wanted to use the latest features with OpenGL, you just queried the extension. If it was there, you could use it, if not you could fall back on another option (or just close and say a better graphics card is required). And if the extension was there, you could pretty much be sure it was hardware accelerated (although you could never know for sure).

Direct3D didn't support extensions (in the past), so if you wanted to use the latest features, you had to wait for the next version of Direct3D (that's why we're at Direct3D version 10+ now and only OpenGL 2.0). But once you were using a version of Direct3D that supported the feature you wanted, you could be sure it was there without testing... you just had to see if it was supported in hardware or emulated.

Direct3D started including extensions (somewhat) in version 8, but i've been told they're a pain to work with and their "plugin" mechanism is much, much slower than OpenGL's extension mechanism, which simply calls driver functions directly. But i would imagine that by now, what >4 versions later?, they've got that sorted out.

loosu wrote:
OpenGL , requires special hardware in order to function fully .

So does Direct3D.

And required features for either one that are not implemented in hardware are emulated by software.

loosu wrote:
So , DirectX though harder to code

That was true up to version 8. It is no longer true. After Direct3D 8, it started to look a whole lot more like OpenGL. Now they're about the same level of difficulty to code.

i've found OpenGL is a whole lot easier to begin, but accessing more advanced features is tougher. Direct3D is harder to begin, but once you're an intermediate Direct3D programmer, it's not too hard to move to advanced.
Kelcey
I only have experience with OpenGL and I do love it. However, it seems like DirectX has a lot more "built in" classes and what not. I may very well be horribly wrong Razz. That's just what I've observed.
qscomputing
Use OpenGL for 3D, SDL for 2D. Makes porting to other systems a lot easier.
Sneemaster
My personal experience is that OpenGL is easier and cross platform, but DirectX is better for lighting and some other effects. Of course that all depends on what version of DirectX or OpenGL you're using, and your graphics card too. For example I have a Geforce 4000mx card (really sucks), which looks great with DirectX 9.0c but somewhat lousy with OpenGL 1.2. DirectX also works natively with the .X mesh files which can be easily converted to from other formats like 3DS files for example.
I recommend OpenGL for starting out or if you need a game to run on Windows/Linux/Mac, and then test DirectX for windows machines. I also found that when coding, OpenGL works very nicely with straight C++, but you have to add tons of garbage to get DirectX to work unless you use managed C++/C#/VB.Net.
You can also use wrappers such as SDL ,Irrlicht, Crystal Space or others to simplify you're programming with graphics. SDL is used with OpenGL and Irrlicht will work with both DirectX and OpenGL. These wrappers are also good for using other devices such as keyboard/mouse/joystick input. You can use other wrappers for sound using OpenAL or other things.
rayxzero
Mostly if you use windows base application it is better to use Direct3D.
Related topics
Ever made one?
[Question] Visual Basic C++, PHP, mySQL language guides...
XGI Volari V8 Graphic Card, 256MB DDR2, AGP8x.
Begins Of GAME PROGRAMMING
Anyone make their own RPGs?
Making your own games
Flash Game Programming questions
The Game creation topic! - Share experience - Find resources
which Programing launguage to learn
Game Programming Engine
Why people hate Windows?
DirectX vs OpenGL
VISTA VS. XP
Compatibility - ATI vs nVidia?
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.