Closed y0dev closed 5 years ago
OIS needs to be initialized with a graphical window to be able to capture keyboard/mouse/joystick events. When you say "no GUI" you mean that your program needs to run only on the command-line? If so, I'm affraid OIS isn't going to help...
When you say "no gui" you really mean "no gui" or you just mean not using a widget toolkit (things like Qt, GTK+....)
In any case, we have the documentation fo the OIS
API here https://wgois.github.io/OIS/doxygen/html/namespace_o_i_s.html and the repository contains an example program https://github.com/wgois/OIS/blob/master/demos/OISConsoleDemo/OISConsole.cpp
As you will be able to see, even if this program only print infos to the console, it still open a window using the platfrom's specific APIs...
For input/output on the console, on Windows you should have the
If you use this, you will have one single C API to get terminal input that will works on both Windows and Linux.
Also, probably your professor can recommend you what tools you need for your assignment. So check with him/her if you are really stuck.
(just aside : If the program can create a graphical window, I would probably suggest you to try the SDL2library. SDL is a cross-platform "layer" that will permit you to do input and graphics (and other things like loading dynamic libraries, displaying message box dialog, things like that) on pretty much every platform under the sun. It's a valuable tool for any kind of game development if you want to be able to port your program everywhere)
Hope this helps :wink:
Hello I’ve been looking for a c++ library that can be used to detect keystrokes for a space invaders game using no gui I am doing for a class project. The problem I have is my professor wants the project to be compatible to run on Linux and windows. I recently came across your GitHub and seen your repository that looks like it will help, but I don’t understand how to implement it into my project because I don’t see any documentation.