1 /************************************************************************** 2 * PipeWalker game (http://pipewalker.sourceforge.net) * 3 * Copyright (C) 2007-2012 by Artem Senichev <artemsen@gmail.com> * 4 * * 5 * This program is free software: you can redistribute it and/or modify * 6 * it under the terms of the GNU General Public License as published by * 7 * the Free Software Foundation, either version 3 of the License, or * 8 * (at your option) any later version. * 9 * * 10 * This program is distributed in the hope that it will be useful, * 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 * GNU General Public License for more details. * 14 * * 15 * You should have received a copy of the GNU General Public License * 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 17 **************************************************************************/ 18 19 #pragma once 20 21 #include "common.h" 22 23 //Main button position 24 #define PW_BUTTON_Y -5.6f 25 #define PW_BUTTON_X1 -4.5f 26 #define PW_BUTTON_X2 -3.0f 27 #define PW_BUTTON_X3 3.0f 28 #define PW_BUTTON_X4 4.5f 29 30 31 /** 32 * Mode interface 33 */ 34 class mode 35 { 36 public: 37 /** 38 * Draw scene 39 * \param alpha transparency value in range [0.0f...1.0f] 40 * \return true if we need to redraw window 41 */ 42 virtual bool draw(const float alpha) = 0; 43 44 /** 45 * Mouse move handler 46 * \param x position of the mouse cursor on the X axis 47 * \param y position of the mouse cursor on the Y axis 48 * \return true if we need to redraw window 49 */ 50 virtual bool on_mouse_move(const float x, const float y) = 0; 51 52 /** 53 * Mouse click handler 54 * \param x position of the mouse cursor on the X axis 55 * \param y position of the mouse cursor on the Y axis 56 * \param btn mouse button identifier 57 * \return true if mode must be swapped 58 */ 59 virtual bool on_mouse_click(const float x, const float y, const Uint8 btn) = 0; 60 }; 61