32 #ifndef AGS_ENGINE_GFX_GFX_DRIVER_FACTORY_BASE_H 33 #define AGS_ENGINE_GFX_GFX_DRIVER_FACTORY_BASE_H 35 #include "common/std/vector.h" 36 #include "ags/engine/gfx/gfx_driver_factory.h" 37 #include "ags/engine/gfx/gfxfilter.h" 43 template <
class TGfxDriverClass,
class TGfxFilterClass>
51 void Shutdown()
override {
57 _driver = EnsureDriverCreated();
61 void DestroyDriver()
override {
67 TGfxDriverClass *driver = EnsureDriverCreated();
69 filter_error =
"Graphics driver was not created";
73 const int color_depth = driver->GetDisplayMode().ColorDepth;
74 if (color_depth == 0) {
75 filter_error =
"Graphics mode is not set";
81 filter_error =
"Filter does not exist";
85 if (!filter->Initialize(color_depth, filter_error)) {
89 driver->SetGraphicsFilter(filter);
98 virtual TGfxDriverClass *EnsureDriverCreated() = 0;
99 virtual TGfxFilterClass *CreateFilter(
const String &
id) = 0;
101 TGfxDriverClass *_driver;
Definition: achievements_tables.h:27
Definition: gfx_driver_factory_base.h:44
Definition: graphics_driver.h:98
Definition: gfx_driver_factory.h:51