Loading...
Searching...
No Matches
BALL::VIEW::GLRenderWindow Class Reference

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

Inheritance diagram for BALL::VIEW::GLRenderWindow:

## Public Member Functions

| GLRenderWindow ()
| GLRenderWindow (QWidget *parent_widget, const char *name=NULL, Qt::WindowFlags w_flags=0)
| GLRenderWindow (const GLRenderWindow &window, QWidget *parent_widget, const char *name=NULL, Qt::WindowFlags 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.
void | unlockGLContext ()
| Unlock the context for the current thread and make it active.
void | ignoreEvents (bool ignore)
| Force the window to ignore paint events.
void | setDownsamplingFactor (float dsfactor)
| Set the window's downsampling factor. This is a speed up factor.
void | setStereoDelta (float delta)
| Set the stereo delta for raytracing in pixels.
void | setupStereo (float eye_separation, float focal_length)
void | safeBufferSwap ()
| Call swapBuffers() but first make sure the window is exposed.
float | getDownsamplingFactor () const
| Get the window's downsampling factor.
Public Member Functions inherited from BALL::VIEW::TRenderWindow< BALL_DEFAULT_PIXEL_TYPE >
| TRenderWindow ()
virtual | ~TRenderWindow ()
virtual FrameBufferPtr | getBuffer ()
virtual FrameBufferFormat | getFormat () const
virtual void | releaseBuffer (FrameBufferPtr buffer)
virtual void | prepareRendering ()
virtual bool | doNotResize () const
virtual void | setDoNotResize (bool do_not_resize)
Public Member Functions inherited from BALL::VIEW::RenderTarget
virtual | ~RenderTarget ()

## Public Attributes

float | stereo_delta_

## Protected Member Functions

virtual void | customEvent (QEvent *evt)
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_
float | down_sampling_factor_
Protected Attributes inherited from BALL::VIEW::TRenderWindow< BALL_DEFAULT_PIXEL_TYPE >
t_PixelPtr | m_pixels
FrameBufferPtr | m_framebuffer
FrameBufferFormat | m_fmt
const PixelFormat | m_pfm
bool | m_bufferLocked
const Size | m_minimalWidth
const Size | m_minimalHeight
bool | do_not_resize_

## 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

## GLRenderWindow() [1/3]

BALL::VIEW::GLRenderWindow::GLRenderWindow | ( |  | ) |

## GLRenderWindow() [2/3]

BALL::VIEW::GLRenderWindow::GLRenderWindow | ( | QWidget * | parent_widget,
|  | const char * | name = NULL,
|  | Qt::WindowFlags | w_flags = 0 )

## GLRenderWindow() [3/3]

BALL::VIEW::GLRenderWindow::GLRenderWindow | ( | const GLRenderWindow & | window,
|  | QWidget * | parent_widget,
|  | const char * | name = NULL,
|  | Qt::WindowFlags | w_flags = 0 )

## ~GLRenderWindow()

virtual BALL::VIEW::GLRenderWindow::~GLRenderWindow | ( |  | ) |

virtual

## Member Function Documentation

## checkGL()

void BALL::VIEW::GLRenderWindow::checkGL | ( |  | ) |

protected

## createTexture()

void BALL::VIEW::GLRenderWindow::createTexture | ( | const unsigned int | winWidth,
|  | const unsigned int | winHeight )

protected

## customEvent()

virtual void BALL::VIEW::GLRenderWindow::customEvent | ( | QEvent * | evt | ) |

protected virtual

This function handles custom Qt Events.

The main use of this function is notification of a fresh buffer to display from a separate renderer thread.

## deleteTexture()

void BALL::VIEW::GLRenderWindow::deleteTexture | ( |  | ) |

protected

## errorInGL()

bool BALL::VIEW::GLRenderWindow::errorInGL | ( | GLenum & | error | ) |

protected

## getDownsamplingFactor()

float BALL::VIEW::GLRenderWindow::getDownsamplingFactor | ( |  | ) | const

inline

Get the window's downsampling factor.

Definition at line 82 of file glRenderWindow.h.

## getGLErrorString()

String BALL::VIEW::GLRenderWindow::getGLErrorString | ( | GLenum | error | ) |

protected

## ignoreEvents()

void BALL::VIEW::GLRenderWindow::ignoreEvents | ( | bool | ignore | ) |

inline

Force the window to ignore paint events.

Definition at line 66 of file glRenderWindow.h.

## init()

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

virtual

Initialization routine.

Reimplemented from BALL::VIEW::TRenderWindow< BALL_DEFAULT_PIXEL_TYPE >.

## lockGLContext()

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

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

## paintEvent()

void BALL::VIEW::GLRenderWindow::paintEvent | ( | QPaintEvent * | e | ) |

protected

## refresh()

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::TRenderWindow< BALL_DEFAULT_PIXEL_TYPE >.

## renderText() [1/2]

virtual void BALL::VIEW::GLRenderWindow::renderText | ( | float | x,
|  | float | y,
|  | float | z,
|  | const String & | text,
|  | const ColorRGBA & | color,
|  | Size | size = 16 )

virtual

## renderText() [2/2]

virtual void BALL::VIEW::GLRenderWindow::renderText | ( | int | x,
|  | int | y,
|  | const String & | text,
|  | const ColorRGBA & | color,
|  | Size | size = 16 )

virtual

## resize()

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::TRenderWindow< BALL_DEFAULT_PIXEL_TYPE >.

## safeBufferSwap()

void BALL::VIEW::GLRenderWindow::safeBufferSwap | ( |  | ) |

Call swapBuffers() but first make sure the window is exposed.

## setDownsamplingFactor()

void BALL::VIEW::GLRenderWindow::setDownsamplingFactor | ( | float | dsfactor | ) |

inline

Set the window's downsampling factor. This is a speed up factor.

Definition at line 69 of file glRenderWindow.h.

## setStereoDelta()

void BALL::VIEW::GLRenderWindow::setStereoDelta | ( | float | delta | ) |

inline

Set the stereo delta for raytracing in pixels.

Definition at line 73 of file glRenderWindow.h.

## setupStereo()

void BALL::VIEW::GLRenderWindow::setupStereo | ( | float | ,
|  | float | )

virtual

Sets this render target as a part of a stereo setup.

eye_separation denotes the distance along the right vector used by this "eye".

Reimplemented from BALL::VIEW::RenderTarget.

## unlockGLContext()

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

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

## Member Data Documentation

## contex_mutex_

Mutex BALL::VIEW::GLRenderWindow::contex_mutex_

mutable protected

Definition at line 118 of file glRenderWindow.h.

## down_sampling_factor_

float BALL::VIEW::GLRenderWindow::down_sampling_factor_

protected

Definition at line 120 of file glRenderWindow.h.

## FB_INTERNAL_TEXTURE_FORMAT

GLenum BALL::VIEW::GLRenderWindow::FB_INTERNAL_TEXTURE_FORMAT

protected

Definition at line 106 of file glRenderWindow.h.

## FB_TEXTURE_DATATYPE

GLenum BALL::VIEW::GLRenderWindow::FB_TEXTURE_DATATYPE

protected

Definition at line 108 of file glRenderWindow.h.

## FB_TEXTURE_FORMAT

GLenum BALL::VIEW::GLRenderWindow::FB_TEXTURE_FORMAT

protected

Definition at line 104 of file glRenderWindow.h.

## FB_TEXTURE_TARGET

GLenum BALL::VIEW::GLRenderWindow::FB_TEXTURE_TARGET

protected

Definition at line 102 of file glRenderWindow.h.

## gl_format_

QGLFormat BALL::VIEW::GLRenderWindow::gl_format_

static protected

Definition at line 97 of file glRenderWindow.h.

## ignore_events_

bool BALL::VIEW::GLRenderWindow::ignore_events_

protected

Definition at line 119 of file glRenderWindow.h.

## m_screenTexID

GLuint BALL::VIEW::GLRenderWindow::m_screenTexID

protected

Definition at line 100 of file glRenderWindow.h.

## stereo_delta_

float BALL::VIEW::GLRenderWindow::stereo_delta_

Definition at line 85 of file glRenderWindow.h.