Leviathan  0.8.0.0
Leviathan game engine
Leviathan::Graphics Class Reference

#include <Graphics.h>

+ Inheritance diagram for Leviathan::Graphics:

Public Member Functions

DLLEXPORT Graphics ()
 
DLLEXPORT ~Graphics ()
 
DLLEXPORT bool Init (AppDef *appdef)
 
DLLEXPORT void Release ()
 
DLLEXPORT bool Frame ()
 
virtual bool frameRenderingQueued (const Ogre::FrameEvent &evt)
 
DLLEXPORT AppDefGetDefinitionObject ()
 
DLLEXPORT Ogre::Root * GetOgreRoot ()
 

Static Public Member Functions

static DLLEXPORT GraphicsGet ()
 

Detailed Description

Definition at line 12 of file Graphics.h.

Constructor & Destructor Documentation

◆ Graphics()

DLLEXPORT Leviathan::Graphics::Graphics ( )

Definition at line 57 of file Graphics.cpp.

58 {
59 
60  Staticaccess = this;
61 }

◆ ~Graphics()

Graphics::~Graphics ( )

Definition at line 63 of file Graphics.cpp.

63 {}

Member Function Documentation

◆ Frame()

DLLEXPORT bool Leviathan::Graphics::Frame ( )

Definition at line 419 of file Graphics.cpp.

420 {
421 
422  // all windows should already be updated //
423  return ORoot->renderOneFrame();
424 }

◆ frameRenderingQueued()

bool Leviathan::Graphics::frameRenderingQueued ( const Ogre::FrameEvent &  evt)
virtual

Definition at line 426 of file Graphics.cpp.

427 {
428 
429  // TODO: check can we try to Tick here
430 
431  return true;
432 }

◆ Get()

Graphics * Graphics::Get ( )
static

Definition at line 65 of file Graphics.cpp.

66 {
67  return Staticaccess;
68 }

◆ GetDefinitionObject()

DLLEXPORT AppDef* Leviathan::Graphics::GetDefinitionObject ( )
inline

Definition at line 26 of file Graphics.h.

27  {
28  return AppDefinition;
29  }

◆ GetOgreRoot()

DLLEXPORT Ogre::Root* Leviathan::Graphics::GetOgreRoot ( )
inline

Definition at line 30 of file Graphics.h.

31  {
32  return ORoot.get();
33  }

◆ Init()

bool Graphics::Init ( AppDef appdef)

Definition at line 72 of file Graphics.cpp.

73 {
74 
75  // save definition pointer //
76  AppDefinition = appdef;
77 
78  // create ogre renderer //
79  if(!InitializeOgre(AppDefinition)) {
80 
81  Logger::Get()->Error("Graphics: Init: failed to create ogre renderer");
82  return false;
83  }
84 
85 #ifdef __linux
86  // Set X11 error handler to not crash on non-fatal errors
87  XSetErrorHandler(LeviathanX11ErrorHandler);
88 #endif
89 
90  Initialized = true;
91  return true;
92 }
static DLLEXPORT Logger * Get()
Definition: Logger.cpp:106
DLLEXPORT void Error(const std::string &data) override
Definition: Logger.cpp:177

◆ Release()

DLLEXPORT void Leviathan::Graphics::Release ( )

Definition at line 94 of file Graphics.cpp.

95 {
96  ORoot.reset();
97 
98  if(Initialized) {
99 
100  SDL_Quit();
101  }
102 
103  Initialized = false;
104 }

The documentation for this class was generated from the following files: