ScummVM API documentation
renderer.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GRAPHICS_RENDERER_H
23 #define GRAPHICS_RENDERER_H
24 
25 #include "common/scummsys.h"
26 #include "common/array.h"
27 #include "common/str.h"
28 
29 namespace Graphics {
30 
45 enum RendererType : uint32 {
46  kRendererTypeDefault = 0,
47  kRendererTypeOpenGL = 1,
48  kRendererTypeOpenGLShaders = 2,
49  kRendererTypeTinyGL = 4
50 };
51 
53  const char *code;
54  const char *description;
55  RendererType id;
56 };
57 
58 class Renderer {
59 public:
60  static Common::Array<RendererTypeDescription> listTypes();
61 
63  static RendererType parseTypeCode(const Common::String &code);
64 
66  static Common::String getTypeCode(RendererType type);
67 
69  static uint32 getAvailableTypes();
70 
72  static RendererType getBestMatchingType(RendererType desired, uint32 available);
73 
75  static RendererType getBestMatchingAvailableType(RendererType desired, uint32 supported) {
76  return getBestMatchingType(desired, getAvailableTypes() & supported);
77  }
78 };
80 } // End of namespace Graphics
81 
82 #endif
Definition: str.h:59
static RendererType getBestMatchingAvailableType(RendererType desired, uint32 supported)
Definition: renderer.h:75
RendererType
Definition: renderer.h:45
Definition: array.h:52
Definition: formatinfo.h:28
Definition: renderer.h:58
Definition: renderer.h:52