1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 //=============================================================================
24 //
25 // The main backend interface.
26 //
27 // TODO: split up later if it gets filled with functions in all categories.
28 //
29 //=============================================================================
30 
31 #include "ags/shared/core/platform.h"
32 #include "ags/lib/std/vector.h"
33 #include "ags/engine/gfx/gfx_defines.h"
34 
35 namespace AGS3 {
36 
37 // Initializes main backend system;
38 // should be called before anything else backend related.
39 // Returns 0 on success, non-0 on failure.
40 int  sys_main_init(/*config*/);
41 // Shutdown main backend system;
42 // should be called last, after everything else backend related is shutdown.
43 void sys_main_shutdown();
44 // Sets whether the engine wants to update while the window has no focus.
45 // TODO: this is a placeholder at the moment, check later if we need any implementation
46 void sys_set_background_mode(bool on);
47 
48 // Display utilities.
49 //
50 // Queries current desktop resolution.
51 int sys_get_desktop_resolution(int &width, int &height);
52 // Queries supported desktop modes.
53 void sys_get_desktop_modes(std::vector<AGS::Engine::DisplayMode> &dms);
54 
55 // Window utilities.
56 //
57 struct SDL_Window;
58 // Create a new single game window.
59 SDL_Window *sys_window_create(const char *window_title, int w, int h, bool windowed, int ex_flags = 0);
60 // Returns current game window, if one exists, or null.
61 SDL_Window *sys_get_window();
62 // Sets current window style, does nothing if window was not created.
63 void sys_window_set_style(bool windowed);
64 // Set new window size; optionally center new window on screen
65 bool sys_window_set_size(int w, int h, bool center);
66 // Shows or hides system cursor when it's in the game window
67 void sys_window_show_cursor(bool on);
68 // Locks on unlocks mouse inside the window.
69 // Returns new state of the mouse lock.
70 bool sys_window_lock_mouse(bool on);
71 // Sets mouse position within the game window
72 void sys_window_set_mouse(int x, int y);
73 // Destroy current game window, if one exists.
74 void sys_window_destroy();
75 // Set window title text.
76 void sys_window_set_title(const char *title);
77 // Set window icon.
78 // TODO: this is a placeholder, until we figure out the best way to set icon with SDL on wanted systems.
79 void sys_window_set_icon();
80 
81 #if AGS_PLATFORM_OS_WINDOWS
82 // Returns game window's handle.
83 void *sys_win_get_window();
84 #endif
85 
86 } // namespace AGS3
87