ScummVM API documentation
gfx_driver_factory.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 //=============================================================================
23 //
24 // Graphics driver factory interface
25 //
26 // Graphics factory is supposed to be singleton. Factory implementation must
27 // guarantee that it may be created and destroyed any number of times during
28 // program execution.
29 //
30 //=============================================================================
31 
32 #ifndef AGS_ENGINE_GFX_GFX_DRIVER_FACTORY_H
33 #define AGS_ENGINE_GFX_GFX_DRIVER_FACTORY_H
34 
35 #include "common/std/memory.h"
36 #include "ags/shared/util/string.h"
37 #include "ags/shared/util/string_types.h"
38 
39 namespace AGS3 {
40 namespace AGS {
41 namespace Engine {
42 
43 using Shared::String;
44 using Shared::StringV;
45 class IGraphicsDriver;
46 class IGfxFilter;
47 struct GfxFilterInfo;
48 typedef std::shared_ptr<IGfxFilter> PGfxFilter;
49 
50 
52 public:
53  virtual ~IGfxDriverFactory() {
54  }
55 
56  // Shutdown graphics factory and deallocate any resources it owns;
57  // graphics factory will be unusable after calling this function.
58  virtual void Shutdown() = 0;
59  // Get graphics driver associated with this factory; creates one if
60  // it does not exist.
61  virtual IGraphicsDriver *GetDriver() = 0;
62  // Destroy graphics driver associated with this factory; does nothing
63  // if one was not created yet,
64  virtual void DestroyDriver() = 0;
65 
66  // Get number of supported filters
67  virtual size_t GetFilterCount() const = 0;
68  // Get filter description
69  virtual const GfxFilterInfo *GetFilterInfo(size_t index) const = 0;
70  // Get ID of the default filter
71  virtual String GetDefaultFilterID() const = 0;
72 
73  // Assign specified filter to graphics driver
74  virtual PGfxFilter SetFilter(const String &id, String &filter_error) = 0;
75 };
76 
77 // Query the available graphics factory names
78 void GetGfxDriverFactoryNames(StringV &ids);
79 // Acquire the graphics factory singleton object by its id
80 IGfxDriverFactory *GetGfxDriverFactory(const String id);
81 
82 } // namespace Engine
83 } // namespace AGS
84 } // namespace AGS3
85 
86 #endif
Definition: achievements_tables.h:27
Definition: gfxfilter.h:41
Definition: graphics_driver.h:98
Definition: string.h:62
Definition: ptr.h:159
Definition: gfx_driver_factory.h:51
Definition: engine.h:144
Definition: ags.h:40