mirror of https://github.com/encounter/SDL.git
haiku: Added support for some values set with SDL_GL_SetAttribute().
This commit is contained in:
parent
6086e8d384
commit
90488d6c29
|
@ -72,6 +72,7 @@ class SDL_BWin:public BDirectWindow
|
||||||
|
|
||||||
#if SDL_VIDEO_OPENGL
|
#if SDL_VIDEO_OPENGL
|
||||||
_SDL_GLView = NULL;
|
_SDL_GLView = NULL;
|
||||||
|
_gl_type = 0;
|
||||||
#endif
|
#endif
|
||||||
_shown = false;
|
_shown = false;
|
||||||
_inhibit_resize = false;
|
_inhibit_resize = false;
|
||||||
|
@ -133,6 +134,7 @@ class SDL_BWin:public BDirectWindow
|
||||||
B_FOLLOW_ALL_SIDES,
|
B_FOLLOW_ALL_SIDES,
|
||||||
(B_WILL_DRAW | B_FRAME_EVENTS),
|
(B_WILL_DRAW | B_FRAME_EVENTS),
|
||||||
gl_flags);
|
gl_flags);
|
||||||
|
_gl_type = gl_flags;
|
||||||
}
|
}
|
||||||
AddChild(_SDL_GLView);
|
AddChild(_SDL_GLView);
|
||||||
_SDL_GLView->EnableDirectMode(true);
|
_SDL_GLView->EnableDirectMode(true);
|
||||||
|
@ -443,6 +445,7 @@ class SDL_BWin:public BDirectWindow
|
||||||
BBitmap *GetBitmap() { return _bitmap; }
|
BBitmap *GetBitmap() { return _bitmap; }
|
||||||
#if SDL_VIDEO_OPENGL
|
#if SDL_VIDEO_OPENGL
|
||||||
BGLView *GetGLView() { return _SDL_GLView; }
|
BGLView *GetGLView() { return _SDL_GLView; }
|
||||||
|
Uint32 GetGLType() { return _gl_type; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Setter methods */
|
/* Setter methods */
|
||||||
|
@ -625,6 +628,7 @@ private:
|
||||||
/* Members */
|
/* Members */
|
||||||
#if SDL_VIDEO_OPENGL
|
#if SDL_VIDEO_OPENGL
|
||||||
BGLView * _SDL_GLView;
|
BGLView * _SDL_GLView;
|
||||||
|
Uint32 _gl_type;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int32 _last_buttons;
|
int32 _last_buttons;
|
||||||
|
|
|
@ -35,8 +35,6 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define BGL_FLAGS BGL_RGB | BGL_DOUBLE
|
|
||||||
|
|
||||||
static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
|
static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
|
||||||
return ((SDL_BWin*)(window->driverdata));
|
return ((SDL_BWin*)(window->driverdata));
|
||||||
}
|
}
|
||||||
|
@ -104,7 +102,28 @@ SDL_GLContext BE_GL_CreateContext(_THIS, SDL_Window * window) {
|
||||||
/* FIXME: Not sure what flags should be included here; may want to have
|
/* FIXME: Not sure what flags should be included here; may want to have
|
||||||
most of them */
|
most of them */
|
||||||
SDL_BWin *bwin = _ToBeWin(window);
|
SDL_BWin *bwin = _ToBeWin(window);
|
||||||
bwin->CreateGLView(BGL_FLAGS);
|
Uint32 gl_flags = BGL_RGB;
|
||||||
|
if (_this->gl_config.alpha_size) {
|
||||||
|
gl_flags |= BGL_ALPHA;
|
||||||
|
}
|
||||||
|
if (_this->gl_config.depth_size) {
|
||||||
|
gl_flags |= BGL_DEPTH;
|
||||||
|
}
|
||||||
|
if (_this->gl_config.stencil_size) {
|
||||||
|
gl_flags |= BGL_STENCIL;
|
||||||
|
}
|
||||||
|
if (_this->gl_config.double_buffer) {
|
||||||
|
gl_flags |= BGL_DOUBLE;
|
||||||
|
} else {
|
||||||
|
gl_flags |= BGL_SINGLE;
|
||||||
|
}
|
||||||
|
if (_this->gl_config.accum_red_size ||
|
||||||
|
_this->gl_config.accum_green_size ||
|
||||||
|
_this->gl_config.accum_blue_size ||
|
||||||
|
_this->gl_config.accum_alpha_size) {
|
||||||
|
gl_flags |= BGL_ACCUM;
|
||||||
|
}
|
||||||
|
bwin->CreateGLView(gl_flags);
|
||||||
return (SDL_GLContext)(bwin);
|
return (SDL_GLContext)(bwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,7 +159,7 @@ void BE_GL_RebootContexts(_THIS) {
|
||||||
if(bwin->GetGLView()) {
|
if(bwin->GetGLView()) {
|
||||||
bwin->LockLooper();
|
bwin->LockLooper();
|
||||||
bwin->RemoveGLView();
|
bwin->RemoveGLView();
|
||||||
bwin->CreateGLView(BGL_FLAGS);
|
bwin->CreateGLView(bwin->GetGLType());
|
||||||
bwin->UnlockLooper();
|
bwin->UnlockLooper();
|
||||||
}
|
}
|
||||||
window = window->next;
|
window = window->next;
|
||||||
|
|
Loading…
Reference in New Issue