|
OpenTTD Source
1.10.0-RC1
|
Implementation of the Windows (GDI) video driver. More...
#include "../stdafx.h"#include "../openttd.h"#include "../gfx_func.h"#include "../os/windows/win32.h"#include "../rev.h"#include "../blitter/factory.hpp"#include "../network/network.h"#include "../core/math_func.hpp"#include "../core/random_func.hpp"#include "../texteff.hpp"#include "../thread.h"#include "../progress.h"#include "../window_gui.h"#include "../window_func.h"#include "../framerate_type.h"#include "win32_v.h"#include <windows.h>#include <imm.h>#include <mutex>#include <condition_variable>#include <algorithm>#include "../safeguards.h"Go to the source code of this file.
Data Structures | |
| struct | VkMapping |
Typedefs | |
| typedef BOOL(WINAPI * | PFNTRACKMOUSEEVENT) (LPTRACKMOUSEEVENT lpEventTrack) |
Functions | |
| static void | MakePalette () |
| static void | UpdatePalette (HDC dc, uint start, uint count) |
| static uint | MapWindowsKey (uint sym) |
| static bool | AllocateDibSection (int w, int h, bool force=false) |
| static void | ClientSizeChanged (int w, int h) |
| static void CALLBACK | TrackMouseTimerProc (HWND hwnd, UINT msg, UINT_PTR event, DWORD time) |
| static void | PaintWindow (HDC dc) |
| Do palette animation and blit to the window. More... | |
| static void | PaintWindowThread () |
| static LRESULT | HandleCharMsg (uint keycode, WChar charcode) |
| Forward key presses to the window system. More... | |
| static bool | DrawIMECompositionString () |
| Should we draw the composition string ourself, i.e is this a normal IME? | |
| static void | SetCompositionPos (HWND hwnd) |
| Set position of the composition window to the caret position. More... | |
| static void | SetCandidatePos (HWND hwnd) |
| Set the position of the candidate window. More... | |
| static LRESULT | HandleIMEComposition (HWND hwnd, WPARAM wParam, LPARAM lParam) |
| Handle WM_IME_COMPOSITION messages. More... | |
| static void | CancelIMEComposition (HWND hwnd) |
| Clear the current composition string. More... | |
| static LRESULT CALLBACK | WndProcGdi (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) |
| static void | RegisterWndClass () |
| static void | FindResolutions () |
| static void | CheckPaletteAnim () |
Variables | |
| static PFNTRACKMOUSEEVENT | _pTrackMouseEvent = nullptr |
| struct { | |
| HWND main_wnd | |
| HBITMAP dib_sect | |
| void * buffer_bits | |
| HPALETTE gdi_palette | |
| RECT update_rect | |
| int width | |
| int height | |
| int width_org | |
| int height_org | |
| bool fullscreen | |
| bool has_focus | |
| bool running | |
| } | _wnd |
| bool | _force_full_redraw |
| bool | _window_maximize |
| uint | _display_hz |
| static Dimension | _bck_resolution |
| DWORD | _imm_props |
| static bool | _draw_threaded |
| Whether the drawing is/may be done in a separate thread. More... | |
| static std::recursive_mutex * | _draw_mutex = nullptr |
| Mutex to keep the access to the shared memory controlled. More... | |
| static std::condition_variable_any * | _draw_signal = nullptr |
| Signal to draw the next frame. More... | |
| static volatile bool | _draw_continue |
| Should we keep continue drawing? | |
| static Palette | _local_palette |
| Local copy of the palette for use in the drawing thread. More... | |
| static const VkMapping | _vk_mapping [] |
| static const Dimension | default_resolutions [] |
| static FVideoDriver_Win32 | iFVideoDriver_Win32 |
Implementation of the Windows (GDI) video driver.
Definition in file win32_v.cpp.
|
static |
Clear the current composition string.
Definition at line 618 of file win32_v.cpp.
References HandleTextInput().
Referenced by VideoDriver_Win32::EditBoxLostFocus().
|
static |
Forward key presses to the window system.
Definition at line 429 of file win32_v.cpp.
References DEBUG, HandleKeypress(), Utf16DecodeSurrogate(), Utf16IsLeadSurrogate(), and Utf16IsTrailSurrogate().
|
static |
Handle WM_IME_COMPOSITION messages.
Definition at line 554 of file win32_v.cpp.
References convert_from_fs(), DrawIMECompositionString(), FS2OTTD(), HandleTextInput(), lengthof, SetCompositionPos(), and Utf16IsLeadSurrogate().
|
static |
Do palette animation and blit to the window.
Definition at line 360 of file win32_v.cpp.
References PFE_VIDEO.
|
static |
Set the position of the candidate window.
Definition at line 520 of file win32_v.cpp.
References EditBoxInGlobalFocus().
|
static |
Set position of the composition window to the caret position.
Definition at line 498 of file win32_v.cpp.
References EditBoxInGlobalFocus().
Referenced by HandleIMEComposition().
|
static |
Mutex to keep the access to the shared memory controlled.
Definition at line 70 of file win32_v.cpp.
Referenced by VideoDriver_Win32::AcquireBlitterLock(), VideoDriver_Win32::ChangeResolution(), VideoDriver_Win32::EditBoxLostFocus(), VideoDriver_Win32::MainLoop(), VideoDriver_Win32::ReleaseBlitterLock(), and VideoDriver_Win32::ToggleFullscreen().
|
static |
Signal to draw the next frame.
Definition at line 72 of file win32_v.cpp.
Referenced by VideoDriver_Win32::MainLoop().
|
static |
Whether the drawing is/may be done in a separate thread.
Definition at line 68 of file win32_v.cpp.
Referenced by VideoDriver_Win32::MainLoop().
|
static |
Local copy of the palette for use in the drawing thread.
Definition at line 76 of file win32_v.cpp.
|
static |
Definition at line 1071 of file win32_v.cpp.