summaryrefslogtreecommitdiff
path: root/src/video
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-05-02 16:14:23 +0000
committerrubidium <rubidium@openttd.org>2011-05-02 16:14:23 +0000
commit4d5dbf51707c42c24eeafdb65016b079c54adcf2 (patch)
tree0197dcc17f4a8411ecea2223f356019c902fe7b9 /src/video
parente9837ff1ec1326aec622366ae29ff1aa81581daf (diff)
downloadopenttd-4d5dbf51707c42c24eeafdb65016b079c54adcf2.tar.xz
(svn r22410) -Document: some more bits ;)
Diffstat (limited to 'src/video')
-rw-r--r--src/video/allegro_v.h2
-rw-r--r--src/video/dedicated_v.h2
-rw-r--r--src/video/null_v.h4
-rw-r--r--src/video/sdl_v.h2
-rw-r--r--src/video/video_driver.hpp27
-rw-r--r--src/video/win32_v.cpp5
-rw-r--r--src/video/win32_v.h2
7 files changed, 43 insertions, 1 deletions
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<FVideoDriver_Allegro> {
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<FVideoDriver_Dedicated> {
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<FVideoDriver_Null> {
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<FVideoDriver_SDL> {
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 T>
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<FVideoDriver_Win32> {
public:
static const int priority = 10;