BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
BALL::VIEW::GLRenderWindow Class Reference

#include <BALL/VIEW/RENDERING/glRenderWindow.h>

Inheritance diagram for BALL::VIEW::GLRenderWindow:
BALL::VIEW::RenderWindow< float > QGLWidget BALL::VIEW::RenderTarget

Public Member Functions

 GLRenderWindow ()
 
 GLRenderWindow (QWidget *parent_widget, const char *name=NULL, Qt::WFlags w_flags=0)
 
 GLRenderWindow (const GLRenderWindow &window, QWidget *parent_widget, const char *name=NULL, Qt::WFlags w_flags=0)
 
virtual ~GLRenderWindow ()
 
virtual bool init ()
 
virtual bool resize (const unsigned int width, const unsigned int height)
 
virtual void refresh ()
 
virtual void renderText (int x, int y, const String &text, const ColorRGBA &color, Size size=16)
 
virtual void renderText (float x, float y, float z, const String &text, const ColorRGBA &color, Size size=16)
 
void lockGLContext ()
 Lock the context for the current thread and make it active. More...
 
void unlockGLContext ()
 Unlock the context for the current thread and make it active. More...
 
void ignoreEvents (bool ignore)
 Force the window to ignore paint events. More...
 
- Public Member Functions inherited from BALL::VIEW::RenderWindow< float >
 RenderWindow ()
 
virtual ~RenderWindow ()
 
virtual FrameBufferPtr getBuffer () throw (BALL::Exception::NoBufferAvailable)
 
virtual FrameBufferFormat getFormat () const
 
virtual void releaseBuffer (FrameBufferPtr buffer)
 
virtual void prepareRendering ()
 
- Public Member Functions inherited from BALL::VIEW::RenderTarget
virtual ~RenderTarget ()
 

Protected Member Functions

void paintEvent (QPaintEvent *e)
 
void createTexture (const unsigned int winWidth, const unsigned int winHeight)
 
void deleteTexture ()
 
void checkGL ()
 
bool errorInGL (GLenum &error)
 
String getGLErrorString (GLenum error)
 

Protected Attributes

GLuint m_screenTexID
 
GLenum FB_TEXTURE_TARGET
 
GLenum FB_TEXTURE_FORMAT
 
GLenum FB_INTERNAL_TEXTURE_FORMAT
 
GLenum FB_TEXTURE_DATATYPE
 
Mutex contex_mutex_
 
bool ignore_events_
 
bool is_buffered_
 
- Protected Attributes inherited from BALL::VIEW::RenderWindow< float >
t_PixelPtr m_pixels
 
FrameBufferPtr m_framebuffer
 
FrameBufferFormat m_fmt
 
const PixelFormat m_pfm
 
bool m_bufferLocked
 
const unsigned int m_minimalWidth
 
const unsigned int m_minimalHeight
 

Static Protected Attributes

static QGLFormat gl_format_
 

Detailed Description

Model of the RenderWindow which uses OpenGL to render its buffer to the screen

Definition at line 37 of file glRenderWindow.h.

Constructor & Destructor Documentation

BALL::VIEW::GLRenderWindow::GLRenderWindow ( )
BALL::VIEW::GLRenderWindow::GLRenderWindow ( QWidget parent_widget,
const char *  name = NULL,
Qt::WFlags  w_flags = 0 
)
BALL::VIEW::GLRenderWindow::GLRenderWindow ( const GLRenderWindow window,
QWidget parent_widget,
const char *  name = NULL,
Qt::WFlags  w_flags = 0 
)
virtual BALL::VIEW::GLRenderWindow::~GLRenderWindow ( )
virtual

Member Function Documentation

void BALL::VIEW::GLRenderWindow::checkGL ( )
protected
void BALL::VIEW::GLRenderWindow::createTexture ( const unsigned int  winWidth,
const unsigned int  winHeight 
)
protected
void BALL::VIEW::GLRenderWindow::deleteTexture ( )
protected
bool BALL::VIEW::GLRenderWindow::errorInGL ( GLenum &  error)
protected
String BALL::VIEW::GLRenderWindow::getGLErrorString ( GLenum  error)
protected
void BALL::VIEW::GLRenderWindow::ignoreEvents ( bool  ignore)
inline

Force the window to ignore paint events.

Definition at line 66 of file glRenderWindow.h.

virtual bool BALL::VIEW::GLRenderWindow::init ( )
virtual

Initialization routine.

Reimplemented from BALL::VIEW::RenderWindow< float >.

void BALL::VIEW::GLRenderWindow::lockGLContext ( )

Lock the context for the current thread and make it active.

void BALL::VIEW::GLRenderWindow::paintEvent ( QPaintEvent *  e)
protected
virtual void BALL::VIEW::GLRenderWindow::refresh ( )
virtual

Request that the image is actually displayed on the screen or other device the window encapsulated. You should implement this method in subclass. This is different from RenderTarget releaseBuffer. ReleaseBuffer only informs the window that a buffer is ready, but does not imply the buffer is actually displayed somewhere. This is done by refresh. On the other hand, refresh called inbetween getBuffer and releaseBuffer has no effect.

Reimplemented from BALL::VIEW::RenderWindow< float >.

virtual void BALL::VIEW::GLRenderWindow::renderText ( int  x,
int  y,
const String text,
const ColorRGBA color,
Size  size = 16 
)
virtual
virtual void BALL::VIEW::GLRenderWindow::renderText ( float  x,
float  y,
float  z,
const String text,
const ColorRGBA color,
Size  size = 16 
)
virtual
virtual bool BALL::VIEW::GLRenderWindow::resize ( const unsigned int  width,
const unsigned int  height 
)
virtual

Request new window size. Returns false if such a size cannot be supplied This call must be made before the window buffer is handed out to be rendered. This precondition is being checked automatically, see getBuffer

Reimplemented from BALL::VIEW::RenderWindow< float >.

void BALL::VIEW::GLRenderWindow::unlockGLContext ( )

Unlock the context for the current thread and make it active.

Member Data Documentation

Mutex BALL::VIEW::GLRenderWindow::contex_mutex_
mutableprotected

Definition at line 91 of file glRenderWindow.h.

GLenum BALL::VIEW::GLRenderWindow::FB_INTERNAL_TEXTURE_FORMAT
protected

Definition at line 79 of file glRenderWindow.h.

GLenum BALL::VIEW::GLRenderWindow::FB_TEXTURE_DATATYPE
protected

Definition at line 81 of file glRenderWindow.h.

GLenum BALL::VIEW::GLRenderWindow::FB_TEXTURE_FORMAT
protected

Definition at line 77 of file glRenderWindow.h.

GLenum BALL::VIEW::GLRenderWindow::FB_TEXTURE_TARGET
protected

Definition at line 75 of file glRenderWindow.h.

QGLFormat BALL::VIEW::GLRenderWindow::gl_format_
staticprotected

Definition at line 70 of file glRenderWindow.h.

bool BALL::VIEW::GLRenderWindow::ignore_events_
protected

Definition at line 92 of file glRenderWindow.h.

bool BALL::VIEW::GLRenderWindow::is_buffered_
protected

Definition at line 94 of file glRenderWindow.h.

GLuint BALL::VIEW::GLRenderWindow::m_screenTexID
protected

Definition at line 73 of file glRenderWindow.h.