src/video/haiku/SDL_bopengl.cc
changeset 11107 a5fe51ef0877
parent 11063 43d5a039018f
child 11109 5f33dc4d399e
     1.1 --- a/src/video/haiku/SDL_bopengl.cc	Sat Jun 17 22:30:09 2017 +0200
     1.2 +++ b/src/video/haiku/SDL_bopengl.cc	Sat Jun 17 22:30:28 2017 +0200
     1.3 @@ -35,8 +35,6 @@
     1.4  #endif
     1.5  
     1.6  
     1.7 -#define BGL_FLAGS BGL_RGB | BGL_DOUBLE
     1.8 -
     1.9  static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
    1.10      return ((SDL_BWin*)(window->driverdata));
    1.11  }
    1.12 @@ -104,7 +102,28 @@
    1.13      /* FIXME: Not sure what flags should be included here; may want to have
    1.14         most of them */
    1.15      SDL_BWin *bwin = _ToBeWin(window);
    1.16 -    bwin->CreateGLView(BGL_FLAGS);
    1.17 +    Uint32 gl_flags = BGL_RGB;
    1.18 +    if (_this->gl_config.alpha_size) {
    1.19 +        gl_flags |= BGL_ALPHA;
    1.20 +    }
    1.21 +    if (_this->gl_config.depth_size) {
    1.22 +        gl_flags |= BGL_DEPTH;
    1.23 +    }
    1.24 +    if (_this->gl_config.stencil_size) {
    1.25 +        gl_flags |= BGL_STENCIL;
    1.26 +    }
    1.27 +    if (_this->gl_config.double_buffer) {
    1.28 +        gl_flags |= BGL_DOUBLE;
    1.29 +    } else {
    1.30 +        gl_flags |= BGL_SINGLE;
    1.31 +    }
    1.32 +    if (_this->gl_config.accum_red_size ||
    1.33 +            _this->gl_config.accum_green_size ||
    1.34 +            _this->gl_config.accum_blue_size ||
    1.35 +            _this->gl_config.accum_alpha_size) {
    1.36 +        gl_flags |= BGL_ACCUM;
    1.37 +    }
    1.38 +    bwin->CreateGLView(gl_flags);
    1.39      return (SDL_GLContext)(bwin);
    1.40  }
    1.41  
    1.42 @@ -140,7 +159,7 @@
    1.43          if(bwin->GetGLView()) {
    1.44              bwin->LockLooper();
    1.45              bwin->RemoveGLView();
    1.46 -            bwin->CreateGLView(BGL_FLAGS);
    1.47 +            bwin->CreateGLView(bwin->GetGLType());
    1.48              bwin->UnlockLooper();
    1.49          }
    1.50          window = window->next;