World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Класс OSWindowFactory

#include <OSWindowFactory.h>

Открытые члены

OSWindowCreate (const char *title, int window_width, int window_height)
 

Закрытые члены

OSWindowCreateSdl2 (const char *title, int window_width, int window_height)
 

Подробное описание

См. определение в файле OSWindowFactory.h строка 4

Методы

◆ Create()

OSWindow * OSWindowFactory::Create ( const char *  title,
int  window_width,
int  window_height 
)

См. определение в файле OSWindowFactory.cpp строка 13

13  {
14  return CreateSdl2(title, window_width, window_height);
15 }

Перекрестные ссылки CreateSdl2().

Используется в Engine::MM7_Initialize().

+ Граф вызовов:
+ Граф вызова функции:

◆ CreateSdl2()

OSWindow * OSWindowFactory::CreateSdl2 ( const char *  title,
int  window_width,
int  window_height 
)
private

См. определение в файле OSWindowFactory.cpp строка 17

17  {
18  auto sdlWindow = SDL_CreateWindow(
19  title,
20  SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
21  window_width, window_height,
23 
24  if (sdlWindow) {
25  auto sdlWindowSurface = SDL_GetWindowSurface(sdlWindow);
26  if (sdlWindowSurface) {
27  return new Sdl2Window(sdlWindow, sdlWindowSurface);
28  } else {
29  SDL_DestroyWindow(sdlWindow);
30  }
31  }
32 
33  return nullptr;
34 }

Перекрестные ссылки SDL_CreateWindow(), SDL_DestroyWindow(), SDL_GetWindowSurface(), SDL_WINDOW_OPENGL и SDL_WINDOW_SHOWN.

Используется в Create().

+ Граф вызовов:
+ Граф вызова функции:

Объявления и описания членов классов находятся в файлах:
Sdl2Window
Definition: Sdl2Window.h:7
OSWindowFactory::CreateSdl2
OSWindow * CreateSdl2(const char *title, int window_width, int window_height)
Definition: OSWindowFactory.cpp:17
SDL_WINDOW_OPENGL
@ SDL_WINDOW_OPENGL
Definition: SDL_video.h:100
SDL_GetWindowSurface
DECLSPEC SDL_Surface *SDLCALL SDL_GetWindowSurface(SDL_Window *window)
Get the SDL surface associated with the window.
SDL_WINDOW_SHOWN
@ SDL_WINDOW_SHOWN
Definition: SDL_video.h:101
SDL_CreateWindow
DECLSPEC SDL_Window *SDLCALL SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
Create a window with the specified position, dimensions, and flags.
SDL_DestroyWindow
DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window *window)
Destroy a window.