mirror of
https://github.com/ProgramSnail/rts_game_backend.git
synced 2026-01-25 21:07:08 +00:00
added input, some changes
This commit is contained in:
parent
733bcbd99d
commit
76c85016d8
10 changed files with 54 additions and 4 deletions
|
|
@ -6,10 +6,13 @@
|
|||
#include "input.hpp"
|
||||
|
||||
namespace init {
|
||||
WINDOW* stdscr;
|
||||
|
||||
void begin() {
|
||||
initscr();
|
||||
stdscr = initscr();
|
||||
noecho();
|
||||
curs_set(false);
|
||||
nodelay(stdscr, true);
|
||||
draw::begin();
|
||||
input::begin();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace input {
|
|||
}
|
||||
|
||||
void step() {
|
||||
|
||||
lastInput = getch();
|
||||
}
|
||||
|
||||
void end() {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
#include <cstdint>
|
||||
#include <curses.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace input {
|
||||
char lastInput = ERR;
|
||||
|
||||
void begin();
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
#include <set>
|
||||
|
||||
#pragma once
|
||||
|
||||
// add keyboard to keys rebinding for each InputController
|
||||
|
||||
class InputController {
|
||||
private:
|
||||
|
||||
public:
|
||||
InputController()
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue