mirror of
https://gitea.sffnetwork.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-11-25 03:49:46 +00:00
.h -> .hpp everything
This commit is contained in:
parent
7d3257669a
commit
7418263193
845 changed files with 53732 additions and 53754 deletions
|
|
@ -1,60 +1,60 @@
|
|||
#include "MouseHandler.h"
|
||||
#include "player/input/ITurnInput.h"
|
||||
|
||||
#ifdef RPI
|
||||
#include <SDL/SDL.h>
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||
#include <GLFW/glfw3.h>
|
||||
#endif
|
||||
|
||||
MouseHandler::MouseHandler( ITurnInput* turnInput )
|
||||
: _turnInput(turnInput)
|
||||
{}
|
||||
|
||||
MouseHandler::MouseHandler()
|
||||
: _turnInput(0)
|
||||
{}
|
||||
|
||||
MouseHandler::~MouseHandler() {
|
||||
}
|
||||
|
||||
void MouseHandler::setTurnInput( ITurnInput* turnInput ) {
|
||||
_turnInput = turnInput;
|
||||
}
|
||||
|
||||
void MouseHandler::grab() {
|
||||
xd = 0;
|
||||
yd = 0;
|
||||
|
||||
#if defined(RPI)
|
||||
//LOGI("Grabbing input!\n");
|
||||
SDL_WM_GrabInput(SDL_GRAB_ON);
|
||||
SDL_ShowCursor(0);
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||
glfwSetInputMode(glfwGetCurrentContext(), GLFW_CURSOR, GLFW_CURSOR_DISABLED);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MouseHandler::release() {
|
||||
#if defined(RPI)
|
||||
//LOGI("Releasing input!\n");
|
||||
SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||
SDL_ShowCursor(1);
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||
glfwSetInputMode(glfwGetCurrentContext(), GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MouseHandler::poll() {
|
||||
if (_turnInput != 0) {
|
||||
TurnDelta td = _turnInput->getTurnDelta();
|
||||
xd = td.x;
|
||||
yd = td.y;
|
||||
}
|
||||
}
|
||||
#include "MouseHandler.hpp"
|
||||
#include "player/input/ITurnInput.hpp"
|
||||
|
||||
#ifdef RPI
|
||||
#include <SDL/SDL.h>
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||
#include <GLFW/glfw3.h>
|
||||
#endif
|
||||
|
||||
MouseHandler::MouseHandler( ITurnInput* turnInput )
|
||||
: _turnInput(turnInput)
|
||||
{}
|
||||
|
||||
MouseHandler::MouseHandler()
|
||||
: _turnInput(0)
|
||||
{}
|
||||
|
||||
MouseHandler::~MouseHandler() {
|
||||
}
|
||||
|
||||
void MouseHandler::setTurnInput( ITurnInput* turnInput ) {
|
||||
_turnInput = turnInput;
|
||||
}
|
||||
|
||||
void MouseHandler::grab() {
|
||||
xd = 0;
|
||||
yd = 0;
|
||||
|
||||
#if defined(RPI)
|
||||
//LOGI("Grabbing input!\n");
|
||||
SDL_WM_GrabInput(SDL_GRAB_ON);
|
||||
SDL_ShowCursor(0);
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||
glfwSetInputMode(glfwGetCurrentContext(), GLFW_CURSOR, GLFW_CURSOR_DISABLED);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MouseHandler::release() {
|
||||
#if defined(RPI)
|
||||
//LOGI("Releasing input!\n");
|
||||
SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||
SDL_ShowCursor(1);
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||
glfwSetInputMode(glfwGetCurrentContext(), GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MouseHandler::poll() {
|
||||
if (_turnInput != 0) {
|
||||
TurnDelta td = _turnInput->getTurnDelta();
|
||||
xd = td.x;
|
||||
yd = td.y;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue