Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/lib/input.cpp
/* Copyright (C) 2017 Wildfire Games. | /* Copyright (C) 2020 Wildfire Games. | ||||
* | * | ||||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | ||||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | ||||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | ||||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | ||||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | ||||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | ||||
* the following conditions: | * the following conditions: | ||||
Show All 12 Lines | |||||
/* | /* | ||||
* SDL input redirector; dispatches to multiple handlers. | * SDL input redirector; dispatches to multiple handlers. | ||||
*/ | */ | ||||
#include "precompiled.h" | #include "precompiled.h" | ||||
#include "input.h" | #include "input.h" | ||||
#include "lib/external_libraries/libsdl.h" | |||||
#include <list> | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include "lib/external_libraries/libsdl.h" | |||||
const size_t MAX_HANDLERS = 9; | const size_t MAX_HANDLERS = 9; | ||||
static InHandler handler_stack[MAX_HANDLERS]; | static InHandler handler_stack[MAX_HANDLERS]; | ||||
static size_t handler_stack_top = 0; | static size_t handler_stack_top = 0; | ||||
static std::list<SDL_Event_> priority_events; | static std::list<SDL_Event_> priority_events; | ||||
void in_add_handler(InHandler handler) | void in_add_handler(InHandler handler) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator