(svn r22410) -Document: some more bits ;)

This commit is contained in:
rubidium
2011-05-02 16:14:23 +00:00
parent 480c1bd9e0
commit eb2197f4c8
51 changed files with 241 additions and 39 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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:

View File

@@ -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;

View File

@@ -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;