View Poll Results: Wats Better? and Ezier

Voters
25. You may not vote on this poll
  • DirectX

    8 32.00%
  • OpenGL

    9 36.00%
  • SDL

    8 32.00%

Dx, Sdl, Open-gl

This is a discussion on Dx, Sdl, Open-gl within the Game Programming forums, part of the General Programming Boards category; ok, i followed the directions on this page: http://cone3d.gamedev.net/cgi-bin/in...ls/gfxsdl/tut1 to use SDL on Dev C++, but when i went to ...

  1. #16
    ...
    ... is offline
    Registered User
    Join Date
    Feb 2002
    Posts
    465
    ok, i followed the directions on this page:

    http://cone3d.gamedev.net/cgi-bin/in...ls/gfxsdl/tut1

    to use SDL on Dev C++, but when i went to include SDL.h, my compiler says it doesnt exist. i checked in the Dev C++ directory and all of the files are there. any ideas?
    I came up with a cool phrase to put down here, but i forgot it...

  2. #17
    Registered User
    Join Date
    Nov 2002
    Posts
    10
    I like OpenGL, it doesn't seem all that complicated to me, but
    what do I know? I'm just learning. Anyway, there are some
    really cool OpenGL tutes at Jeff Molofee's site . That's NeHe Productions
    at Gamedev.net.

    I use Dev-C++ and his tutes are syntaxed for VC++, so a couple
    of very minor mods were needed to compile in Dev-C. If you
    are familiar with the Dev-C includes and stuff it should be no
    problem.

    Hope this helps.

    globalerr_h
    globalerr_h
    Win98se
    Dev-C++ 4
    Borland55 with JFE

  3. #18
    eat my shorts!
    Join Date
    Apr 2002
    Posts
    294
    how would i use sdl with CW 7.0?

  4. #19
    Registered User
    Join Date
    Sep 2002
    Posts
    69

    Also...

    You can legally get the Programming Linux Games book from here: http://www.overcode.net/~overcode/writing/plg/

    It is a great book (I bought it) and the code mostly works in Windows (under VC++) as I've been working on code at school and home for a project (The IceBox).

    Anyhow, I vote SDL.

    As for DevC++, I made it work following that tutorial, but I didn't figure out how to make it work with SDL_Image so I switched to VC++ (only at school - they have licenses for it, and I don't use Windows at home, and they wouldn't let me install Linux on the workstations... SuXoR).

    EDIT: BY THE WAY, comparing SDL to OpenGL is kinda dumb, since OpenGL is for 3D and SDL isn't... Does OpenGL do networking? I didn't think it did... The poll REALLY should be DirectX vs. SDL/OpenGL.
    Last edited by DOlson; 11-17-2002 at 11:48 PM.
    D. Olson
    The Mandrake eXPerience
    Battle Pong

    IDE: kate 2.0
    Compiler: gcc 3.2
    Graphics/Input/Net: SDL 1.2.5 (pdf)
    3D Audio: OpenAL (pdf)


    I am a signature virus. Please add me to your signature so that I may multiply

  5. #20
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    OpenGL doesn't include 2D?... that sucks.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  6. #21
    Registered User
    Join Date
    Sep 2002
    Posts
    69
    Originally posted by Hunter2
    OpenGL doesn't include 2D?... that sucks.
    Well, maybe it does, but I mean, it goes hand in hand with SDL, and makes a perfect pair. SDL is the perfect 2D stuff, as well as input and networking, and sound even, and then OpenGL is made even easier via SDL.

    I've done VERY basic OpenGL stuff following examples, but that's it. I'm working on a 2D game first, as I only have 2 months to learn this stuff (school project).
    D. Olson
    The Mandrake eXPerience
    Battle Pong

    IDE: kate 2.0
    Compiler: gcc 3.2
    Graphics/Input/Net: SDL 1.2.5 (pdf)
    3D Audio: OpenAL (pdf)


    I am a signature virus. Please add me to your signature so that I may multiply

  7. #22
    Registered User
    Join Date
    Sep 2002
    Posts
    69
    Originally posted by ...
    ok, i followed the directions on this page:

    http://cone3d.gamedev.net/cgi-bin/in...ls/gfxsdl/tut1

    to use SDL on Dev C++, but when i went to include SDL.h, my compiler says it doesnt exist. i checked in the Dev C++ directory and all of the files are there. any ideas?
    Did you follow the instructions?

    Now in Dev-C++ start a new console project. Now go to the project options dialog (found in the menu Project). The thing we need to set here is the field that says "Further object files or linker options:". Type in "-lmingw32 -lSDLmain -lSDL" (w/o the quotes) inside it. Now click OK.
    That's all I had to do. Are you using the stable DevC++ or the beta? I don't think it should matter that much, but you never know.
    D. Olson
    The Mandrake eXPerience
    Battle Pong

    IDE: kate 2.0
    Compiler: gcc 3.2
    Graphics/Input/Net: SDL 1.2.5 (pdf)
    3D Audio: OpenAL (pdf)


    I am a signature virus. Please add me to your signature so that I may multiply

  8. #23
    Registered User
    Join Date
    Aug 2001
    Posts
    403

    SDL is much easier

    SDL is much easier and it's hard to say DX is better than it, because on Windows SDL uses DX for it's code if DX is installed, and if DX isn't installed it uses the GDI. Also as soon as the SDL_gl project is done, OpenGL will become an optional backend for SDL, so you can either use DX or OGL to draw.

  9. #24
    Registered User codingmaster's Avatar
    Join Date
    Sep 2002
    Posts
    309
    They are all very good.

    OpenGL is the standard. (e.g.: all nvidia graphics cards)
    DirectX has a high position, cause it's included into the windows system

    SDL: is easy to learn


    My favourite is OpenGL!!!

  10. #25
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    OpenGL is the standard. (e.g.: all nvidia graphics cards)
    You mean some nvidia cards don't support DirectX???
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  11. #26
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    I think i'l choose for OpenGL, because there is ALOT of
    community and tutorials A.K.A NeHe OpenGL, and because
    DirectX isn't protable, not that i am going to port any of my
    games, its just a nice argument, and as last, im under the
    impression that opengl is faster, but that im not sure of

  12. #27
    Registered User Coder's Avatar
    Join Date
    Aug 2001
    Location
    Cairo, Egypt
    Posts
    128

    DX, GL

    Check this http://www.xmission.com/~legalize/d3d-vs-opengl.html for a straightforward comparison between the features provided by the OpenGL 1.2 core ( no extensions ) and Direct3D7/8. It's a text table.

    DX Graphics ( == D3D 8+ )
    DirectX Graphics has a steeper learning curve. It's also COM based ( uses objects for everything ), and is windows-specific. It exposes a lot of features without the need for writing extensions ( like GL does ).Yet, some'd say that it doesn't allow you to access any new card features until the next DX release is out. This hasn't been a big issue for me ( or anyone I know, that is ) since DX is updated often.

    DirectX Graphics comes with a helper library called D3DX which does a whole bunch of jobs and provides a lot of features, including - but not limited to - :
    - Loading image files ( textures ) ( bmp/jpg/gif/tga/dds )
    - Loading X Files ( DirectX Graphics model format )
    - Matrix stack
    - 2D sprite rendering support.
    - A ( 2D/3D ) vector, matrix and quaternion math library ( for 3D transformations )
    - Mesh support : Creating bounding boxes/spheres, optimizing meshes for display, computing mesh normals and tangents, doing (mesh/mesh_subset/triangle)-ray intersection tests and the creation of some simple objects ( box, sphere, teapot!, cylinder, ...etc )
    - Antialiased Line, and line width support ( DX9 only )
    - Effects framework : Allows you to write rendering code that'd run on different hardware without worrying too much about selecting the effect that the current hardware supports.
    For example, you can do lightmapping with multi-texturing or multi-pass texturing. The latter is slower, but you'll have to use it on hardware that doesn't support multi-texturing. So instead of checking whether the device supports multi-texturing and then choosing the appropriate function/codepath ( it gets hairy when you use a lot of features that aren't supported on all cards, and vertex/pixel shaders ), you just write an effects file like ( actual effects code, not pseudo ):

    Code:
    // Effect file
    texture baseTexture, lightmapTexture;
     
    // Technique 0 uses multi-texturing, 1 uses multi-pass texturing
    technique T0
    {
    	pass P0
    	{        
    		.
    		.
    		. 
    		texture[0]  = < lightmapTexture >;
    		texture[1]  = < baseTexture >;
    		.
    	}
    }
    
    technique T1
    {
    	pass P0
    	{
    		.
    		.
    		. 
    		texture[0]  = < lightmapTexture >;
    		.
    	}
    	pass P1
    	{
    		.
    		.
    		. 
    		texture[0]  = < baseTexture >;
    		.
    	}
    }
    // EOF
    Then you'd load the effect ( using D3DX interface ID3DXEffect ), setup the textures, and call FindNextValidTechnique and render!

    Sorry for going into detail for that, I just wanted to demonstrate that effects really make life easier.

    GL
    GL is easier to learn, uses straight-forward C function calls, is portable. However, you'll need to write extensions for the variety of cards out there whenever you want to use advanced features ( like bump mapping )

    I've not written GL code before ( though I've read and written DX equivalents of GL programs ), so I can't say a lot about the features offered by GL.
    As far as I know, it has no mesh support, no image loading, no normal/tangent computation, no math libraries. It supports line width, and antialised lines, as well as ray-tri intersection.
    There's some glut ( GL Utility library ), so maybe it does support image loading and such stuff. I Don't know ( anybody? )

    Also, GL seems to be updated every light year or so. Anyway, I think OpenGL 2.0 should be coming, but I don't know exactly when.

    Which is faster?!
    Definitely can't tell.

    Many people would claim that DX Graphics is slower. This is mostly attributed to the fact that they don't follow the patterns recommended by the DX Graphics documentation.

    For example, rendering functions in DirectX Graphics ( DrawPrimitive, DrawIndexPrimitive ) are optimized for large batches of primtives, so you don't call them with a couple of triangles at a time - which can be done in GL with no perf hit. Thus, when GL programmers write DX Graphics apps using the same GL style ( passing a couple of triangles at a time ) they start complaining about the bad performance.

    In short, with DirectX Graphics, there's a lot of optimzation to be done. If you don't, you get worse performance.

    Additionally, drivers have a lot to do with it. With DX 7 level gfx card drivers, vertex buffer ( == a place in device/AGP/system memory where you store your 3D vertices/data ) changes were quit expensive. This should not be an issue anymore.

    I recall that Simon O'Connor ( A professional graphics programmer, http://www.creative-asylum.com/ ) said that the GL driver quality varies from Poor to Excellent while that of DX Graphics varies from Average to Very good.

    Which do I use?

    The one that suits your needs more. If you intend to do something portable ( With commercial games you can get all what you want from windows. But of course supporting the opensource community and linux is a good thing to do. ), you'll HAVE TO use anything other than DX. It's not expected in the near ( or far ) future that there'll be a linux version of DX, for example.

    If you're more comfortable with OOP, you could use DirectX. I personally couldn't bear the gl style of doing things. On the other hand, if you like plain-C style, you could use GL.

    It's important to note that using either API will not prevent you from writing quality apps/games. The Quake series, as well as DOOM III use OpenGL. Unreal/Lithtech engines use Direct3D. Note however, that the DOOM III engine has 6 backends for supporting the major cards out there.

    Another important factor is the presence of learning resources/material. I've not seen something for DirectX like NeHe, so far ( although there's a site in the making that's designed to fill in this gap. Should be up around a couple of months from now ). Additionally, there's some GL "red/blue" book free on-line ( don't exactly recall. Maybe both are free? )

    However, you can find discussion groups/forums with amazing people that can help you with ANYTHING DirectX.
    GDNet's DirectX forum's good for newbie-intermediate questions.
    Microsoft's DirectXDev list is great for advanced questions and info about DirectX ( populated by a number of Direct3D MVPs, Direct3D developement team members, guys behind games like Age of mythology, Halo2, Unreal tournament 2003, Empire earth, urban chaos, startopia, ...etc. This is great, since besides getting the best answers, you get to know how they did stuff in their games )
    Muhammad Haggag

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Open Gl (FIRST, and SECOND) programs
    By Jeremy G in forum Game Programming
    Replies: 3
    Last Post: 02-16-2003, 04:39 PM
  2. open gl
    By super_monkey in forum Game Programming
    Replies: 8
    Last Post: 10-20-2001, 06:22 PM
  3. Ghost in the CD Drive
    By Natase in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 10-12-2001, 06:38 PM
  4. open GL
    By super_monkey in forum Game Programming
    Replies: 2
    Last Post: 10-10-2001, 09:31 PM
  5. Direct x, open gl, but wait....what if...whoa, read this!
    By Leeman_s in forum Game Programming
    Replies: 2
    Last Post: 10-08-2001, 04:37 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21