Edit

kc3-lang/SDL/src/video/khronos/GLES2/gl2platform.h

Branch :

  • Show log

    Commit

  • Author : Sam Lantinga
    Date : 2017-08-29 22:04:43
    Hash : 92bf6085
    Message : Fixed bug 3616 - SDL_GL_CreateContext fails with SDL_GL_CONTEXT_DEBUG_FLAG and ANGLE/GLES 2.0 Colin Barrett Using the pre-built x86 devel libs from here: https://www.libsdl.org/release/SDL2-devel-2.0.5-VC.zip If I have: SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG); and I'm using ANGLE/(a GL driver that doesn't provide an ES2 context) such that SDL_EGL_CreateContext is called by SDL_GL_CreateContext, I get the error "Could not create EGL context (context attributes are not supported)" and no context is created. Looking at the code in SDL_EGL_CreateContext - if gl_config.flags is non-zero, it looks like the code in the section guarded with "#ifdef EGL_KHR_create_context" should be executed - but it apparently isn't. Is it possible this section hasn't been compiled into the pre-built libraries? If I build SDL2.dll myself using the Visual C++ solution (VS2015 Community Update 3) then the call succeeds as I expect

  • src/video/khronos/GLES2/gl2platform.h
  • #ifndef __gl2platform_h_
    #define __gl2platform_h_
    
    /*
    ** Copyright (c) 2017 The Khronos Group Inc.
    **
    ** Licensed under the Apache License, Version 2.0 (the "License");
    ** you may not use this file except in compliance with the License.
    ** You may obtain a copy of the License at
    **
    **     http://www.apache.org/licenses/LICENSE-2.0
    **
    ** Unless required by applicable law or agreed to in writing, software
    ** distributed under the License is distributed on an "AS IS" BASIS,
    ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    ** See the License for the specific language governing permissions and
    ** limitations under the License.
    */
    
    /* Platform-specific types and definitions for OpenGL ES 2.X  gl2.h
     *
     * Adopters may modify khrplatform.h and this file to suit their platform.
     * Please contribute modifications back to Khronos as pull requests on the
     * public github repository:
     *      https://github.com/KhronosGroup/OpenGL-Registry
     */
    
    #include <KHR/khrplatform.h>
    
    #ifndef GL_APICALL
    #define GL_APICALL  KHRONOS_APICALL
    #endif
    
    #ifndef GL_APIENTRY
    #define GL_APIENTRY KHRONOS_APIENTRY
    #endif
    
    #endif /* __gl2platform_h_ */