A while back i wrote a fast input library using direct input for a game engine i was working on. It has great support for keyboard, mouse, and joysticks so i want to use it with Irrlicht. I got this working correctly, but the problem is that the input is polled as part of the main game loop (i.e while device->run() loop). This means that the responsivity of my input depends on the # of frames per second i can push.
As you can imagine, testing this on a very slow machine caused dreadful input responsviity because i wasn't drawing more than 10 or 15 frames per second. Thus, i created a new thread to continuously poll the input and update the game data so it could then be represented in the frames later.
Doing this was fine, except it caused access violations (i think because i was accessing sceneNode positions while Irrlicht was attempting to do something with them). Does anyone know how i can resolve this issue? I would love to have fast, responsive input that isn't dependant on frames per second.
DirectInput, threads, and Irrlicht
-
thesmileman
- Posts: 360
- Joined: Tue Feb 10, 2004 2:20 am
- Location: Lubbock, TX
Yes, you will have to use a semaphore or a mutex(a simple semaphore) during the critical sections(places where exclusive access is important). If you are not familer with semaphores google them. There should be some good informaiton on the web about them.
I would normally give you more information but I am busy as hell.
I would normally give you more information but I am busy as hell.