Hi !
I have some trouble with SFML inputs (no mouse grab, among other) and I've been using OIS for some time instead.
Unfortunately, I don't recall when, but the combination of those two libraries (SFML and OIS) stopped working on Ubuntu with the following error :
X Error of failed request: BadAccess (attempt to access private resource denied)
Major opcode of failed request: 2 (X_ChangeWindowAttributes)
Serial number of failed request: 7
Current serial number in output stream: 9
while initializing OIS with a window created by SFML :
mWindow_.Create(sf::VideoMode(800, 600, 32), "Test");
There must be something that troubles OIS in the way SFML creates its window, because OIS works very well with Ogre on the same machine, and it also works if I create manually my window then send it to SFML :
Display *xDisp = 0;
Window xWin = 0;
//Connects to default X window
if(!(xDisp = XOpenDisplay(0)))
throw Exception("Error opening X!");
//Create a window
xWin = XCreateSimpleWindow(xDisp,DefaultRootWindow(xDisp), 0,0, 800, 600, 0, 0, 0);
//bind our connection to that window
XMapWindow(xDisp, xWin);
//Select what events we want to listen to locally
XSelectInput(xDisp, xWin, StructureNotifyMask);
XEvent evtent;
do
{
XNextEvent(xDisp, &evtent);
} while(evtent.type != MapNotify);
//Create sf::Window
mWindow_.Create(xWin);
(code taken from OIS samples)
I don't know X11 at all, so I have no clue of what could be wrong...
Do you have an idea ?
Thank you,