Thread: OpenGL using SDL --> Should I or shouldn't I?

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    244

    OpenGL using SDL --> Should I or shouldn't I?

    hi!

    now to ask a simple qeustion: i saw that the SDL library supports openGL, too.
    now my question is, wheter it is worth using or wheter i should just use the 'real' openGL.

    - does it cause performance loss?
    - is it _AS FLEXIBLE AS_ the 'real' openGL?
    - i guess it is a lot easier, isnt it?

    thanks for upcoming replies

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    No, yes, and no. You misunderstand what SDL's OpenGL support is.

    SDL gives you the means of setting up a window with an OpenGL rendering context in a cross-platform and rather easy way. It does not do anything beyond that. All the OpenGL stuff is done in the "real" OpenGL, in the "real" OpenGL way.
    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

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    244
    ah so it does set up the window. i could have thougt of that
    so i guess SDL openGL is useful for

    - a simple 3d engine
    - a complex and __FAST__ 3d engine
    - a commercial 3d engine

    is it?

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    It's useful whenever you prefer to wrestle with the SDL instead of platform-specific APIs (GLX, WGL and AGL) for setting up an OpenGL context. This includes pretty much every situation except an embedded OpenGL subwindow in a normal application.
    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

  5. #5
    Registered User
    Join Date
    Jan 2008
    Posts
    244
    ok thats totaly what i dont nead!
    i will then use this with hapiness
    thank you!

  6. #6
    Registered User
    Join Date
    Jan 2008
    Posts
    244
    anyway, are there any useful tutorials?

    that one is 300 lines long http://lazyfoo.net/SDL_tutorials/index.php
    all i neeed is the initializion with a simple triangle. but instead i found a struct of classes and hierachic functions :/

  7. #7
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    >> are there any useful tutorials?
    For OGL or SDL?

    I know NeHe has a tutorial about setting up a gl context in a window.

  8. #8
    Registered User
    Join Date
    Jan 2008
    Posts
    244
    i know nehe@gamedev, but what i needa know is how to set it up in SDL..

  9. #9
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    NeHe has SDL base code. Scroll down a little.

  10. #10
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    The OpenGL tutorial at nehe has, among the code sample variants, one using SDL.
    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

  11. #11
    Registered User
    Join Date
    Jan 2008
    Posts
    244
    ah thats what i didnt see.
    thanks guys!

  12. #12
    Registered User
    Join Date
    Jan 2008
    Posts
    244
    umh... even more code...
    i've been looking for something about 50 lines. i think thats pretty much possible isnt it?

  13. #13
    Registered User
    Join Date
    Jan 2008
    Posts
    244
    ok found something
    *never mind

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL and SDL
    By ThLstN in forum Game Programming
    Replies: 2
    Last Post: 08-28-2008, 06:09 AM
  2. Replies: 5
    Last Post: 11-27-2005, 09:50 PM
  3. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  4. Widgets with OpenGL, DirectX or SDL?
    By nickname_changed in forum Game Programming
    Replies: 1
    Last Post: 09-25-2004, 11:33 PM
  5. SDL or GLUT for Opengl?
    By drdroid in forum Game Programming
    Replies: 1
    Last Post: 07-17-2003, 01:54 AM