Thread: C++ game programming on Linux?

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    48

    C++ game programming on Linux?

    Hi,

    I was wondering if anyone can give me some information on how I can find information or tutorials to start learning game programming on linux? This is very interesting to me, so if you know any tutorials or information, please let me know.


    Thank You

  2. #2
    Registered User
    Join Date
    Mar 2007
    Posts
    416
    What kind of game do you want to make?

    Google has plenty of stuff here.

  3. #3
    Registered User
    Join Date
    Oct 2007
    Posts
    48
    Quote Originally Posted by scwizzo View Post
    What kind of game do you want to make?

    Google has plenty of stuff here.

    Just very simple ones, so I can start understanding game programming for example very simple opengl games

  4. #4
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    First off you need to learn OpenGL.

  5. #5
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    or start with 2D and learn SDL.

    http://lazyfoo.net/SDL_tutorials/index.php

    a lot simpler, especially on the math side

    I had to give up learning OpenGL because I didn't understand matrices (not my fault, I just started university this year, no linear algebra in high school). Tried Google... was a bit too difficult to self-learn.

    For 2D stuff, only simple calculus is required.

  6. #6
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    Simple calculus for 2D? Simple trigonometry/geometry.

    3D isn't that hard in OpenGL, once you get through the vector/matrix math, it's abstracted, and there is literally thousands of useful resources on learning 3D game programming that translates the exact same from OpenGL to Direct3D to XNA. Infact you could use 2D sprites in 3-world. Shaders, textures, custom models, that's more difficult.

    Anyway, if you're going with C++ I'd recommend SDL as well, simply because it won't be easy for a beginner to wrap their mind around writing their own graphics library, and at the same time keep it organized and coded well.

    If you go with OpenGL, basically you have raw control of the graphics card, nothing more. You need something to create the window ie GUI (eg. SDL, GLut, wxWidgets, Qt, win32+something, etc.). You need something to control the sound card (eg. SDL, OpenAL, etc.). You need something to monitor keyboard/mouse input (eg. SDL, Qt, win32+something, etc.). Depending which you choose you may have to develop your own file (graphics/audio) managers/loaders.

    As you can see SDL is a good 2D game library. I wouldn't be afraid of 2D either. Chances are if you don't start off with an easy library you'll end up quitting, and it's not really a waste of time even if your intentions are 3D.

    I ramble.
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  7. #7
    Registered User
    Join Date
    Oct 2006
    Posts
    250

  8. #8
    Kung Fu Kitty Angus's Avatar
    Join Date
    Oct 2008
    Location
    Montreal, Canada
    Posts
    115
    Quote Originally Posted by cyberfish View Post
    I had to give up learning OpenGL because I didn't understand matrices (not my fault, I just started university this year, no linear algebra in high school). Tried Google... was a bit too difficult to self-learn.
    That shouldn't matter. When I learned OpenGL I don't remember having to draw on any of my linear algebra.

  9. #9
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    Simple calculus for 2D? Simple trigonometry/geometry.
    What I had in mind is just simple displacement/velocity/acceleration.

    It's needed if you want the physics to be realistic (more realistic than otherwise at least).

  10. #10
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by cyberfish View Post
    What I had in mind is just simple displacement/velocity/acceleration.

    It's needed if you want the physics to be realistic (more realistic than otherwise at least).
    I guess you could view finite difference approximations as "calculus" but more accurately they are approximations of calculus, and the math involved is not difficult.

    Code:
    accel_x = force_x / mass;
    v_x += accel_x * delta_t;
    x += v_x * delta_t;
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  11. #11
    Kung Fu Kitty Angus's Avatar
    Join Date
    Oct 2008
    Location
    Montreal, Canada
    Posts
    115
    Quote Originally Posted by cyberfish View Post
    What I had in mind is just simple displacement/velocity/acceleration.

    It's needed if you want the physics to be realistic (more realistic than otherwise at least).
    Actually, I tried to approach an OpenGL project using calculus, and it didn't work out very well. Rather than using calculus on continuous functions I should have used the discrete counterparts (summations and series and stuff).

  12. #12
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    Ah I see. I have never done any significant game/graphics programming myself, so I wasn't speaking from experience but from how I would've done it .

    A question for the OP: how much math do you know?

  13. #13
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    Quote Originally Posted by brewbuck View Post
    I guess you could view finite difference approximations as "calculus" but more accurately they are approximations of calculus, and the math involved is not difficult.

    Code:
    accel_x = force_x / mass;
    v_x += accel_x * delta_t;
    x += v_x * delta_t;
    Oh, he meant the formulae (formulas) derived from calculus used in physics. I guess the question would be if he also has taken introductory physics, because they cover more than the basics in high school (what you learn in an intro to opengl game programming book). The actual math part doesn't extend past basic algebra/trigonometry/geometry. You would see calculus in advanced game physics programming books to explain the theories behind them (eg. quaternions).

    It's true we do use many shortcuts, provided by calculus, without needing to know how they work. Same stuff exists in 2D, it's just easier to wrap your mind around - at the heart that's what programming is, extending your ability to wrap your mind around code. Directly related to the complexity of the code, and the amount of code (lines) - which is why abstraction rocks
    Last edited by Dae; 10-30-2008 at 05:25 PM.
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why Linux, for the average user?
    By Hunter2 in forum A Brief History of Cprogramming.com
    Replies: 32
    Last Post: 07-07-2006, 02:36 PM
  2. Game Engine Link Prob
    By swgh in forum Game Programming
    Replies: 2
    Last Post: 01-26-2006, 12:14 AM
  3. Engine <=> DX/OGL | c++ ?
    By darkcloud in forum Game Programming
    Replies: 6
    Last Post: 05-13-2005, 12:19 AM
  4. installing linux for the first time
    By Micko in forum Tech Board
    Replies: 9
    Last Post: 12-06-2004, 05:15 AM
  5. Creating Shell based game..Few questions
    By Saintdog in forum Game Programming
    Replies: 1
    Last Post: 12-01-2004, 08:14 PM