| author | smatz |
| Sun, 15 Jun 2008 13:52:51 +0000 | |
| changeset 10966 | 3de9939c8a91 |
| parent 10429 | 1b99254f9607 |
| child 10983 | e734f891d1f6 |
| permissions | -rw-r--r-- |
|
7666
a5fccd76176a
(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$ */ |
|
a5fccd76176a
(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 |
|
|
10429
1b99254f9607
(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:
8771
diff
changeset
|
3 |
/** @file video_driver.hpp Base of all video drivers. */ |
|
1b99254f9607
(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:
8771
diff
changeset
|
4 |
|
|
7666
a5fccd76176a
(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 |
|
a5fccd76176a
(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 |
|
a5fccd76176a
(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 |
|
|
a5fccd76176a
(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" |
|
a5fccd76176a
(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 |
|
|
a5fccd76176a
(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 {
|
|
a5fccd76176a
(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: |
|
a5fccd76176a
(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; |
|
a5fccd76176a
(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 |
|
|
a5fccd76176a
(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; |
|
a5fccd76176a
(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 |
|
|
a5fccd76176a
(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; |
|
a5fccd76176a
(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 |
|
|
8667
c916a5375166
(svn r11734) -Change: Allow ToggleFullScreen to return the result of the operation' attempt. Previously, only visual clues were available.
belugas
parents:
7689
diff
changeset
|
18 |
virtual bool ToggleFullscreen(bool fullscreen) = 0; |
|
7666
a5fccd76176a
(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 |
}; |
|
a5fccd76176a
(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 |
|
|
a5fccd76176a
(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 {
|
|
a5fccd76176a
(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 |
}; |
|
a5fccd76176a
(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 |
|
|
a5fccd76176a
(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> |
|
a5fccd76176a
(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 {
|
|
a5fccd76176a
(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: |
|
7689
011afceb33b5
(svn r10471) -Codechange: implement driver probing priority so that 'preferred' drivers are loaded first
peter1138
parents:
7666
diff
changeset
|
27 |
VideoDriverFactory() { this->RegisterDriver(((T *)this)->GetName(), Driver::DT_VIDEO, ((T *)this)->priority); }
|
|
7666
a5fccd76176a
(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 |
|
|
a5fccd76176a
(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 |
/** |
|
a5fccd76176a
(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. |
|
a5fccd76176a
(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 |
*/ |
|
a5fccd76176a
(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(); |
|
a5fccd76176a
(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 |
}; |
|
a5fccd76176a
(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 |
|
|
a5fccd76176a
(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; |
|
8771
f7ad4dba14bf
(svn r11839) -Codechange: move some variables from variables.h to a more logical location.
rubidium
parents:
8667
diff
changeset
|
36 |
extern char _ini_videodriver[32]; |
|
f7ad4dba14bf
(svn r11839) -Codechange: move some variables from variables.h to a more logical location.
rubidium
parents:
8667
diff
changeset
|
37 |
extern int _num_resolutions; |
|
f7ad4dba14bf
(svn r11839) -Codechange: move some variables from variables.h to a more logical location.
rubidium
parents:
8667
diff
changeset
|
38 |
extern uint16 _resolutions[32][2]; |
|
f7ad4dba14bf
(svn r11839) -Codechange: move some variables from variables.h to a more logical location.
rubidium
parents:
8667
diff
changeset
|
39 |
extern uint16 _cur_resolution[2]; |
|
7666
a5fccd76176a
(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 |
|
|
a5fccd76176a
(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 */ |