Log detected extensions and correct spacing.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4305
This commit is contained in:
parent
114c820454
commit
b59d73f5b7
1 changed files with 31 additions and 28 deletions
|
@ -1330,34 +1330,37 @@ static void GUI_StartUp(Section * sec) {
|
|||
|
||||
sdl.overlay=0;
|
||||
#if C_OPENGL
|
||||
if(sdl.desktop.want_type==SCREEN_OPENGL){ /* OPENGL is requested */
|
||||
sdl.surface=SDL_SetVideoMode_Wrap(640,400,0,SDL_OPENGL);
|
||||
if (sdl.surface == NULL) {
|
||||
LOG_MSG("Could not initialize OpenGL, switching back to surface");
|
||||
sdl.desktop.want_type=SCREEN_SURFACE;
|
||||
} else {
|
||||
sdl.opengl.buffer=0;
|
||||
sdl.opengl.framebuf=0;
|
||||
sdl.opengl.texture=0;
|
||||
sdl.opengl.displaylist=0;
|
||||
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &sdl.opengl.max_texsize);
|
||||
glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)SDL_GL_GetProcAddress("glGenBuffersARB");
|
||||
glBindBufferARB = (PFNGLBINDBUFFERARBPROC)SDL_GL_GetProcAddress("glBindBufferARB");
|
||||
glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)SDL_GL_GetProcAddress("glDeleteBuffersARB");
|
||||
glBufferDataARB = (PFNGLBUFFERDATAARBPROC)SDL_GL_GetProcAddress("glBufferDataARB");
|
||||
glMapBufferARB = (PFNGLMAPBUFFERARBPROC)SDL_GL_GetProcAddress("glMapBufferARB");
|
||||
glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)SDL_GL_GetProcAddress("glUnmapBufferARB");
|
||||
const char * gl_ext = (const char *)glGetString (GL_EXTENSIONS);
|
||||
if(gl_ext && *gl_ext){
|
||||
sdl.opengl.packed_pixel=(strstr(gl_ext,"EXT_packed_pixels") != NULL);
|
||||
sdl.opengl.paletted_texture=(strstr(gl_ext,"EXT_paletted_texture") != NULL);
|
||||
sdl.opengl.pixel_buffer_object=(strstr(gl_ext,"GL_ARB_pixel_buffer_object") != NULL ) &&
|
||||
glGenBuffersARB && glBindBufferARB && glDeleteBuffersARB && glBufferDataARB &&
|
||||
glMapBufferARB && glUnmapBufferARB;
|
||||
} else {
|
||||
sdl.opengl.packed_pixel=sdl.opengl.paletted_texture=false;
|
||||
}
|
||||
}
|
||||
if (sdl.desktop.want_type == SCREEN_OPENGL) { /* OPENGL is requested */
|
||||
sdl.surface = SDL_SetVideoMode_Wrap(640,400,0,SDL_OPENGL);
|
||||
if (sdl.surface == NULL) {
|
||||
LOG_MSG("Could not initialize OpenGL, switching back to surface");
|
||||
sdl.desktop.want_type = SCREEN_SURFACE;
|
||||
} else {
|
||||
sdl.opengl.buffer=0;
|
||||
sdl.opengl.framebuf=0;
|
||||
sdl.opengl.texture=0;
|
||||
sdl.opengl.displaylist=0;
|
||||
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &sdl.opengl.max_texsize);
|
||||
glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)SDL_GL_GetProcAddress("glGenBuffersARB");
|
||||
glBindBufferARB = (PFNGLBINDBUFFERARBPROC)SDL_GL_GetProcAddress("glBindBufferARB");
|
||||
glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)SDL_GL_GetProcAddress("glDeleteBuffersARB");
|
||||
glBufferDataARB = (PFNGLBUFFERDATAARBPROC)SDL_GL_GetProcAddress("glBufferDataARB");
|
||||
glMapBufferARB = (PFNGLMAPBUFFERARBPROC)SDL_GL_GetProcAddress("glMapBufferARB");
|
||||
glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)SDL_GL_GetProcAddress("glUnmapBufferARB");
|
||||
const char * gl_ext = (const char *)glGetString (GL_EXTENSIONS);
|
||||
if(gl_ext && *gl_ext){
|
||||
sdl.opengl.packed_pixel=(strstr(gl_ext,"EXT_packed_pixels") != NULL);
|
||||
sdl.opengl.paletted_texture=(strstr(gl_ext,"EXT_paletted_texture") != NULL);
|
||||
sdl.opengl.pixel_buffer_object=(strstr(gl_ext,"GL_ARB_pixel_buffer_object") != NULL ) &&
|
||||
glGenBuffersARB && glBindBufferARB && glDeleteBuffersARB && glBufferDataARB &&
|
||||
glMapBufferARB && glUnmapBufferARB;
|
||||
} else {
|
||||
sdl.opengl.packed_pixel = false;
|
||||
sdl.opengl.paletted_texture = false;
|
||||
sdl.opengl.pixel_buffer_object = false;
|
||||
}
|
||||
LOG_MSG("OpenGL extensions: packed pixel %d, paletted_texture %d, pixel_bufer_object %d",sdl.opengl.packed_pixel,sdl.opengl.paletted_texture,sdl.opengl.pixel_buffer_object);
|
||||
}
|
||||
} /* OPENGL is requested end */
|
||||
|
||||
#endif //OPENGL
|
||||
|
|
Loading…
Add table
Reference in a new issue