World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
IRenderFactory.cpp
См. документацию.
2 
6 #ifdef _WINDOWS
8 #endif
9 
13 
14 std::shared_ptr<IRender> IRenderFactory::Create(const std::string &renderer_name, bool is_fullscreen) {
15  IRenderConfigFactory renderConfigFactory;
16  auto config = renderConfigFactory.Create(renderer_name, is_fullscreen);
17 
18  std::shared_ptr<IRender> renderer;
19  switch (config->renderer_type) {
20 #ifdef _WINDOWS
22  renderer = std::make_shared<Render>();
23  break;
24 #endif
25 
27  renderer = std::make_shared<RenderOpenGL>();
28  break;
29  }
30  if (renderer) {
31  if (renderer->Configure(config)) {
32  return renderer;
33  }
34  }
35 
36  return nullptr;
37 }
Graphics::IRenderConfigFactory::Create
std::shared_ptr< IRenderConfig > Create(const std::string &renderer_name, bool is_fullscreen)
Definition: IRenderConfigFactory.cpp:15
IRenderConfigFactory.h
Graphics::RendererType::OpenGl
@ OpenGl
RenderOpenGL.h
IRenderFactory.h
Graphics::IRenderConfig
Definition: IRenderConfig.h:12
Render.h
Graphics::IRenderFactory
Definition: IRenderFactory.h:9
string
GLsizei const GLchar *const * string
Definition: SDL_opengl_glext.h:691
Graphics::IRenderConfigFactory
Definition: IRenderConfigFactory.h:10
config
EGLConfig config
Definition: SDL_egl.h:1149
IRenderConfig.h
Graphics::RendererType::DirectDraw
@ DirectDraw