Graphics Libraries for C++

This is a discussion on Graphics Libraries for C++ within the C++ Programming forums, part of the General Programming Boards category; Before I ask my question, I'm programming under Red Hat 9. I would like to have some suggestions as to ...

  1. #1
    Registered User
    Join Date
    Mar 2006
    Location
    Ohio
    Posts
    37

    Question Graphics Libraries for C++

    Before I ask my question, I'm programming under Red Hat 9.

    I would like to have some suggestions as to what, if any, graphics libraries I should use for graphics programming in C++. I know of Allegro but I was just curious if there is anything better or should I just drop using libraries and do something from scratch.

  2. #2
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    >> or should I just drop using libraries and do something from scratch.

    That really depends on what your doing.

    Research DirectX and OpenGL, they are good libraries.

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    DirectX is MS-Windows. If you really really want to start from scratch them you can use X11R6 or newer libraries which I think are in the /usr directory. But that isn't really for beginners and they have a dozen or so very thick programming books that tell how to use them. You can find a few tutorials on the web. Beginners are better off with OpenGL, QT, or something like that.

  4. #4
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    There's a good tutorial on OpenGL on http://nehe.gamedev.net/

  5. #5
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    First, why would you want to do something from scratch? It will probably be slower, more buggy, take much more effort, and may be less portable; unless you have a very very good reason to go it solo, it's usually best to use the wheel someone else invented and refined over the years.
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

  6. #6
    Registered User
    Join Date
    Mar 2006
    Location
    Ohio
    Posts
    37
    There's a good tutorial on OpenGL on http://nehe.gamedev.net/
    I like this tutorial a lot but the problem is, as with most anything that is public domain in the programming realm, it's Windows based; it wants me to do stuff with Visual C++. It has the cource code examples for Linux but all of the explaination is done in regards to MSVC++, which I can't stand anymore. I'll continue looking for a good OGL tutorial for Linux. Anyone with a link to a good tutorial or suggestions for books would be greatly appreciated. Thanks for all of the previous help.

  7. #7
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    OpenGL is the same across platforms, really. All that is different is the wrapper code, and in the later tutorials, that is really not relevant anymore.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  8. #8
    Registered User
    Join Date
    Apr 2006
    Posts
    20
    Try http://smartwin.sourceforge.net/

    Its template based.

  9. #9
    pwns nooblars
    Join Date
    Oct 2005
    Location
    Portland, Or
    Posts
    1,094
    I have done dozens of things that have already been done... generally I have learned a lot from these things. Now this is a herculean undertaking starting from scratch and I believe the OP could do it... eventually... with tons of persaverance... and lots of caffine... But in this case it is too large of a project to take on and I would suggest to avoid reimplementing a graphics library unless you can read the OpenGL source code and understand every algorithm and reason for how they did it. But then again if you could do that... you wouldn't be asking this question.

    Anyway this post seems to go in like 10 directions... summary, sometimes reimplementing something is good, but pick your battles wisely because some (such as this) could be too large of a project.

  10. #10
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476
    For Linux it's got to be OpenGL because DirectX is a no go. And if you want to make it simpler, try some of those open-source engines out there, e.g. OGRE 3D. I like it better than pure OpenGL.

  11. #11
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    If you want to do OpenGL directly, check out SDL. A copy of it might come with RedHat 9. But you'll want to update it since RedHat 9's libraries are all about two or three years old now.

    For 3D, like mentioned there is OGRE. But there is also Irrlicht. I personally like this one.

  12. #12
    Registered User
    Join Date
    Apr 2004
    Posts
    17

    Use this library

    Irrlicht dude...Irrlicht....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 07-27-2008, 08:25 AM
  2. What graphics libraries does everyone use?
    By kawk in forum Game Programming
    Replies: 19
    Last Post: 01-12-2007, 11:37 AM
  3. Resource ICONs
    By gbaker in forum Windows Programming
    Replies: 4
    Last Post: 12-15-2003, 06:18 AM
  4. Question about allegro and other graphics libraries....
    By o0obruceleeo0o in forum Game Programming
    Replies: 2
    Last Post: 06-11-2003, 11:02 PM
  5. Graphics Libraries?
    By mart_man00 in forum Game Programming
    Replies: 7
    Last Post: 09-13-2002, 04:52 AM

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