src/video/bwindow/SDL_bopengl.cc
changeset 5934 01531d8d1e01
parent 5931 edf9a8e68b34
child 5935 d52ded852194
equal deleted inserted replaced
5933:5f8a7ebc88e5 5934:01531d8d1e01
   117 		return NULL;
   117 		return NULL;
   118 	}
   118 	}
   119 }
   119 }
   120 
   120 
   121 
   121 
       
   122 
       
   123 
       
   124 void BE_GL_SwapWindow(_THIS, SDL_Window * window) {
       
   125     _ToBeWin(window)->SwapBuffers();
       
   126 }
       
   127 
       
   128 int BE_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) {
       
   129 	_GetBeApp()->SetCurrentContext(((SDL_BWin*)context)->GetGLView());
       
   130 	return 0;
       
   131 }
       
   132 
       
   133 
       
   134 SDL_GLContext BE_GL_CreateContext(_THIS, SDL_Window * window) {
       
   135 	/* FIXME: Not sure what flags should be included here; may want to have
       
   136 	   most of them */
       
   137 	SDL_BWin *bwin = _ToBeWin(window);
       
   138 	bwin->CreateGLView(BGL_RGB | BGL_DOUBLE);
       
   139 	return (SDL_GLContext)(bwin);
       
   140 }
       
   141 
       
   142 void BE_GL_DeleteContext(_THIS, SDL_GLContext context) {
       
   143 	/* Currently, automatically unlocks the view */
       
   144 	((SDL_BWin*)context)->RemoveGLView();
       
   145 }
       
   146 
       
   147 
       
   148 int BE_GL_SetSwapInterval(_THIS, int interval) {
       
   149 	printf(__FILE__": %d- swap interval set\n", __LINE__);
       
   150 	return 0;
       
   151 }
       
   152 
       
   153 int BE_GL_GetSwapInterval(_THIS) {
       
   154 	printf(__FILE__": %d- swap interval requested\n", __LINE__);
       
   155 	return 0;
       
   156 }
       
   157 
       
   158 
       
   159 void BE_GL_UnloadLibrary(_THIS) {
       
   160 	printf(__FILE__": %d- Library unloaded\n", __LINE__);
       
   161 }
       
   162 
       
   163 
       
   164 
       
   165 
       
   166 
       
   167 
   122 #if 0 /* Functions from 1.2 that do not appear to be used in 1.3 */
   168 #if 0 /* Functions from 1.2 that do not appear to be used in 1.3 */
   123 
   169 
   124     int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int *value)
   170     int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int *value)
   125     {
   171     {
   126         /*
   172         /*
   180         }
   226         }
   181         return 0;
   227         return 0;
   182     }
   228     }
   183 
   229 
   184 #endif
   230 #endif
   185     void BE_GL_SwapWindow(_THIS, SDL_Window * window) {
   231 
   186         _ToBeWin(window)->SwapBuffers();
   232 
   187     }
   233 
   188 
   234 
   189 int BE_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) {
   235 
   190 	_GetBeApp()->SetCurrentContext((BGLView*)context);
   236 
   191 	return 0;
   237 
   192 }
       
   193 
       
   194 
       
   195 SDL_GLContext BE_GL_CreateContext(_THIS, SDL_Window * window) {
       
   196 	/* FIXME: Not sure what flags should be included here; may want to have
       
   197 	   most of them */
       
   198 	return (SDL_GLContext)(_ToBeWin(window)->CreateGLView(
       
   199 		BGL_RGB | BGL_DOUBLE));
       
   200 }
       
   201 
       
   202 void BE_GL_DeleteContext(_THIS, SDL_GLContext context) {
       
   203 	/* Currently, automatically unlocks the view */
       
   204 //	_ToBeWin(window)->RemoveGLView();	FIXME: Need to get the bwindow somehow
       
   205 }
       
   206 
       
   207 
       
   208 int BE_GL_SetSwapInterval(_THIS, int interval) {
       
   209 }
       
   210 
       
   211 int BE_GL_GetSwapInterval(_THIS) {
       
   212 }
       
   213 
       
   214 
       
   215 void BE_GL_UnloadLibrary(_THIS) {
       
   216 }
       
   217 
   238 
   218 #ifdef __cplusplus
   239 #ifdef __cplusplus
   219 }
   240 }
   220 #endif
   241 #endif