src/video/bwindow/SDL_bopengl.cc
changeset 5934 01531d8d1e01
parent 5931 edf9a8e68b34
child 5935 d52ded852194
     1.1 --- a/src/video/bwindow/SDL_bopengl.cc	Wed Aug 03 06:22:33 2011 +0000
     1.2 +++ b/src/video/bwindow/SDL_bopengl.cc	Mon Aug 08 17:00:38 2011 +0000
     1.3 @@ -119,6 +119,52 @@
     1.4  }
     1.5  
     1.6  
     1.7 +
     1.8 +
     1.9 +void BE_GL_SwapWindow(_THIS, SDL_Window * window) {
    1.10 +    _ToBeWin(window)->SwapBuffers();
    1.11 +}
    1.12 +
    1.13 +int BE_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) {
    1.14 +	_GetBeApp()->SetCurrentContext(((SDL_BWin*)context)->GetGLView());
    1.15 +	return 0;
    1.16 +}
    1.17 +
    1.18 +
    1.19 +SDL_GLContext BE_GL_CreateContext(_THIS, SDL_Window * window) {
    1.20 +	/* FIXME: Not sure what flags should be included here; may want to have
    1.21 +	   most of them */
    1.22 +	SDL_BWin *bwin = _ToBeWin(window);
    1.23 +	bwin->CreateGLView(BGL_RGB | BGL_DOUBLE);
    1.24 +	return (SDL_GLContext)(bwin);
    1.25 +}
    1.26 +
    1.27 +void BE_GL_DeleteContext(_THIS, SDL_GLContext context) {
    1.28 +	/* Currently, automatically unlocks the view */
    1.29 +	((SDL_BWin*)context)->RemoveGLView();
    1.30 +}
    1.31 +
    1.32 +
    1.33 +int BE_GL_SetSwapInterval(_THIS, int interval) {
    1.34 +	printf(__FILE__": %d- swap interval set\n", __LINE__);
    1.35 +	return 0;
    1.36 +}
    1.37 +
    1.38 +int BE_GL_GetSwapInterval(_THIS) {
    1.39 +	printf(__FILE__": %d- swap interval requested\n", __LINE__);
    1.40 +	return 0;
    1.41 +}
    1.42 +
    1.43 +
    1.44 +void BE_GL_UnloadLibrary(_THIS) {
    1.45 +	printf(__FILE__": %d- Library unloaded\n", __LINE__);
    1.46 +}
    1.47 +
    1.48 +
    1.49 +
    1.50 +
    1.51 +
    1.52 +
    1.53  #if 0 /* Functions from 1.2 that do not appear to be used in 1.3 */
    1.54  
    1.55      int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int *value)
    1.56 @@ -182,38 +228,13 @@
    1.57      }
    1.58  
    1.59  #endif
    1.60 -    void BE_GL_SwapWindow(_THIS, SDL_Window * window) {
    1.61 -        _ToBeWin(window)->SwapBuffers();
    1.62 -    }
    1.63  
    1.64 -int BE_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) {
    1.65 -	_GetBeApp()->SetCurrentContext((BGLView*)context);
    1.66 -	return 0;
    1.67 -}
    1.68  
    1.69  
    1.70 -SDL_GLContext BE_GL_CreateContext(_THIS, SDL_Window * window) {
    1.71 -	/* FIXME: Not sure what flags should be included here; may want to have
    1.72 -	   most of them */
    1.73 -	return (SDL_GLContext)(_ToBeWin(window)->CreateGLView(
    1.74 -		BGL_RGB | BGL_DOUBLE));
    1.75 -}
    1.76  
    1.77 -void BE_GL_DeleteContext(_THIS, SDL_GLContext context) {
    1.78 -	/* Currently, automatically unlocks the view */
    1.79 -//	_ToBeWin(window)->RemoveGLView();	FIXME: Need to get the bwindow somehow
    1.80 -}
    1.81  
    1.82  
    1.83 -int BE_GL_SetSwapInterval(_THIS, int interval) {
    1.84 -}
    1.85  
    1.86 -int BE_GL_GetSwapInterval(_THIS) {
    1.87 -}
    1.88 -
    1.89 -
    1.90 -void BE_GL_UnloadLibrary(_THIS) {
    1.91 -}
    1.92  
    1.93  #ifdef __cplusplus
    1.94  }