fix weird segv I found when trying opengl mode in comp module on my desktop, waiting for someone to give me the "good job you did it correctly" before I backport since I probably didn't

SVN revision: 57546
This commit is contained in:
Mike Blumenkrantz 2011-03-07 05:41:49 +00:00
parent faaadaec77
commit ea5e9b6773
3 changed files with 9 additions and 3 deletions

View File

@ -135,3 +135,8 @@
2011-02-27 Vincent Torri 2011-02-27 Vincent Torri
* Fixed static linking of the bmp, wbmp and tga loaders * Fixed static linking of the bmp, wbmp and tga loaders
2011-03-07 Mike Blumenkrantz
* Fix segv when trying to set gl viewpoint with NULL ctx
* Add more verbose error message when glXMakeCurrent fails

View File

@ -32,6 +32,7 @@
# include <X11/extensions/Xrender.h> # include <X11/extensions/Xrender.h>
# include <X11/Xresource.h> // xres - dpi # include <X11/Xresource.h> // xres - dpi
# include <GL/gl.h> # include <GL/gl.h>
# include <GL/glu.h>
# include <GL/glext.h> # include <GL/glext.h>
# include <GL/glx.h> # include <GL/glx.h>
# endif # endif

View File

@ -300,7 +300,7 @@ eng_window_new(Display *disp,
{ {
if (!glXMakeCurrent(gw->disp, gw->win, gw->context)) if (!glXMakeCurrent(gw->disp, gw->win, gw->context))
{ {
printf("Error: glXMakeCurrent(%p, 0x%x, %p) failed\n", (void *)gw->disp, (unsigned int)gw->win, (void *)gw->context); printf("Error: glXMakeCurrent(%p, 0x%x, %p) failed - '%s'\n", (void *)gw->disp, (unsigned int)gw->win, (void *)gw->context, gluErrorString(glGetError()));
eng_window_free(gw); eng_window_free(gw);
return NULL; return NULL;
} }
@ -531,7 +531,7 @@ eng_window_use(Evas_GL_X11_Window *gw)
#endif #endif
} }
} }
if (gw) evas_gl_common_context_use(gw->gl_context); if (gw && gw->gl_context) evas_gl_common_context_use(gw->gl_context);
} }
void void