Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
cqsp::engine::Application Class Reference

#include <application.h>

Classes

class  CqspEventInstancer
 
class  CqspEventListener
 

Public Types

typedef void(* EventListener) (Rml::Event &)
 

Public Member Functions

 Application (int _argc, char *_argv[])
 
void run ()
 
client::ClientOptionsGetClientOptions ()
 
int GetWindowHeight () const
 
int GetWindowWidth () const
 
double GetDeltaTime () const
 
double GetFps () const
 
cqsp::asset::AssetManagerGetAssetManager ()
 
bool ShouldExit ()
 
void ExitApplication ()
 
template<class T >
void SetScene ()
 
cqsp::engine::GameStateGetGame ()
 
cqsp::engine::audio::IAudioInterfaceGetAudioInterface ()
 
bool ButtonIsHeld (int btn)
 
bool ButtonIsHeld (KeyInput btn)
 
bool ButtonIsReleased (int btn)
 
bool ButtonIsReleased (KeyInput btn)
 
bool ButtonIsPressed (int btn)
 
bool ButtonIsPressed (KeyInput btn)
 
double MouseButtonLastReleased (int btn)
 
bool MouseButtonDoubleClicked (int btn)
 
double GetScrollAmount ()
 
double GetMouseX ()
 
double GetMouseY ()
 
bool MouseButtonIsHeld (int btn)
 
bool MouseButtonIsReleased (int btn)
 
bool MouseButtonIsPressed (int btn)
 
Rml::ElementDocument * LoadDocument (const std::string &path)
 
void CloseDocument (const std::string &path)
 
Rml::ElementDocument * ReloadDocument (const std::string &path)
 Reloads the document from the file How to hotload the a document. More...
 
WindowGetWindow ()
 
cqsp::asset::Font *& GetFont ()
 
void DrawText (const std::string &text, float x, float y)
 
void DrawText (const std::string &text, const glm::vec3 &color, float x, float y)
 
void DrawText (const std::string &text, float x, float y, float size)
 
void DrawText (const std::string &text, const glm::vec3 &color, float x, float y, float size)
 
void DrawTextNormalized (const std::string &text, float x, float y)
 
void SetFont (cqsp::asset::Font *font)
 
void SetFontShader (cqsp::asset::ShaderProgram *shader)
 
double GetTime ()
 Time since glfw was initialized in seconds More...
 
bool MouseDragged ()
 
void SetWindowDimensions (int width, int height)
 
void SetFullScreen (bool screen)
 
glm::mat4 Get2DProj ()
 
glm::mat4 Get3DProj ()
 
glm::mat4 GetRmlUiProj ()
 
std::vector< std::string > & GetCmdLineArgs ()
 
bool HasCmdLineArgs (const std::string &arg)
 
bool Screenshot (const char *path=NULL)
 Screenshots the current framebuffer to the filename More...
 
Rml::Context * GetRmlUiContext ()
 
template<class T >
void InitGame ()
 

Private Member Functions

void InitFonts ()
 
void SetIcon ()
 
void GlInit ()
 
void LoggerInit ()
 
void LogInfo ()
 
void InitRmlUi ()
 
void InitImgui ()
 
void ProcessRmlUiUserInput ()
 
void InitAudio ()
 
int init ()
 
void ResetGame ()
 
int destroy ()
 
void CalculateProjections ()
 

Private Attributes

std::vector< std::string > cmd_line_args
 
bool full_screen
 
Windowm_window
 
std::string icon_path
 
Rml::Context * rml_context
 
std::unique_ptr< SystemInterface_GLFWm_system_interface
 
std::unique_ptr< Rml::RenderInterface > m_render_interface
 
ax::NodeEditor::EditorContext * m_ne_context = nullptr
 
std::unique_ptr< CqspEventInstancerm_event_instancer
 
cqsp::engine::SceneManager m_scene_manager
 
client::ClientOptions m_client_options
 
double fps
 
double deltaTime
 
double lastFrame
 
std::string locale
 
cqsp::asset::AssetManager manager
 
std::unique_ptr< cqsp::engine::GameStatem_game
 
cqsp::asset::Fontm_font = nullptr
 
cqsp::asset::ShaderProgramfontShader = nullptr
 
std::map< std::string, std::string > properties
 
cqsp::engine::audio::IAudioInterfacem_audio_interface
 
std::map< std::string, Rml::ElementDocument * > loaded_documents
 
glm::mat4 two_dim_projection
 
glm::mat4 three_dim_projection
 
glm::mat4 rmlui_projection
 
bool to_halt
 
bool draw_fps = false
 

Member Typedef Documentation

◆ EventListener

typedef void(* cqsp::engine::Application::EventListener) (Rml::Event &)

Constructor & Destructor Documentation

◆ Application()

cqsp::engine::Application::Application ( int  _argc,
char *  _argv[] 
)

Member Function Documentation

◆ ButtonIsHeld() [1/2]

bool cqsp::engine::Application::ButtonIsHeld ( int  btn)
inline

◆ ButtonIsHeld() [2/2]

bool cqsp::engine::Application::ButtonIsHeld ( KeyInput  btn)
inline

◆ ButtonIsPressed() [1/2]

bool cqsp::engine::Application::ButtonIsPressed ( int  btn)
inline

◆ ButtonIsPressed() [2/2]

bool cqsp::engine::Application::ButtonIsPressed ( KeyInput  btn)
inline

◆ ButtonIsReleased() [1/2]

bool cqsp::engine::Application::ButtonIsReleased ( int  btn)
inline

◆ ButtonIsReleased() [2/2]

bool cqsp::engine::Application::ButtonIsReleased ( KeyInput  btn)
inline

◆ CalculateProjections()

void cqsp::engine::Application::CalculateProjections ( )
private

◆ CloseDocument()

void cqsp::engine::Application::CloseDocument ( const std::string &  path)

◆ destroy()

int cqsp::engine::Application::destroy ( )
private

◆ DrawText() [1/4]

void cqsp::engine::Application::DrawText ( const std::string &  text,
const glm::vec3 &  color,
float  x,
float  y 
)

◆ DrawText() [2/4]

void cqsp::engine::Application::DrawText ( const std::string &  text,
const glm::vec3 &  color,
float  x,
float  y,
float  size 
)

◆ DrawText() [3/4]

void cqsp::engine::Application::DrawText ( const std::string &  text,
float  x,
float  y 
)

◆ DrawText() [4/4]

void cqsp::engine::Application::DrawText ( const std::string &  text,
float  x,
float  y,
float  size 
)

◆ DrawTextNormalized()

void cqsp::engine::Application::DrawTextNormalized ( const std::string &  text,
float  x,
float  y 
)

◆ ExitApplication()

void cqsp::engine::Application::ExitApplication ( )

◆ Get2DProj()

glm::mat4 cqsp::engine::Application::Get2DProj ( )
inline

◆ Get3DProj()

glm::mat4 cqsp::engine::Application::Get3DProj ( )
inline

◆ GetAssetManager()

cqsp::asset::AssetManager & cqsp::engine::Application::GetAssetManager ( )
inline

◆ GetAudioInterface()

cqsp::engine::audio::IAudioInterface & cqsp::engine::Application::GetAudioInterface ( )
inline

◆ GetClientOptions()

client::ClientOptions & cqsp::engine::Application::GetClientOptions ( )
inline

◆ GetCmdLineArgs()

std::vector< std::string > & cqsp::engine::Application::GetCmdLineArgs ( )
inline

◆ GetDeltaTime()

double cqsp::engine::Application::GetDeltaTime ( ) const
inline

◆ GetFont()

cqsp::asset::Font *& cqsp::engine::Application::GetFont ( )
inline

◆ GetFps()

double cqsp::engine::Application::GetFps ( ) const
inline

◆ GetGame()

cqsp::engine::GameState * cqsp::engine::Application::GetGame ( )
inline

◆ GetMouseX()

double cqsp::engine::Application::GetMouseX ( )
inline

◆ GetMouseY()

double cqsp::engine::Application::GetMouseY ( )
inline

◆ GetRmlUiContext()

Rml::Context * cqsp::engine::Application::GetRmlUiContext ( )
inline

◆ GetRmlUiProj()

glm::mat4 cqsp::engine::Application::GetRmlUiProj ( )
inline

◆ GetScrollAmount()

double cqsp::engine::Application::GetScrollAmount ( )
inline

◆ GetTime()

double cqsp::engine::Application::GetTime ( )

Time since glfw was initialized in seconds

Returns

◆ GetWindow()

Window * cqsp::engine::Application::GetWindow ( )
inline

◆ GetWindowHeight()

int cqsp::engine::Application::GetWindowHeight ( ) const
inline

◆ GetWindowWidth()

int cqsp::engine::Application::GetWindowWidth ( ) const
inline

◆ GlInit()

void cqsp::engine::Application::GlInit ( )
private

◆ HasCmdLineArgs()

bool cqsp::engine::Application::HasCmdLineArgs ( const std::string &  arg)
inline

◆ init()

int cqsp::engine::Application::init ( )
private

◆ InitAudio()

void cqsp::engine::Application::InitAudio ( )
private

◆ InitFonts()

void cqsp::engine::Application::InitFonts ( )
private

◆ InitGame()

template<class T >
void cqsp::engine::Application::InitGame ( )
inline

◆ InitImgui()

void cqsp::engine::Application::InitImgui ( )
private

◆ InitRmlUi()

void cqsp::engine::Application::InitRmlUi ( )
private

◆ LoadDocument()

Rml::ElementDocument * cqsp::engine::Application::LoadDocument ( const std::string &  path)

◆ LoggerInit()

void cqsp::engine::Application::LoggerInit ( )
private

◆ LogInfo()

void cqsp::engine::Application::LogInfo ( )
private

◆ MouseButtonDoubleClicked()

bool cqsp::engine::Application::MouseButtonDoubleClicked ( int  btn)
inline

◆ MouseButtonIsHeld()

bool cqsp::engine::Application::MouseButtonIsHeld ( int  btn)
inline

◆ MouseButtonIsPressed()

bool cqsp::engine::Application::MouseButtonIsPressed ( int  btn)
inline

◆ MouseButtonIsReleased()

bool cqsp::engine::Application::MouseButtonIsReleased ( int  btn)
inline

◆ MouseButtonLastReleased()

double cqsp::engine::Application::MouseButtonLastReleased ( int  btn)
inline

◆ MouseDragged()

bool cqsp::engine::Application::MouseDragged ( )
inline

◆ ProcessRmlUiUserInput()

void cqsp::engine::Application::ProcessRmlUiUserInput ( )
private

◆ ReloadDocument()

Rml::ElementDocument * cqsp::engine::Application::ReloadDocument ( const std::string &  path)

Reloads the document from the file How to hotload the a document.

Approximately how to use it After loading it with app.LoadDocument(), you can reload it, and remember to set the document variable that you may have, or it will be pointing to something empty.

Parameters
path
Returns

◆ ResetGame()

void cqsp::engine::Application::ResetGame ( )
inlineprivate

◆ run()

void cqsp::engine::Application::run ( )

◆ Screenshot()

bool cqsp::engine::Application::Screenshot ( const char *  path = NULL)

Screenshots the current framebuffer to the filename

If it's null, it will put the screenshot into the default folder, with

Parameters
path

◆ SetFont()

void cqsp::engine::Application::SetFont ( cqsp::asset::Font font)
inline

◆ SetFontShader()

void cqsp::engine::Application::SetFontShader ( cqsp::asset::ShaderProgram shader)
inline

◆ SetFullScreen()

void cqsp::engine::Application::SetFullScreen ( bool  screen)

◆ SetIcon()

void cqsp::engine::Application::SetIcon ( )
private

◆ SetScene()

template<class T >
void cqsp::engine::Application::SetScene ( )
inline

◆ SetWindowDimensions()

void cqsp::engine::Application::SetWindowDimensions ( int  width,
int  height 
)

◆ ShouldExit()

bool cqsp::engine::Application::ShouldExit ( )

Member Data Documentation

◆ cmd_line_args

std::vector<std::string> cqsp::engine::Application::cmd_line_args
private

◆ deltaTime

double cqsp::engine::Application::deltaTime
private

◆ draw_fps

bool cqsp::engine::Application::draw_fps = false
private

◆ fontShader

cqsp::asset::ShaderProgram* cqsp::engine::Application::fontShader = nullptr
private

◆ fps

double cqsp::engine::Application::fps
private

◆ full_screen

bool cqsp::engine::Application::full_screen
private

◆ icon_path

std::string cqsp::engine::Application::icon_path
private

◆ lastFrame

double cqsp::engine::Application::lastFrame
private

◆ loaded_documents

std::map<std::string, Rml::ElementDocument*> cqsp::engine::Application::loaded_documents
private

◆ locale

std::string cqsp::engine::Application::locale
private

◆ m_audio_interface

cqsp::engine::audio::IAudioInterface* cqsp::engine::Application::m_audio_interface
private

◆ m_client_options

client::ClientOptions cqsp::engine::Application::m_client_options
private

◆ m_event_instancer

std::unique_ptr<CqspEventInstancer> cqsp::engine::Application::m_event_instancer
private

◆ m_font

cqsp::asset::Font* cqsp::engine::Application::m_font = nullptr
private

◆ m_game

std::unique_ptr<cqsp::engine::GameState> cqsp::engine::Application::m_game
private

◆ m_ne_context

ax::NodeEditor::EditorContext* cqsp::engine::Application::m_ne_context = nullptr
private

◆ m_render_interface

std::unique_ptr<Rml::RenderInterface> cqsp::engine::Application::m_render_interface
private

◆ m_scene_manager

cqsp::engine::SceneManager cqsp::engine::Application::m_scene_manager
private

◆ m_system_interface

std::unique_ptr<SystemInterface_GLFW> cqsp::engine::Application::m_system_interface
private

◆ m_window

Window* cqsp::engine::Application::m_window
private

◆ manager

cqsp::asset::AssetManager cqsp::engine::Application::manager
private

◆ properties

std::map<std::string, std::string> cqsp::engine::Application::properties
private

◆ rml_context

Rml::Context* cqsp::engine::Application::rml_context
private

◆ rmlui_projection

glm::mat4 cqsp::engine::Application::rmlui_projection
private

◆ three_dim_projection

glm::mat4 cqsp::engine::Application::three_dim_projection
private

◆ to_halt

bool cqsp::engine::Application::to_halt
private

◆ two_dim_projection

glm::mat4 cqsp::engine::Application::two_dim_projection
private

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