src/video/emscripten/SDL_emscriptenopengles.c
changeset 10644 594c17c446f6
parent 9998 f67cf37e9cd4
child 10737 3406a0f8b041
equal deleted inserted replaced
10643:930938c7ca82 10644:594c17c446f6
    37     /*we can't load EGL dynamically*/
    37     /*we can't load EGL dynamically*/
    38     _this->egl_data = (struct SDL_EGL_VideoData *) SDL_calloc(1, sizeof(SDL_EGL_VideoData));
    38     _this->egl_data = (struct SDL_EGL_VideoData *) SDL_calloc(1, sizeof(SDL_EGL_VideoData));
    39     if (!_this->egl_data) {
    39     if (!_this->egl_data) {
    40         return SDL_OutOfMemory();
    40         return SDL_OutOfMemory();
    41     }
    41     }
    42     
    42 
       
    43     /* Emscripten forces you to manually cast eglGetProcAddress to the real
       
    44        function type; grep for "__eglMustCastToProperFunctionPointerType" in
       
    45        Emscripten's egl.h for details. */
       
    46     _this->egl_data->eglGetProcAddress = (void *(EGLAPIENTRY *)(const char *)) eglGetProcAddress;
       
    47 
    43     LOAD_FUNC(eglGetDisplay);
    48     LOAD_FUNC(eglGetDisplay);
    44     LOAD_FUNC(eglInitialize);
    49     LOAD_FUNC(eglInitialize);
    45     LOAD_FUNC(eglTerminate);
    50     LOAD_FUNC(eglTerminate);
    46     LOAD_FUNC(eglGetProcAddress);
       
    47     LOAD_FUNC(eglChooseConfig);
    51     LOAD_FUNC(eglChooseConfig);
    48     LOAD_FUNC(eglGetConfigAttrib);
    52     LOAD_FUNC(eglGetConfigAttrib);
    49     LOAD_FUNC(eglCreateContext);
    53     LOAD_FUNC(eglCreateContext);
    50     LOAD_FUNC(eglDestroyContext);
    54     LOAD_FUNC(eglDestroyContext);
    51     LOAD_FUNC(eglCreateWindowSurface);
    55     LOAD_FUNC(eglCreateWindowSurface);