Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros
WindowsPlatform.cs
Go to the documentation of this file.
1using System;
3using SDL2;
4
5namespace ReLogic.OS.Windows;
6
7internal class WindowsPlatform : Platform
8{
10
11 private bool _disposedValue;
12
14 : base(PlatformType.Windows)
15 {
16 RegisterService((IClipboard)new Clipboard());
17 RegisterService((IPathService)new PathService());
18 RegisterService((IWindowService)new WindowService());
19 RegisterService((IImeService)new UnsupportedPlatformIme());
20 }
21
22 public override void InitializeClientServices(IntPtr windowHandle)
23 {
24 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
25 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
26 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
27 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
28 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
29 SDL_SysWMinfo info = default(SDL_SysWMinfo);
30 SDL.SDL_VERSION(ref info.version);
31 SDL.SDL_GetWindowWMInfo(windowHandle, ref info);
32 windowHandle = info.info.win.window;
33 if (_wndProcHook == null)
34 {
35 _wndProcHook = new WindowsMessageHook(windowHandle);
36 }
37 RegisterService((IImeService)new WinImm32Ime(_wndProcHook, windowHandle));
38 }
39
40 protected override void Dispose(bool disposing)
41 {
42 if (!_disposedValue)
43 {
44 if (disposing && _wndProcHook != null)
45 {
47 _wndProcHook = null;
48 }
49 _disposedValue = true;
50 base.Dispose(disposing);
51 }
52 }
53}
virtual void Dispose(bool disposing)
override void InitializeClientServices(IntPtr windowHandle)
override void Dispose(bool disposing)