OSDN Git Service

src初コミット
[yurina/yurina.git] / src / core / graphic / WinMonitor.h
diff --git a/src/core/graphic/WinMonitor.h b/src/core/graphic/WinMonitor.h
new file mode 100755 (executable)
index 0000000..05076fd
--- /dev/null
@@ -0,0 +1,46 @@
+/*\r
+ *     “yurina”: yurina unpretentious renderer is not an anathema\r
+ *\r
+ *     This software is distributed under a BSD-style license.\r
+ *     See license.txt for more information.\r
+ */\r
+\r
+#pragma once\r
+\r
+#if defined( _WIN32 ) || defined( _WIN64 )\r
+\r
+#include <fltk/Monitor.h>\r
+#include <windows.h>\r
+\r
+namespace yurina\r
+{\r
+       /**\r
+        *      Windows環境におけるモニタ(ディスプレイ).\r
+        */\r
+       class WinMonitor : private fltk::Monitor\r
+       {\r
+       public:\r
+               /** デバイスモード.*/\r
+               class Mode\r
+               {\r
+                       friend class WinMonitor;\r
+               private:\r
+                       DEVMODE dm;\r
+               public:\r
+                       Mode( int width, int height, int depth );\r
+                       inline int getWidth( void ) const { return dm.dmPelsWidth; }\r
+                       inline int getHeight( void ) const { return dm.dmPelsHeight; }\r
+                       inline int getDepth( void ) const { return dm.dmBitsPerPel; }\r
+                       inline int getRefreshRate( void ) const { return dm.dmDisplayFrequency; }\r
+               };\r
+       public:\r
+               WinMonitor( void );\r
+               ~WinMonitor( void );\r
+               void getOptimumMode( Mode &optimum, const Mode &request ) const;\r
+               bool changeMode( Mode &request );\r
+       private:\r
+       };\r
+}\r
+\r
+#endif\r
+\r