1212#include < string>
1313#include < utility>
1414
15- // / Klasse für den WinAPI Videotreiber.
1615class VideoWinAPI final : public VideoDriver
1716{
18- // / Treiberaufräumfunktion.
1917 void CleanUp ();
2018
2119public:
2220 VideoWinAPI (VideoDriverLoaderInterface* CallBack);
23-
2421 ~VideoWinAPI ();
2522
26- // / Funktion zum Auslesen des Treibernamens.
23+ // / Return name of driver
2724 const char * GetName () const override ;
2825
29- // / Treiberinitialisierungsfunktion.
26+ // / Initialize the driver, return true on success
3027 bool Initialize () override ;
3128
32- // / Erstellt das Fenster mit entsprechenden Werten.
29+ // / Create window/rendering context with given title, size and display mode, return true on success
3330 bool CreateScreen (const std::string& title, const VideoMode& newSize, DisplayMode displayMode) override ;
3431
35- // / Erstellt oder verändert das Fenster mit entsprechenden Werten.
32+ // / Change window/resolution, return true on success
3633 bool ResizeScreen (const VideoMode& newSize, DisplayMode displayMode) override ;
3734
38- // / Schliesst das Fenster.
35+ // / Close window
3936 void DestroyScreen () override ;
4037
41- // / Wechselt die OpenGL-Puffer.
38+ // / Swap OpenGL buffers
4239 bool SwapBuffers () override ;
4340
44- // / Die Nachrichtenschleife.
41+ // / Process messages/events, return false when the application should quit
4542 bool MessageLoop () override ;
4643
4744 // / Popup Window
4845 void ShowErrorMessage (const std::string& title, const std::string& message) override ;
4946
50- // / Funktion zum Auslesen des TickCounts.
47+ // / Return the current tick count (time since epoch in ms)
5148 unsigned long GetTickCount () const override ;
5249
53- // / Funktion zum Holen einer Subfunktion.
50+ // / Get a pointer to an OpenGL function loader
5451 OpenGL_Loader_Proc GetLoaderFunction () const override ;
5552
56- // / Listet verfügbare Videomodi auf
53+ // / Return supported resolutions
5754 void ListVideoModes (std::vector<VideoMode>& video_modes) const override ;
5855
59- // / Funktion zum Setzen der Mauskoordinaten.
56+ // / Set position of the mouse cursor in screen coordinates
6057 void SetMousePos (Position pos) override ;
6158
6259 // / Get state of the modifier keys
6360 KeyEvent GetModKeyState () const override ;
6461
65- // / Gibt Pointer auf ein Fenster zurück (device-dependent!), HWND unter Windows
62+ // / Get pointer to window (device-dependent!)
6663 void * GetMapPointer () const override ;
6764
6865private:
@@ -74,21 +71,21 @@ class VideoWinAPI final : public VideoDriver
7471 bool InitOGL ();
7572 static bool MakeFullscreen (const VideoMode& resolution);
7673
77- // / Funktion zum Senden einer gedrückten Taste.
74+ // / Callback for pressed character keys
7875 void OnWMChar (unsigned c, bool disablepaste = false , LPARAM lParam = 0 );
7976 void OnWMKeyDown (unsigned c, LPARAM lParam = 0 );
8077
81- // / Funktion zum Pasten von Text aus dem Clipboard.
78+ // / Handle paste from clipboard (CTRL+V)
8279 void OnWMPaste ();
8380
84- // / Callbackfunktion der WinAPI.
81+ // / Window callback function
8582 static LRESULT CALLBACK WindowProc (HWND window, UINT msg, WPARAM wParam, LPARAM lParam);
8683
8784private:
88- int mouse_z; // / Scrolling position for mousewheel .
89- HWND screen; // / Fensterhandle.
90- HDC screen_dc; // / Zeichenkontext des Fensters .
91- HGLRC screen_rc; // / OpenGL-Kontext des Fensters .
85+ int mouse_z; // / Scrolling position for mouse wheel .
86+ HWND screen; // / window handle
87+ HDC screen_dc; // / Draw context of the window .
88+ HGLRC screen_rc; // / OpenGL-context of the window .
9289 bool isDisplayModeChangeable, isMinimized;
9390 std::wstring windowClassName;
9491};
0 commit comments