src/video/video_driver.hpp
author rubidium
Sun, 25 May 2008 19:17:03 +0000
changeset 9354 845e07db4549
parent 9111 48ce04029fe4
child 9533 e8b86b70c5f6
permissions -rw-r--r--
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
-Codechange: move all Settings into substructs of _settings in a way that they are logically grouped.
7170
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
     1
/* $Id$ */
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
     2
9111
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 8275
diff changeset
     3
/** @file video_driver.hpp Base of all video drivers. */
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 8275
diff changeset
     4
7170
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
     5
#ifndef VIDEO_VIDEO_DRIVER_HPP
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
     6
#define VIDEO_VIDEO_DRIVER_HPP
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
     7
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
     8
#include "../driver.h"
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
     9
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    10
class VideoDriver: public Driver {
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    11
public:
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    12
	virtual void MakeDirty(int left, int top, int width, int height) = 0;
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    13
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    14
	virtual void MainLoop() = 0;
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    15
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    16
	virtual bool ChangeResolution(int w, int h) = 0;
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    17
8171
3fb9d1f8ac3b (svn r11734) -Change: Allow ToggleFullScreen to return the result of the operation' attempt. Previously, only visual clues were available.
belugas
parents: 7193
diff changeset
    18
	virtual bool ToggleFullscreen(bool fullscreen) = 0;
7170
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    19
};
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    20
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    21
class VideoDriverFactoryBase: public DriverFactoryBase {
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    22
};
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    23
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    24
template <class T>
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    25
class VideoDriverFactory: public VideoDriverFactoryBase {
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    26
public:
7193
d46cbf314baf (svn r10471) -Codechange: implement driver probing priority so that 'preferred' drivers are loaded first
peter1138
parents: 7170
diff changeset
    27
	VideoDriverFactory() { this->RegisterDriver(((T *)this)->GetName(), Driver::DT_VIDEO, ((T *)this)->priority); }
7170
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    28
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    29
	/**
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    30
	 * Get the long, human readable, name for the Driver-class.
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    31
	 */
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    32
	const char *GetName();
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    33
};
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    34
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    35
extern VideoDriver *_video_driver;
8275
f17d0c863ee3 (svn r11839) -Codechange: move some variables from variables.h to a more logical location.
rubidium
parents: 8171
diff changeset
    36
extern char _ini_videodriver[32];
f17d0c863ee3 (svn r11839) -Codechange: move some variables from variables.h to a more logical location.
rubidium
parents: 8171
diff changeset
    37
extern int _num_resolutions;
f17d0c863ee3 (svn r11839) -Codechange: move some variables from variables.h to a more logical location.
rubidium
parents: 8171
diff changeset
    38
extern uint16 _resolutions[32][2];
f17d0c863ee3 (svn r11839) -Codechange: move some variables from variables.h to a more logical location.
rubidium
parents: 8171
diff changeset
    39
extern uint16 _cur_resolution[2];
7170
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    40
923946ec324f (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff changeset
    41
#endif /* VIDEO_VIDEO_DRIVER_HPP */