Results 1 to 3 of 3

Thread: Creating GL-Sharing context with SDL

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    15

    Creating GL-Sharing context with SDL

    Hi,

    I'd like to create a cross-platform program with CL-GL-Interoperability and SDL.
    To create a shared context I need to give the display within the context properties to clCreateContext. My problem is, that
    Code :
    glXGetCurrentDisplay
    is not cross-platform. Is there a SDL-equivalent?
    I thougt that the return value of SDL_CreateWindow is my parameter but it is not the same as glXGetCurrentDisplay.
    However, SDL_GL_CreateContext is the same as glXGetCurrentContext().

    Someone has ideas?

  2. #2
    Member
    Join Date
    Sep 2003
    Location
    Silicon Valley
    Posts
    57

    Re: Creating GL-Sharing context with SDL

    I'm not familiar with SDL but will point out that while glXGetCurrentDisplay isn't crossplatform, neither is its use in clCreateContext - you need to pass in either an (X Display, GLX Context handle) or (WGL hDC, WGL context handle) or (EGLDisplay, EGLContext handle) or other attributes to context creation, depending on the window system OpenGL is running within. So unless SDL has queries to return exactly that
    information across platforms, you may need to poke at its internals a bit.
    Jon Leech
    EGL & OpenGL Specification Editor / OpenGL ARB Ecosystem TSG Chair / Khronos API Registrar

  3. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    2

    Re: Creating GL-Sharing context with SDL

    In SDL there is SDL_GetWMInfo to get the window bits.... but to get the GL context via SDL, there is no call.... you will need to have the #ifdef bits in your code...

Similar Threads

  1. Replies: 2
    Last Post: 04-26-2010, 08:38 PM
  2. EGL and SDL Context Creation.
    By Adventus in forum Cross API and window system integration
    Replies: 3
    Last Post: 03-07-2009, 03:03 AM

Posting Permissions

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