Like Tree1Likes
  • 1 Post By phantomotap

SDK / OpenGL beginner help

This is a discussion on SDK / OpenGL beginner help within the Game Programming forums, part of the General Programming Boards category; I am 9 months into my 3 year education in programming and this year for my project I decided to ...

  1. #1
    Registered User
    Join Date
    Mar 2014
    Posts
    14

    SDK / OpenGL beginner help

    I am 9 months into my 3 year education in programming and this year for my project I decided to make a 2D multiplayer game in C (the only language I have learnt thus far). My goals are to learn and create the graphical interface with SDK and/or openGL. The target platform is Linux (Ubuntu).

    The reason I am posting this is because I am an absolute beginner and have no experience whatsoever in game programming. I would like to ask for help regarding any good books (preferably pdfs) for game programming using SDK / OpenGL in c. Most of the material online is targetted towards windows, iOS or andriod platforms. Linux doesnt seem to be very popular when it comes to games :P.

    Also, after googling about SDK for an hour or so I have come across almost a dozen different SDK variants (Qt SDK, Pebble SDK etc). What are these different SDKs? How do I choose which one I wanna work with? I'm finding this quite confusing. Please help me out here

    Any help is very much appreciated. Thanks in advance.

  2. #2
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,498
    If your goal is to learn, concentrate on OpenGL.
    Here is a link that might be helpful.
    Learning Modern 3D Graphics Programming

    If you want to make a game quickly as possible, use something like Ogre3D and focus more on the artwork.

    I'll be happy to give you some of my code to use as an example if you have trouble setting your environment up.
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  3. #3
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,281
    the only language I have learnt thus far
    O_O

    Anyway... you may want to avoid the link manasij7479 posted if you aren't used to using build tools.

    The tutorials themselves aren't bad if you can deal with the oddity of the framework code.

    Soma
    manasij7479 likes this.
    “Often out of periods of losing come the greatest strivings toward a new winning streak.” -- Fred Rogers
    “Salem Was Wrong!” -- Pedant Necromancer

  4. #4
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,498
    I had to develop my own framework to avoid that!!
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  5. #5
    Registered User
    Join Date
    Nov 2013
    Posts
    79
    A SDK is a software development kit, it's a general term for a software package that generally includes the headers, compiled libraries, samples and documentation and maybe even the full source code.

    You might want to look into allegro, it's about the easiest graphics library there is and support Linux also.

  6. #6
    Registered User
    Join Date
    Mar 2014
    Posts
    14
    Thanks for all the answers. That link was very useful manasij.

    I managed to install SDL and have been able to comile and run a few "very" basic examples. However I am running into compiler errors whenever I use SDL_SetVideoMode(). It's fourth argument is a flag and these flags are not being understood by the compiler (at least thats my best guess). Take this code for example:

    Code:
     /* Includes */#include <SDL2/SDL.h>
    
    
    /* Globals */
    SDL_Surface *demo_screen;
    
    
    /* Main */
    int main(int argn,char **argv)
    {
        SDL_Event ev;
        int active;
        /* Initialize SDL */
        if(SDL_Init(SDL_INIT_VIDEO) != 0)
            fprintf(stderr,"Could not initialize SDL: %s\n",SDL_GetError());
        /* Open main window */
        demo_screen = SDL_SetVideoMode(320,240,0,SDL_HWSURFACE|SDL_DOUBLEBUF);
        if(!demo_screen)
            fprintf(stderr,"Could not set video mode: %s\n",SDL_GetError());
        /* Main loop */
        active = 1;
        while(active)
        {
            /* Handle events */
            while(SDL_PollEvent(&ev))
            {
                if(ev.type == SDL_QUIT)
                    active = 0; /* End */
            }
        }
        /* Exit */
        SDL_Quit();
        return 0;
    }
    Im getting an error at line 16.
    Code:
    Trying_SDL.c: In function ‘main’:
    Trying_SDL.c:16: error: ‘SDL_HWSURFACE’ undeclared (first use in this function)
    Trying_SDL.c:16: error: (Each undeclared identifier is reported only once
    Trying_SDL.c:16: error: for each function it appears in.)
    Trying_SDL.c:16: error: ‘SDL_DOUBLEBUF’ undeclared (first use in this function)
    Everything else works except for "all" the flags for SDL_SetVideoMode(). What could be the cause of this? All SDL programs that do not use this function seems to be working perfectly.

    Edit: Im compiling with gcc, with -lSDL2

    Any help appreciated.
    Last edited by Kotik; 04-09-2014 at 07:18 AM.

  7. #7
    Registered User
    Join Date
    Jun 2011
    Posts
    2,434

  8. #8
    Registered User
    Join Date
    Mar 2014
    Posts
    14
    Thanks Matticus, that solves the mystery. Cheers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner Question -- From Absolute Beginner's Guide to C
    By Dghelerter in forum C Programming
    Replies: 5
    Last Post: 12-26-2013, 12:30 PM
  2. OpenGL Beginner: Please Help
    By Reisswolf in forum Game Programming
    Replies: 11
    Last Post: 06-15-2006, 01:17 AM
  3. Replies: 5
    Last Post: 02-12-2006, 07:42 PM
  4. Non-Beginner OpenGL book
    By the dead tree in forum Game Programming
    Replies: 4
    Last Post: 12-14-2004, 03:15 PM
  5. Windows programming for beginner (Absolute beginner)
    By WDT in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2004, 10:21 AM

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