Labyrinth
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
LxS::System::LinuxLxSGLES Class Reference

OpenGL|ES port for Linux, used mainly for development. More...

#include <linuxlxs_gles.hpp>

Inheritance diagram for LxS::System::LinuxLxSGLES:
Inheritance graph
Collaboration diagram for LxS::System::LinuxLxSGLES:
Collaboration graph

Public Member Functions

 LinuxLxSGLES (const char *_title, GLint _w, GLint h)
 constructor
 
virtual void DrawFrame ()
 ways of drawing frame differs from platform to platform
 
virtual void Init ()
 ways of initializing context differs from platform to platform
 
virtual void Deinit ()
 ways of deinitializing context differs from platform to platform
 
void Halt ()
 it is not shutdown procedure; rather pause invoked from platform-main (used to implement for instance Android Run States)
 
void Resume ()
 Opposite to Halt.
 
void InitRoot ()
 Initialiize Root.
 
void DeinitRoot ()
 Deinitialize Root.
 
bool GLQueueEmpty ()
 Checks whenever OpenGL function queue is empty.
 
int EnqueueOGLFunction (GLFunction glf)
 Call OpenGL from man thread Passes function pointer to execute. It is than pushed to GL function queue (func_queue) and is guaranteed to be executed in main GL thread function is removed from queue upon execution;.
 
GLuint ReadPixel (float x, float y)
 
void Terminate ()
 Issue terminate request (shutdown)
 
void GoFullScreen ()
 enter fullscreen mode (without altering resolution)
 
GLboolean userInterrupt ()
 for X11 message loop
 

Static Public Member Functions

static LxSExposeGlobalInstance ()
 Expose pointer to global instance In some situations it is required to issue call to global LxS instance. I.e. when shutdown is requested from UI or when opengl function must be called in global main opengl thread. (see documentation for func_queue member)
 

Protected Member Functions

EGLBoolean CreateEGLContext (EGLNativeWindowType hWnd, EGLDisplay *eglDisplay, EGLContext *eglContext, EGLSurface *eglSurface, EGLint attribList[])
 routine for creation of EGL context on linux
 
float RecalculateX (int x)
 Given x coord in pixels convert it to centimeters from edge.
 
float RecalculateY (int y)
 Given Y coord in pixels from top edge convert it to centimeters from bottom edge.
 
void PassDragEventAsAngularDelta (int x, int y)
 Used for implementing "touch and rotate interface" user idiom.
 
int ExecuteGLFunctionQueue ()
 typically invoked before/after Render by LxS class implementation. Typically executes just one function from func_queue at a time
 
int EraseGLFunctionQueue ()
 used during shutdown, to clear queue before exiting
 
bool WinCreate (const char *title)
 create a window with given title
 
void PassJoystick ()
 pass joystick to Root
 
void SimulateJoystick (int Axis, float Direction)
 simulate joystick input
 

Protected Attributes

EGLDisplay eglDisplay
 display handle
 
EGLContext eglContext
 context handle
 
EGLSurface eglSurface
 surface handle
 
::LxS::CoreGraphics::GLCamera o_Camera
 Global camera object (represents global camera setup object used to render current scene)
 
int animating
 Is application active (i.e. in foregground)
 
::LxS::Windowing::Rootp_Root
 Root window.
 
float invDPC
 inverted dots per centimeter (convenient
 
int width
 width of whole window/screen
 
int height
 height of whole window/screen
 
bool Dragging
 is user trying to move something on the screen?
 
std::deque< GLFunctionfunc_queue
 Queue of functions that MUST be executed in root thread Queue of functions that MUST be executed in root thread (generally OpenGL code). For details look at threading documentation
 
MyMutex func_queue_mtx
 sync object for func_queue
 
bool terminate_request_issued
 for implementation of shutdown procedure
 
std::string title
 window title
 
Atom protocols [1]
 atom messages (used for entering fullscreen mode, deleting window wtc)
 
Atom wm_delete_window
 command for window deletion
 
bool fullscreen
 fullscreen mode
 
int default_width
 default_width of the window (one with which win was created)
 
int default_height
 default_height of the window (one with which win was created)
 
Display * x_display
 x11 display handle
 
bool window_valid
 Window handle.
 
::Window hWnd
 window handle
 
float js [V_JS_AXES]
 joystick axes
 

Static Protected Attributes

static LxSglobal_instance = 0
 this us used to make sure that it is a singleton - allows extract single global instance and disallows to create more than one instance
 

Detailed Description

OpenGL|ES port for Linux, used mainly for development.

in most Linux environments LinuxLxSGL2 provides much better performance, but some Linux Systems, especially those ARM-based, don't have proper OpenGL drivers, only OpenGL|ES.

Member Function Documentation

GLuint LxS::System::LxS::ReadPixel ( float  x,
float  y 
)
inherited

Read pixel from current GL buffer (position is indicated in centimeters from screen bottom-left edge)


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