Results 1 to 3 of 3

Thread: Initializing SDL?

  1. #1
    Join Date
    May 2008
    Beans
    1,029

    Question Initializing SDL?

    I compiled some code that did not initialize SDL, it did not include the function:

    PHP Code:
    SDL_Init(); 
    and it seemed to work fine. So why does this function need to be called?

  2. #2
    Join Date
    Oct 2007
    Beans
    1,914
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: Initializing SDL?

    Quote Originally Posted by dodle View Post
    I compiled some code that did not initialize SDL, it did not include the function:

    PHP Code:
    SDL_Init(); 
    and it seemed to work fine. So why does this function need to be called?
    Because of cross-platform compatibility. On some platform, some operations might have to be performed before anything using SDL might start.

    So, if you remove the call to SDL_Init, your code might cease to work on MacOS or Windows, for example.

  3. #3
    Join Date
    May 2008
    Beans
    1,029

    Re: Initializing SDL?

    Thank you for clarifying.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •