Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: SDL + OpenGL 3.2?

  1. #1

    SDL + OpenGL 3.2?

    Hey Guys

    Is it possible/easy to use (jedi) SDL with OpenGL 3.2 in Delphi and Lazarus? I'm considering this because it would give me a complete cross-platform sollution without having to bother with different windows etc..

    I thought I'd better ask this before investing a lot of time in a SDL + GL3 project.

    Thanks.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  2. #2
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524

    Re: SDL + OpenGL 3.2?

    with the context created in SDL i've been using the DGL OpenGL 3.2 (http://www.delphigl.com/) header translation, however I'm currently using gl2 style. I think I remember reading that SDL 1.3 added support for opengl 3 contexts (or somthing like that) but the jedi-sdl headers are not up to date.

    http://www.opengl.org/wiki/Tutorial1..._%28C_/_SDL%29

    taking a quick look at this C sdl opengl 3.2 context example, I see a few sdl calls not present in jedi-sdl:

    SDL_GL_SetSwapInterval()
    SDL_GL_CreateContext()


    it's probably the CreateContext() that sets the important stuff, it should be trivial to append this to the jedi-sdl header, then you should be good with the DGL opengl 3.2 header with a true 3.2 context.

    I believe that because new versions of SDL are backwards compatible (and thus don't remove or change aready implemented funcs, I think..) it should be safe to just add these missing decelerations and update the SDL dll/.so whatever to v1.3

    I'll test tomorrow, hopefully I'm not mistaken about the backwards compatibility.

    someone needs to get the headers up to date, but sourceforge jedi-sdl looks like it's dead.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  3. #3
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524

    Re: SDL + OpenGL 3.2?

    ahh crap, sdl 1.3 is still living in SVN anyone using your code on posix systems are going to have to compile sdl from svn atm
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  4. #4
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Re: SDL + OpenGL 3.2?

    I can't say for SDL + GL3.0, BUT I can say for sure that SDL + GL 2.0 go well together. In fact I know first hand that JEDI-SDL contains the OpenGL headers.

    Not sure what state the SDL API is at with GL3/4 compatibility, but I can't see why it wouldn't be able to work with it. What do you want to do that requires GL3 anyhow? Some effect or scripting features?

    Oh and did you know that OpenGL 4.0 was out already? http://www.opengl.org/
    Jason McMillen
    Pascal Game Development
    Co-Founder





  5. #5

    Re: SDL + OpenGL 3.2?

    Thanks.

    @Fhibermon: Nice tutorial page. I'm gonna read that.

    @WILL: Yes I know about GL 4.0. I was reading the specs the other day. Unfortunately there are no drivers yet. Also It'll take some time before we have updated headers for pascal.

    Maybe I should contact Dom as he maintains the jediSDL source (AFAIK). I'd really like to get this working.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  6. #6

    Re: SDL + OpenGL 3.2?

    Quote Originally Posted by chronozphere
    @WILL: Yes I know about GL 4.0. I was reading the specs the other day. Unfortunately there are no drivers yet. Also It'll take some time before we have updated headers for pascal.
    There may be no drivers yet, but headers are updated already. Grab 'em here.

  7. #7
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Re: SDL + OpenGL 3.2?

    Ah good old DelphiGL.com? Love those Germans.

    Yeah get in touch with Dom if you can. JEDI-SDL hasn't had an update in a while maybe it has a new version of SDL to include.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  8. #8

    Re: SDL + OpenGL 3.2?

    I've began to create SDL 1.3 bindings for Pascal, initially made for iPhone/iTouch/iPad, but I guess they should work on other platforms as well. It's still Pre-Alpha/Alpha, but if you are interested in trying them out, send me a PM.
    Freeze Development | Elysion Game Framework | Twitter: @Stoney_FD
    Check out my new book: Irrlicht 1.7.1 Realtime 3D Engine Beginner's Guide (It's C++ flavored though)

    Programmer: A device for converting coffein into software.

  9. #9

    Re: SDL + OpenGL 3.2?

    Hey guys,

    I'd like to get something working this weekend. The problem is that I don't have a clue where to start.

    This is how initialization should be done for OpenGL 3.2:

    http://www.opengl.org/wiki/Tutorial1..._%28C_/_SDL%29

    It seems like I need SDL 1.3 which is not officially released yet. This means I have to compile the libraries myself for different platforms. This is not something I see myself doing quickly, as I'm always struggling to get compilers working (especially on other platforms).

    Would it be possible to use SDL 1.2 with OpenGL 3.2?
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  10. #10
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524

    Re: SDL + OpenGL 3.2?

    Well the other option would be to create the SDL window without a GL context and then write your own platform specifics for GL3 Context Creation and attach it to the window.

    then you get to keep SDL for most other things.

    in fact, why not just translate the following into pascal? :

    http://old.nabble.com/OpenGL-3.0-Con...d22645797.html

    that's a discussion of a patch that allows for the new style contexts to be created, there's a windows implementation and an X11 implementation to get you started.

    you'll need a few other functions but then you'll be sailing.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

Page 1 of 2 12 LastLast

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
  •