Archived

This topic is now archived and is closed to further replies.

fakemind

OpenGL choosing openGL over directX?

Recommended Posts

im trying to start programming my own computer game. (hold your appluase) ;-) i was thinking of choosing directX, but now im trying to see if openGL would be a better choice for me. i would love to have people with mac, linux, and windoze to be able to play my game, and it seems like openGL gives me a wider audience than directX. im doing all the graphics functions myself, so all id really need it to do is get me into 800x600x256 fullscreen mode. some things that still influence me to choose directX is their soundplaying and multiplayer functions. whats your thoughts/opinions?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I think you shouldn''t have crossposted this on the DirectX and the OpenGL forums. Is this a troll?

Share this post


Link to post
Share on other sites
i "crossposted" because i wanted to ask people on both forums their opinions. the main reason for this is i felt there would probably be some bias towards one or the other depending on the forum, and i wanted to ask both sides.

i apologize if "crossposting" is considered wrong on gamedev.net, i only want to hear both sides. :-)

- jeremiah
http://fakemind.com

Share this post


Link to post
Share on other sites
OpenGL : Open Graphic Library.
As its name says : nothing but graphics.

DirectX : Direct X=anything.
Does Music Sounds... and graphics.


If you choose OpenGL + SDL (www.opengl.org, www.libsdl.org) you''ll have cross platform API which does almost anything DirectX does.

Now try both and see what you prefer.
Also remember that using DirectX is supporting M$ illegal behavior.

-* So many things to do, so little time to spend. *-

Share this post


Link to post
Share on other sites
personally the main reason 4 choosing opengl is. 90percent of tutorials/examples on the net use it, this will make learning 3d graphics a lot easier (+ believe me u need as much help as u can get).
btw opengl can be used with all parts of directX except directgraphics thus in this respect it doesnt differ from direct. BUT then again if u say u want crossplatform stuff directx is out.

Share this post


Link to post
Share on other sites
In my opinion the main reason to choose opengl is its intrinsic simplicity.
Honestly I do not think that multi_platform is an inportant issue.
Although I am on opengl side, we must not forget a serious drawback vs direct x.
It is not the lack of support for input and sound\music but rather the lack of a 3D animated file format and relevant utility

Share this post


Link to post
Share on other sites
DirectX

It''s much better in my opinion. Like they''ve said, you can do sound and inpu with it too. Besides, a huge majority of gamers use PCs anyway. It''s a big bonus to be able to use DirectInput instead of windows for input. Microsoft isn''t that bad anyway.

Have you read Windows Game Programming for Dummies?

Newbie to game programming?
visit

KaBooMgames
Great for Newbs, Masters welcome as well

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I would choose DX if i were u. OGL is too basic and yet it is too complicated. I tried to develop a 3d engine in it and I had a lot of trouble due to spacial problems. There is a little bit too simplistic. Also, it seems like all on-the-market games use directx.

The code for opengl is a lot different compared to directx code. I usually code with a lot of comments and in a nice order but when I programmed with directx, I had a lot of trouble due to the fact that sometimes functions would need functions declared earlier than others. If you decide to use dinput if you choose ogl, it makes stuff comfusing because open gl does setup and everything a lot different than directx

The reason there are more ogl tutorials on the net is because opengl is easier, making it easier to make tutorials. Right, directx does not have as many, or not as i have seen, tutorials but the tutorials they do have are good. You don''t see that many of the same tutorials as you do in opengl, at least what i have seen. Go look in the articles section and then the directx section. See how different the tutorials are?

OpenGl was not made by microsoft and yet everything else on your computer is...hmmm...You can choose opengl if you want but i am gonna stay with directx because its more "to the point" and "relistic" and a few other reasons. If you choose directx, buy tricks of the windows game programming gurus. Its a really good starter book. i liked the zen of d3d game programming even though it didn''t have the best code.

I just thought of something else wrong with opengl, there are hardly any books out there, only tutorials. Go on amazon and search around for game programming books. I gaurentee that you will find over double at least dx books than ogl books.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
2nd paragraph should say:

I usually code with a lot of comments and in a nice order when I programm with directx,but when i switched to opengl. I had a lot of trouble due to the fact that sometimes functions would need functions declared earlier than others. If you decide to use dinput if you choose ogl, it makes stuff comfusing because open gl does setup and everything a lot different than directx.

Share this post


Link to post
Share on other sites
2nd paragraph should say:

I usually code with a lot of comments and in a nice order when I programm with directx,but when i switched to opengl. I had a lot of trouble due to the fact that sometimes functions would need functions declared earlier than others. If you decide to use dinput if you choose ogl, it makes stuff comfusing because open gl does setup and everything a lot different than directx.

Share this post


Link to post
Share on other sites
I have read(unfortunatly) "Windows Game Programming for Dummies" and "Tricks of Windows game programming gurus " as well.
Even though Andrè LaMothe is , in my opinion , the best and most serious game programming author (his E-mail support is excellent )it was one of the main reason why I switched to opengl.
Do you think is it reasonable to take 1000 pages to explain 2D only ?
the book you mentioned does not deal with 3D graphic !!!
The problem is that it is not Andrè''s fault.
The point is that direct x is a mess.

Have you read " opengl game programming " ?


Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
I would choose DX if i were u. OGL is too basic and yet it is too complicated. I tried to develop a 3d engine in it and I had a lot of trouble due to spacial problems. There is a little bit too simplistic. Also, it seems like all on-the-market games use directx.


What is OpenGL "too basic" to do? I''d like a specific example. Calling it more complicated is just as false as the people that say DirectX is more complicated as OpenGL. It is all a matter of opinion. There are quite a lot of games on the market using OpenGL. If you write any 3D utility you''ll probably want to support OpenGL, since a lot of artists and engineers use Macs and Unix workstations.

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
You''re right Null and Void, its all a matter of oppinion. Sorry bout the "too basic" thought. I didn''t mean the API was too basic. It was my oppinion that moving around the 3d world to draw was a little too basic. Thats what i meant when i said spacial problems. whenever you want to draw, you have to move your position to the location and then draw. yes, you could loadidentity and move to the location each time and then you would have a "location based on 0,0" system instead of moving to location system. But again, its just a matter of oppinion and it seems like there are more ogl programmers on this post...

Share this post


Link to post
Share on other sites
quote:
Original post by kmsixpence
It was my oppinion that moving around the 3d world to draw was a little too basic. Thats what i meant when i said spacial problems. whenever you want to draw, you have to move your position to the location and then draw. yes, you could loadidentity and move to the location each time and then you would have a "location based on 0,0" system instead of moving to location system.

I still don''t get it. You have to do that in DirectX too. You know how translation of points via matrices works, right? It makes the most sense to do it that way.

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
Hey men!!!
Learn OpenGL!!!Its simpler, you can find better and more tutorials, works on all platforms!
And use DirectX only for DInput,DPlay and DSound(you can use OpenAL instead of DSound)!
DirectX sucks!!!

Share this post


Link to post
Share on other sites
you know what, go ahead a use opengl and then you can become another anti-microsoft person out there who will eventually switch to linux. really though, go ahead and learn opengl.

Share this post


Link to post
Share on other sites
no offense to anybody who posted, i greatly appreciate your opinions. it just seems that some people cant disagree without generating spite or getting upset.

anyway though,
ive decided to use directx for setting up video mode, input, and playing sound for windows. if i ever port it to linux or mac one day in the distant future i'll probably need to find another set of functions to replace the directx ones. no big deal though. i dont think that would be so hard (find alternate functions for different os's that is, not the actual porting).

also, if there is going to be any 3D in my game, id want to write the functions myself. i dont see it as re-inventing the wheel since this game is not only for fun, but also a huge learning project. i dont learn much from black boxes.

thanx a million for posts!

- jeremiah
http://fakemind.com

Edited by - fakemind on November 15, 2001 2:25:33 PM

Share this post


Link to post
Share on other sites
One thing is for sure, you don''t learn much about anything when when coding in DX except DX and possibly bad coding style.

Like someone said before, DX is a mess no doubt.
DX is cool because what it can accomplish and it''s possibly required if you''re looking for a career in gameprogramming.

If you wanna learn to become a better programmer in general use OpenGL/SDL.



Share this post


Link to post
Share on other sites
Good point, dx is not very clean but as you also said, most companies are looking for directx knoledge. but, microsoft always cleans it up a little bit with each release...

Share this post


Link to post
Share on other sites
quote:
Original post by kmsixpence
... most companies are looking for directx knoledge.

Actually, most companies just don''t care about graphics in general, much less high performance graphics (look at database, embedded, and backend work). They want good algorithmic, design, and other such skills as well as your ability to fit into a team over anything.

Remember, although there are potentially more game companies that will choose DirectX, there are a whole lot of medical and mechanical design tools that need to run on unix or insert-other-OS workstations .

quote:
Original post by fakemind
no offense to anybody who posted, i greatly appreciate your opinions. it just seems that some people cant disagree without generating spite or getting upset.

You''re right, these discussions always generate miniature battles. To clarify my position: I''m not mad at anyone, I''m just trying to keep this discussion based on reality .

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
Hsng on ... why are you so vacal about slagging off OpenGL ... unless you''re viewpoint is shit?

Share this post


Link to post
Share on other sites
i actually looked into SDL and its really quite interesting. the only thing that is i couldnt really find much source that wasnt for linux. ( and i couldnt find a quick way to extract rar/tar/gz files ... ). there really wasnt that much documentation, or examples rather, that gave clear enough examples to make me feel comfortable using it.

if i could find some good tutorial or some examples for windows. ie. setting up 800x600x256 video mode, playing sound effects that overlap, and network support. thats what is really leaning me towards directX for windows because theres tons of examples right when you download it that shows how to do most of this. for SDL i would need SDL, then SDL_Mixer for sound, then something else for network multiplayer support, when directX is all together.

anyway, i feel like im babbling now.

- jeremiah
http://fakemind.com

Share this post


Link to post
Share on other sites
quote:
Original post by fakemind
i actually looked into SDL and its really quite interesting. the only thing that is i couldnt really find much source that wasnt for linux.

Do you mean sourcecode for using SDL outside of Linux? If yes, ALL SDL source code works outside of Linux; that''s the point of using SDL, to have portable code. If no and you were refering to the SDL source code, you don''t look very hard. Try this, and look under Win32 for DLL''s and libraries. The source code at the top of that page has the SDL source code for every platform it officially supports.

quote:
Original post by fakemind
... and i couldnt find a quick way to extract rar/tar/gz files ...

Tarballs (tar.gz and .tgz) are the most common distribution format for source code (et cetera) in the unix world. WinZip can open them if you want to use it (or you can always download the official gzip and gunzip programs, but they''re command line which you don''t sound like you''d like).

quote:
Original post by fakemind
if i could find some good tutorial or some examples for windows. ie. setting up 800x600x256 video mode, playing sound effects that overlap, and network support.


Try this. Lots of examples there. SDL really is easy to use, I figured it out with minimal examples (less than what that one page has now ).

quote:
Original post by fakemind
thats what is really leaning me towards directX for windows because theres tons of examples right when you download it that shows how to do most of this. for SDL i would need SDL, then SDL_Mixer for sound, then something else for network multiplayer support, when directX is all together.


Are you complaining that SDL isn''t bloated ? Most programs that use SDL won''t use all of SDL, so why add more than they need? All of the SDL parts follow basically the same structure, so they aren''t hard to combine.




[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
Well, thats the beauty of SDL, same code compiles on many platforms, however I still stick with DX on Windows and SDL for Linux, writting portable code there isnt much to port anyways, a byte is a byte in any OS, and an integer is an integer as long as you are on the same Processor architecture (or same endian arch anyway)

I have been thinkering with OpenGL, and I like it better than D3D, in any case, I think is always good to have all your bases covered and learn at least a little from all of them.

Share this post


Link to post
Share on other sites
I said DX would possibly required if u seek a career in gameprogramming, other than that I don''t think DX will get you a job anywhere, OpenGL maybe would though.

I just started to look a little at SDL/OpenGL myself, I''ve always done 2D in DX before and man, rarely does one come across a library that is so well written.

I just have to find out its drawbacks before I finally decide to go OpenGL instead of D3D.So if any of you know of any plz let me know, but no empty arguments like most games are made in DX, that''s totally pointless.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Forum Statistics

    • Total Topics
      627759
    • Total Posts
      2978961
  • Similar Content

    • By DelicateTreeFrog
      Hello! As an exercise for delving into modern OpenGL, I'm creating a simple .obj renderer. I want to support things like varying degrees of specularity, geometry opacity, things like that, on a per-material basis. Different materials can also have different textures. Basic .obj necessities. I've done this in old school OpenGL, but modern OpenGL has its own thing going on, and I'd like to conform as closely to the standards as possible so as to keep the program running correctly, and I'm hoping to avoid picking up bad habits this early on.
      Reading around on the OpenGL Wiki, one tip in particular really stands out to me on this page:
      For something like a renderer for .obj files, this sort of thing seems almost ideal, but according to the wiki, it's a bad idea. Interesting to note!
      So, here's what the plan is so far as far as loading goes:
      Set up a type for materials so that materials can be created and destroyed. They will contain things like diffuse color, diffuse texture, geometry opacity, and so on, for each material in the .mtl file. Since .obj files are conveniently split up by material, I can load different groups of vertices/normals/UVs and triangles into different blocks of data for different models. When it comes to the rendering, I get a bit lost. I can either:
      Between drawing triangle groups, call glUseProgram to use a different shader for that particular geometry (so a unique shader just for the material that is shared by this triangle group). or
      Between drawing triangle groups, call glUniform a few times to adjust different parameters within the "master shader", such as specularity, diffuse color, and geometry opacity. In both cases, I still have to call glBindTexture between drawing triangle groups in order to bind the diffuse texture used by the material, so there doesn't seem to be a way around having the CPU do *something* during the rendering process instead of letting the GPU do everything all at once.
      The second option here seems less cluttered, however. There are less shaders to keep up with while one "master shader" handles it all. I don't have to duplicate any code or compile multiple shaders. Arguably, I could always have the shader program for each material be embedded in the material itself, and be auto-generated upon loading the material from the .mtl file. But this still leads to constantly calling glUseProgram, much more than is probably necessary in order to properly render the .obj. There seem to be a number of differing opinions on if it's okay to use hundreds of shaders or if it's best to just use tens of shaders.
      So, ultimately, what is the "right" way to do this? Does using a "master shader" (or a few variants of one) bog down the system compared to using hundreds of shader programs each dedicated to their own corresponding materials? Keeping in mind that the "master shaders" would have to track these additional uniforms and potentially have numerous branches of ifs, it may be possible that the ifs will lead to additional and unnecessary processing. But would that more expensive than constantly calling glUseProgram to switch shaders, or storing the shaders to begin with?
      With all these angles to consider, it's difficult to come to a conclusion. Both possible methods work, and both seem rather convenient for their own reasons, but which is the most performant? Please help this beginner/dummy understand. Thank you!
    • By JJCDeveloper
      I want to make professional java 3d game with server program and database,packet handling for multiplayer and client-server communicating,maps rendering,models,and stuffs Which aspect of java can I learn and where can I learn java Lwjgl OpenGL rendering Like minecraft and world of tanks
    • By AyeRonTarpas
      A friend of mine and I are making a 2D game engine as a learning experience and to hopefully build upon the experience in the long run.

      -What I'm using:
          C++;. Since im learning this language while in college and its one of the popular language to make games with why not.     Visual Studios; Im using a windows so yea.     SDL or GLFW; was thinking about SDL since i do some research on it where it is catching my interest but i hear SDL is a huge package compared to GLFW, so i may do GLFW to start with as learning since i may get overwhelmed with SDL.  
      -Questions
      Knowing what we want in the engine what should our main focus be in terms of learning. File managements, with headers, functions ect. How can i properly manage files with out confusing myself and my friend when sharing code. Alternative to Visual studios: My friend has a mac and cant properly use Vis studios, is there another alternative to it?  
    • By ferreiradaselva
      Both functions are available since 3.0, and I'm currently using `glMapBuffer()`, which works fine.
      But, I was wondering if anyone has experienced advantage in using `glMapBufferRange()`, which allows to specify the range of the mapped buffer. Could this be only a safety measure or does it improve performance?
      Note: I'm not asking about glBufferSubData()/glBufferData. Those two are irrelevant in this case.
    • By xhcao
      Before using void glBindImageTexture(    GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), does need to make sure that texture is completeness. 
  • Popular Now