author | smatz |
Mon, 04 Aug 2008 14:40:50 +0000 | |
changeset 9847 | d1f9d05f76dd |
parent 9533 | e8b86b70c5f6 |
permissions | -rw-r--r-- |
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" |
9533
e8b86b70c5f6
(svn r13537) -Fix [FS#2090](r13523): QSortT won't work this way, use Dimension instead of uint16[2] for resolutions
smatz
parents:
9111
diff
changeset
|
9 |
#include "../core/geometry_type.hpp" |
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
|
10 |
|
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 |
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
|
12 |
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
|
13 |
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
|
14 |
|
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 |
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
|
16 |
|
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 |
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
|
18 |
|
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
|
19 |
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
|
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 |
|
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 |
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
|
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 |
|
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 |
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
|
26 |
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
|
27 |
public: |
7193
d46cbf314baf
(svn r10471) -Codechange: implement driver probing priority so that 'preferred' drivers are loaded first
peter1138
parents:
7170
diff
changeset
|
28 |
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
|
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 |
/** |
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 |
* 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
|
32 |
*/ |
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 |
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
|
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 |
|
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
|
36 |
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
|
37 |
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
|
38 |
extern int _num_resolutions; |
9533
e8b86b70c5f6
(svn r13537) -Fix [FS#2090](r13523): QSortT won't work this way, use Dimension instead of uint16[2] for resolutions
smatz
parents:
9111
diff
changeset
|
39 |
extern Dimension _resolutions[32]; |
e8b86b70c5f6
(svn r13537) -Fix [FS#2090](r13523): QSortT won't work this way, use Dimension instead of uint16[2] for resolutions
smatz
parents:
9111
diff
changeset
|
40 |
extern Dimension _cur_resolution; |
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
|
41 |
|
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
|
42 |
#endif /* VIDEO_VIDEO_DRIVER_HPP */ |