Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use XGetErrorText() instead of our own table #23

Merged
merged 1 commit into from Jan 8, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions libobs-opengl/gl-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,7 @@ static const GLenum ctx_attribs[] = {
None,
};

static const char* __GLX_error_table[] = {
"Success",
"Bad Screen",
"Bad Attribute",
"No Extension",
"Bad Visual",
"Bad Content",
"Bad Value",
"Bad Enumeration"
};

#define GET_GLX_ERROR(x) \
__GLX_error_table[x]
#define ERROR_TEXT_LEN 1024

struct gl_windowinfo {
uint32_t id;
Expand All @@ -52,7 +40,11 @@ struct gl_platform {

static int GLXErrorHandler(Display *disp, XErrorEvent *error)
{
blog(LOG_ERROR, "GLX error: %s\n", GET_GLX_ERROR(error->error_code));
char error_buf[ERROR_TEXT_LEN];

XGetErrorText(disp, error->error_code, error_buf, ERROR_TEXT_LEN);
blog(LOG_ERROR, "GLX error: %s\n", error_buf);

return 0;
}

Expand Down