1
我正在開發一個opengl-es應用程序在Linux中。失敗請求的主要操作碼:1(X_CreateWindow) - Ubuntu
我的系統細節:
的Ubuntu LTS 14.04
64位
英特爾®酷睿™i5-4570 CPU @ 3.20GHz×4
英特爾Haswell的桌面
我初始化egl和opengl爲i ñ 「http://opengles-book-samples.googlecode.com/svn/trunk/LinuxX11/Common/esUtil.c」
與CreateWindow的代碼如下
if(!(x11_display = XOpenDisplay(NULL)))
{
printf("GAL_X11WinCreate:: x11_display == NULL ==> could not open display\n");
return EGL_FALSE;
}
root = DefaultRootWindow(x11_display);
swa.event_mask = ExposureMask | PointerMotionMask | KeyPressMask;
win = XCreateWindow(
x11_display, root,
0, 0, iWidth, iHeight, 0,
CopyFromParent, InputOutput,
CopyFromParent, CWEventMask,
&swa
);
xattr.override_redirect = FALSE;
XChangeWindowAttributes (x11_display, win, CWOverrideRedirect, &xattr);
hints.input = TRUE;
hints.flags = InputHint;
XSetWMHints(x11_display, win, &hints);
// make the window visible on the screen
XMapWindow (x11_display, win);
XStoreName (x11_display, win, "OGLES_FMWRK");
// get identifiers for the provided atom name strings
wm_state = XInternAtom (x11_display, "_NET_WM_STATE", FALSE);
memset (&xev, 0, sizeof(xev));
xev.type = ClientMessage;
xev.xclient.window = win;
xev.xclient.message_type = wm_state;
xev.xclient.format = 32;
xev.xclient.data.l[0] = 1;
xev.xclient.data.l[1] = FALSE;
XSendEvent (
x11_display,
DefaultRootWindow (x11_display),
FALSE,
SubstructureNotifyMask,
&xev
);
*hWnd = (EGLNativeWindowType) win;
我收到以下錯誤。
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 1 (X_CreateWindow)
Value in failed request: 0x0
Serial number of failed request: 7
Current serial number in output stream: 12
可能是什麼問題?
你可以編譯並運行HelloTriangle嗎? –