Skyscraper 2.0
mainscreen.h
Go to the documentation of this file.
1/*
2 Skyscraper 2.0 Alpha - Main Screen
3 Copyright (C)2004-2024 Ryan Thoryk
4 https://www.skyscrapersim.net
5 https://sourceforge.net/projects/skyscraper/
6 Contact - ryan@skyscrapersim.net
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21*/
22
23#ifndef MAINSCREEN_H
24#define MAINSCREEN_H
25
26#ifdef USING_WX
27#include <wx/frame.h>
28#include <wx/panel.h>
29
30class wxJoystick;
31
32namespace Skyscraper {
33
34class MainScreen : public wxFrame
35{
36public:
37 MainScreen(Skyscraper *parent, int width, int height);
38 virtual ~MainScreen();
39 void OnIconize(wxIconizeEvent& event);
40 void OnSize(wxSizeEvent& event);
41 void OnClose(wxCloseEvent& event);
42 void ShowWindow();
43 void OnIdle(wxIdleEvent& event);
44 void OnPaint(wxPaintEvent& event);
45 void OnActivate(wxActivateEvent & event);
46 void OnKeyDown(wxKeyEvent& event);
47 void OnKeyUp(wxKeyEvent& event);
48 void OnMouseButton(wxMouseEvent& event);
49 void EnableFreelook(bool value);
50#ifndef __FreeBSD__
51 void OnJoystickEvent(wxJoystickEvent& event);
52#endif
53
54 bool Active;
55 bool InLoop;
56 Skyscraper *frontend;
57 wxPanel *panel;
58
59private:
60 void GetKeyStates(EngineContext *engine, wxKeyEvent& event, bool down);
61 void ProcessMovement(EngineContext *engine, bool control = false, bool shift = false, bool angle_only = false);
62 void HandleMouseMovement();
63
64 //input system key mappings
65 char key_right, key_left, key_up, key_down, key_straferight, key_strafeleft, key_lookup, key_lookdown;
66 char key_binoculars, key_crouch, key_floatup, key_floatdown, key_noclip;
67 char key_pickup, key_load, key_enter;
68
69#ifndef __FreeBSD__
70 wxJoystick *joystick;
71 int joy_buttons;
72 int joy_click, joy_strafe, joy_fast, joy_turn, joy_forward;
73#endif
74
75 DECLARE_EVENT_TABLE()
76};
77
78}
79
80#endif
81#endif