World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
IRenderFactory.cpp
См. документацию.
1
#include "
Engine/Graphics/IRenderFactory.h
"
2
3
#include "
Engine/Graphics/IRenderConfig.h
"
4
#include "
Engine/Graphics/IRenderConfigFactory.h
"
5
#include "
Engine/Graphics/OpenGL/RenderOpenGL.h
"
6
#ifdef _WINDOWS
7
#include "
Engine/Graphics/Direct3D/Render.h
"
8
#endif
9
10
using
Graphics::IRenderFactory
;
11
using
Graphics::IRenderConfig
;
12
using
Graphics::IRenderConfigFactory
;
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
21
case
RendererType::DirectDraw
:
22
renderer = std::make_shared<Render>();
23
break
;
24
#endif
25
26
case
RendererType::OpenGl
:
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
Engine
Graphics
IRenderFactory.cpp
Документация по World of Might and Magic. Последние изменения: Вт 7 Апр 2020 22:03:29. Создано системой
1.8.17