From 4d5dbf51707c42c24eeafdb65016b079c54adcf2 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 2 May 2011 16:14:23 +0000 Subject: (svn r22410) -Document: some more bits ;) --- src/video/allegro_v.h | 2 ++ src/video/dedicated_v.h | 2 ++ src/video/null_v.h | 4 +++- src/video/sdl_v.h | 2 ++ src/video/video_driver.hpp | 27 +++++++++++++++++++++++++++ src/video/win32_v.cpp | 5 +++++ src/video/win32_v.h | 2 ++ 7 files changed, 43 insertions(+), 1 deletion(-) (limited to 'src/video') diff --git a/src/video/allegro_v.h b/src/video/allegro_v.h index a48f17dda..2760cbe46 100644 --- a/src/video/allegro_v.h +++ b/src/video/allegro_v.h @@ -14,6 +14,7 @@ #include "video_driver.hpp" +/** The allegro video driver. */ class VideoDriver_Allegro: public VideoDriver { public: /* virtual */ const char *Start(const char * const *param); @@ -30,6 +31,7 @@ public: /* virtual */ const char *GetName() const { return "allegro"; } }; +/** Factory for the allegro video driver. */ class FVideoDriver_Allegro: public VideoDriverFactory { public: static const int priority = 4; diff --git a/src/video/dedicated_v.h b/src/video/dedicated_v.h index 7fd0c5391..c06f050cd 100644 --- a/src/video/dedicated_v.h +++ b/src/video/dedicated_v.h @@ -14,6 +14,7 @@ #include "video_driver.hpp" +/** The dedicated server video driver. */ class VideoDriver_Dedicated: public VideoDriver { public: /* virtual */ const char *Start(const char * const *param); @@ -30,6 +31,7 @@ public: /* virtual */ const char *GetName() const { return "dedicated"; } }; +/** Factory for the dedicated server video driver. */ class FVideoDriver_Dedicated: public VideoDriverFactory { public: #ifdef DEDICATED diff --git a/src/video/null_v.h b/src/video/null_v.h index f9329d2d6..fa0ff054f 100644 --- a/src/video/null_v.h +++ b/src/video/null_v.h @@ -14,9 +14,10 @@ #include "video_driver.hpp" +/** The null video driver. */ class VideoDriver_Null: public VideoDriver { private: - uint ticks; + uint ticks; ///< Amount of ticks to run. public: /* virtual */ const char *Start(const char * const *param); @@ -33,6 +34,7 @@ public: /* virtual */ const char *GetName() const { return "null"; } }; +/** Factory the null video driver. */ class FVideoDriver_Null: public VideoDriverFactory { public: static const int priority = 0; diff --git a/src/video/sdl_v.h b/src/video/sdl_v.h index 4d2faf9fe..c7f5b84c3 100644 --- a/src/video/sdl_v.h +++ b/src/video/sdl_v.h @@ -14,6 +14,7 @@ #include "video_driver.hpp" +/** The SDL video driver. */ class VideoDriver_SDL: public VideoDriver { public: /* virtual */ const char *Start(const char * const *param); @@ -30,6 +31,7 @@ public: /* virtual */ const char *GetName() const { return "sdl"; } }; +/** Factory for the SDL video driver. */ class FVideoDriver_SDL: public VideoDriverFactory { public: static const int priority = 5; diff --git a/src/video/video_driver.hpp b/src/video/video_driver.hpp index f8defcca2..1e647cb1c 100644 --- a/src/video/video_driver.hpp +++ b/src/video/video_driver.hpp @@ -15,20 +15,47 @@ #include "../driver.h" #include "../core/geometry_type.hpp" +/** The base of all video drivers. */ class VideoDriver: public Driver { public: + /** + * Mark a particular area dirty. + * @param left The left most line of the dirty area. + * @param top The top most line of the dirty area. + * @param width The width of the dirty area. + * @param height The height of the dirty area. + */ virtual void MakeDirty(int left, int top, int width, int height) = 0; + /** + * Perform the actual drawing. + */ virtual void MainLoop() = 0; + /** + * Change the resolution of the window. + * @param w The new width. + * @param h The new height. + * @return True if the change succeeded. + */ virtual bool ChangeResolution(int w, int h) = 0; + /** + * Change the full screen setting. + * @param fullscreen The new setting. + * @return True if the change succeeded. + */ virtual bool ToggleFullscreen(bool fullscreen) = 0; }; +/** Base of the factory for the video drivers. */ class VideoDriverFactoryBase: public DriverFactoryBase { }; +/** + * Factory for the video drivers. + * @tparam T The type of the video factory to register. + */ template class VideoDriverFactory: public VideoDriverFactoryBase { public: diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index 84f1967ff..5fdd3dab6 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -224,6 +224,11 @@ static void CALLBACK TrackMouseTimerProc(HWND hwnd, UINT msg, UINT event, DWORD } } +/** + * Instantiate a new window. + * @param full_screen Whether to make a full screen window or not. + * @return True if the window could be created. + */ bool VideoDriver_Win32::MakeWindow(bool full_screen) { _fullscreen = full_screen; diff --git a/src/video/win32_v.h b/src/video/win32_v.h index 4e267b2ab..3e714b38a 100644 --- a/src/video/win32_v.h +++ b/src/video/win32_v.h @@ -14,6 +14,7 @@ #include "video_driver.hpp" +/** The video driver for windows. */ class VideoDriver_Win32: public VideoDriver { public: /* virtual */ const char *Start(const char * const *param); @@ -32,6 +33,7 @@ public: bool MakeWindow(bool full_screen); }; +/** The factory for Windows' video driver. */ class FVideoDriver_Win32: public VideoDriverFactory { public: static const int priority = 10; -- cgit v1.2.3-54-g00ecf