OpenRaider  0.1.4-dev
Open Source Tomb Raider Game Engine implementation
Static Public Member Functions | Static Private Attributes | List of all members
UI Class Reference

#include <UI.h>

Collaboration diagram for UI:
[legend]

Static Public Member Functions

static int initialize ()
 
static void eventsFinished ()
 
static void display ()
 
static void shutdown ()
 
static void setSize (glm::i32vec2 s)
 
static void setVisible (bool v)
 
static bool isVisible ()
 
static void handleKeyboard (KeyboardButton key, bool pressed)
 
static void handleText (char *text, bool notFinished)
 
static void handleMouseClick (unsigned int x, unsigned int y, KeyboardButton button, bool released)
 
static void handleMouseMotion (int xrel, int yrel, int xabs, int yabs)
 
static void handleMouseScroll (int xrel, int yrel)
 
static void handleControllerAxis (float value, KeyboardButton axis)
 
static void handleControllerButton (KeyboardButton button, bool released)
 
static void renderImGui (ImDrawList **const draw_lists, int count)
 

Static Private Attributes

static bool visible = false
 
static unsigned int fontTex
 
static std::string iniFilename
 
static std::string logFilename
 
static bool metaKeyIsActive = false
 
static std::list< std::tuple< KeyboardButton, bool > > keyboardEvents
 
static std::list< std::tuple< unsigned int, unsigned int, KeyboardButton, bool > > clickEvents
 
static std::list< std::tuple< int, int, int, int > > motionEvents
 
static std::list< std::tuple< int, int > > scrollEvents
 
static Shader imguiShader
 
static const char * imguiShaderVertex
 
static const char * imguiShaderFragment
 

Detailed Description

Definition at line 22 of file UI.h.

Member Function Documentation

int UI::initialize ( )
static
FIXME:
allow loading other TTF fonts

Definition at line 44 of file UI.cpp.

void UI::eventsFinished ( )
static

Definition at line 147 of file UI.cpp.

void UI::display ( )
static

Definition at line 220 of file UI.cpp.

void UI::shutdown ( )
static

Definition at line 351 of file UI.cpp.

void UI::setSize ( glm::i32vec2  s)
static

Definition at line 39 of file UI.cpp.

static void UI::setVisible ( bool  v)
inlinestatic

Definition at line 30 of file UI.h.

static bool UI::isVisible ( )
inlinestatic

Definition at line 31 of file UI.h.

void UI::handleKeyboard ( KeyboardButton  key,
bool  pressed 
)
static

Definition at line 355 of file UI.cpp.

void UI::handleText ( char *  text,
bool  notFinished 
)
static

Definition at line 367 of file UI.cpp.

void UI::handleMouseClick ( unsigned int  x,
unsigned int  y,
KeyboardButton  button,
bool  released 
)
static

Definition at line 378 of file UI.cpp.

void UI::handleMouseMotion ( int  xrel,
int  yrel,
int  xabs,
int  yabs 
)
static

Definition at line 396 of file UI.cpp.

void UI::handleMouseScroll ( int  xrel,
int  yrel 
)
static

Definition at line 403 of file UI.cpp.

void UI::handleControllerAxis ( float  value,
KeyboardButton  axis 
)
static

Definition at line 410 of file UI.cpp.

void UI::handleControllerButton ( KeyboardButton  button,
bool  released 
)
static

Definition at line 414 of file UI.cpp.

void UI::renderImGui ( ImDrawList **const  draw_lists,
int  count 
)
static
FIXME:
Don't copy data The GL calls and the shaders can probably be slightly altered to avoid copying all the vertices, uvs and colors again here.

Definition at line 459 of file UI.cpp.

Member Data Documentation

bool UI::visible = false
staticprivate

Definition at line 44 of file UI.h.

unsigned int UI::fontTex
staticprivate

Definition at line 45 of file UI.h.

std::string UI::iniFilename
staticprivate

Definition at line 46 of file UI.h.

std::string UI::logFilename
staticprivate

Definition at line 47 of file UI.h.

bool UI::metaKeyIsActive = false
staticprivate

Definition at line 48 of file UI.h.

std::list< std::tuple< KeyboardButton, bool > > UI::keyboardEvents
staticprivate

Definition at line 50 of file UI.h.

std::list< std::tuple< unsigned int, unsigned int, KeyboardButton, bool > > UI::clickEvents
staticprivate

Definition at line 51 of file UI.h.

std::list< std::tuple< int, int, int, int > > UI::motionEvents
staticprivate

Definition at line 52 of file UI.h.

std::list< std::tuple< int, int > > UI::scrollEvents
staticprivate

Definition at line 53 of file UI.h.

Shader UI::imguiShader
staticprivate

Definition at line 55 of file UI.h.

const char * UI::imguiShaderVertex
staticprivate
Initial value:
= R"!?!(
#version 330 core
layout(location = 0) in vec2 vertexPosition_screen;
layout(location = 1) in vec2 vertexUV;
layout(location = 2) in vec4 vertexColor;
out vec2 UV;
out vec4 FragColor;
uniform vec2 screen;
void main() {
vec2 halfScreen = screen / 2;
vec2 vertexPosition_homogenous = (vertexPosition_screen - halfScreen) / halfScreen;
gl_Position = vec4(vertexPosition_homogenous.x, -vertexPosition_homogenous.y, 0, 1);
UV = vertexUV;
FragColor = vertexColor;
}
)!?!"

Definition at line 56 of file UI.h.

const char * UI::imguiShaderFragment
staticprivate
Initial value:
= R"!?!(
#version 330 core
in vec2 UV;
in vec4 FragColor;
out vec4 color;
uniform sampler2D textureSampler;
void main() {
color = texture(textureSampler, UV) * FragColor;
}
)!?!"

Definition at line 57 of file UI.h.


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