Help me out with which 1 of the above is easier to learn,
also where can i get the tutorial for it
Printable View
Help me out with which 1 of the above is easier to learn,
also where can i get the tutorial for it
All of your answers can be found here.
Btw, there is no real argument for which API is better than the other. It's a matter of opinion, and the game being created. If you wanted to just create a basic 2D game, then Allegro would be your best. If you wanted a full-fledged 3D game, then I would say either OpenGL or DirectX. But remember that OpenGL is only a graphics library, whereas DirectX, SDL, and Allegro are complete game libraries. OpenGL can be used under SDL and Allegro, though, so you can use the graphic routines of OpenGL under SDL or Allegro.
EDIT: Also, DirectX is for Windows only, but DirectX is still very widely used. OpenGL and DirectX are the two most used by game companies.
I vote for DirectX because its the only one I know.
And I'm going to vote for OpenGL, cause that's the only one I know :)
Whats better? and easier?
Umm, which one do you want? The best? The easiest? Or do you mean you want the one with the best ratio? I have no clue what you are asking! DirectX and OpenGL are both very powerful API's. I don't know about SDL i've never used it. I did hear it was really easy to learn though. DirectX and OpenGL are both probably more complicated to learn than SDL. Good luck.
Thanks for those links. I decided to check t out so I clicked the first one now I have downloaded the full tutorial and it looks really cool. Thanks again.Quote:
He asked for which one was easier...
Cmon, there's no way ANY of you can possibly say DirectX or OpenGL
But he, also, asked for which one is better. It all depends on the situation for which one is better and easier. Hey if you're creating a 3D game then wouldn't DirectX or OpenGL be easier than SDL? There is no clear cut this API is better than the other one in all situations.
SDL has direct OpenGL support, with SDL_OpenGlFunctionName, etc. It can't hurt to learn it - it took a weekend to get a simple space game running, starting from scratch. So, hey :) there's simplicity and power. Why not use it?
Is the game made in SDL mutli-platform, or you have to change the code to make it compatible?
:confused:
The gl header files are located in diffent areas on diffent Operating Systems
and Windows requires you to include windows.h
also there a few things you need to change bassed on your compiler.
Your actual code, nope it stays the same.
so basically drawing a ball on the screen is easier with SDL or is it not?
YES! too easy, almost
I have had some experience with all three API's, and after using all three of them, I must say that I really love SDL a lot.
It is a fast and simple API, yet it is very powerful. It also is able to implement OpenGL very easily if you want to extend to 3D graphics. It is by far my favorite and the easiest to learn.
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 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
how would i use sdl with CW 7.0?
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.
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.Quote:
Originally posted by Hunter2
OpenGL doesn't include 2D?... :( that sucks.
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).
Did you follow the instructions?Quote:
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?
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.Quote:
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.
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.
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!!!
You mean some nvidia cards don't support DirectX???Quote:
OpenGL is the standard. (e.g.: all nvidia graphics cards)
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
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 ):
Then you'd load the effect ( using D3DX interface ID3DXEffect ), setup the textures, and call FindNextValidTechnique and render!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
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 )