Changeset 288

Show
Ignore:
Timestamp:
04/04/08 13:35:14 (5 months ago)
Author:
hugues
Message:

DerelictGL: Corrected DerelictGLContext support on Mac OS X (darwin).
Resolves ticket #7: Revision 262 - GLXContext breakes on Mac OS X
* opengl/gl.d:

  • Corrected definition of DerelictGLContext for version darwin.
  • Added DerelictGL.hasValidContext() and DerelictGL.getCurrentContext() support for version darwin.

* Added opengl/cgl.d (Core OpenGL definitions).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/DerelictGL/derelict/opengl/gl.d

    r287 r288  
    11/* 
    2  * Copyright (c) 2004-2007 Derelict Developers 
     2 * Copyright (c) 2004-2008 Derelict Developers 
    33 * All rights reserved. 
    44 * 
     
    6262    else version(darwin) 
    6363    { 
    64         void loadPlatformGL(SharedLib lib) {} 
     64        import derelict.opengl.cgl; 
     65        alias CGLContextObj DerelictGLContext; 
    6566    } 
    6667 
     
    203204                return false; 
    204205        } 
     206        else version(darwin) 
     207        { 
     208            if(CGLGetCurrentContext() is null) 
     209                return false; 
     210        } 
    205211        else throw new DerelictException("DerelictGL.hasValidContext is unimplemented for this platform"); 
    206212 
     
    212218        version(Windows) return wglGetCurrentContext(); 
    213219        else version(UsingGLX) return glXGetCurrentContext(); 
     220        else version(darwin) return CGLGetCurrentContext(); 
    214221        else throw new DerelictException("DerelictGL.getCurrentContext is Unimplemented for this platform"); 
    215222    }