OpenGL display window / video viewer.
More...
#include <glDisplay.h>
|
| ~glDisplay () |
| Destroy window. More...
|
|
void | BeginRender (bool userEvents=true) |
| Clear window and begin rendering a frame. More...
|
|
void | EndRender () |
| Finish rendering and refresh / flip the backbuffer. More...
|
|
void | Render (glTexture *texture, float x=5.0f, float y=30.0f) |
| Render an OpenGL texture. More...
|
|
void | Render (float *image, uint32_t width, uint32_t height, float x=5.0f, float y=30.0f, bool normalize=true) |
| Render a CUDA float4 image using OpenGL interop If normalize is true, the image's pixel values will be rescaled from the range of [0-255] to [0-1] If normalize is false, the image's pixel values are assumed to already be in the range of [0-1] Note that if normalization is selected to be performed, it will be done in-place on the image. More...
|
|
void | RenderOnce (float *image, uint32_t width, uint32_t height, float x=5.0f, float y=30.0f, bool normalize=true) |
| Begin the frame, render one CUDA float4 image using OpenGL interop, and end the frame. More...
|
|
void | UserEvents () |
| Process UI events. More...
|
|
void | onEvent (uint msg, int a, int b) |
| UI event handler. More...
|
|
bool | IsOpen () const |
| Returns true if the window is open. More...
|
|
bool | IsClosed () const |
| Returns true if the window has been closed. More...
|
|
float | GetFPS () const |
| Get the average frame time (in milliseconds). More...
|
|
uint32_t | GetWidth () const |
| Get the width of the window (in pixels) More...
|
|
uint32_t | GetHeight () const |
| Get the height of the window (in pixels) More...
|
|
void | SetTitle (const char *str) |
| Set the window title string. More...
|
|
void | SetBackgroundColor (float r, float g, float b, float a) |
| Set the background color. More...
|
|
|
static glDisplay * | Create (float r=0.05f, float g=0.05f, float b=0.05f, float a=1.0f) |
| Create a new maximized openGL display window. More...
|
|
static glDisplay * | Create (const char *title, float r=0.05f, float g=0.05f, float b=0.05f, float a=1.0f) |
| Create a new maximized openGL display window. More...
|
|
OpenGL display window / video viewer.
◆ ~glDisplay()
glDisplay::~glDisplay |
( |
| ) |
|
◆ glDisplay()
◆ BeginRender()
void glDisplay::BeginRender |
( |
bool |
userEvents = true | ) |
|
Clear window and begin rendering a frame.
If userEvents is true, UserEvents() will automatically be processed.
◆ Create() [1/2]
static glDisplay* glDisplay::Create |
( |
float |
r = 0.05f , |
|
|
float |
g = 0.05f , |
|
|
float |
b = 0.05f , |
|
|
float |
a = 1.0f |
|
) |
| |
|
static |
Create a new maximized openGL display window.
- Parameters
-
r | default background RGBA color, red component (0.0-1.0f) |
g | default background RGBA color, green component (0.0-1.0f) |
b | default background RGBA color, blue component (0.0-1.0f) |
a | default background RGBA color, alpha component (0.0-1.0f) |
◆ Create() [2/2]
static glDisplay* glDisplay::Create |
( |
const char * |
title, |
|
|
float |
r = 0.05f , |
|
|
float |
g = 0.05f , |
|
|
float |
b = 0.05f , |
|
|
float |
a = 1.0f |
|
) |
| |
|
static |
Create a new maximized openGL display window.
- Parameters
-
title | window title bar label string |
r | default background RGBA color, red component (0.0-1.0f) |
g | default background RGBA color, green component (0.0-1.0f) |
b | default background RGBA color, blue component (0.0-1.0f) |
a | default background RGBA color, alpha component (0.0-1.0f) |
◆ EndRender()
void glDisplay::EndRender |
( |
| ) |
|
Finish rendering and refresh / flip the backbuffer.
◆ GetFPS()
float glDisplay::GetFPS |
( |
| ) |
const |
|
inline |
Get the average frame time (in milliseconds).
◆ GetHeight()
uint32_t glDisplay::GetHeight |
( |
| ) |
const |
|
inline |
Get the height of the window (in pixels)
◆ GetWidth()
uint32_t glDisplay::GetWidth |
( |
| ) |
const |
|
inline |
Get the width of the window (in pixels)
◆ initGL()
bool glDisplay::initGL |
( |
| ) |
|
|
protected |
◆ initWindow()
bool glDisplay::initWindow |
( |
| ) |
|
|
protected |
◆ IsClosed()
bool glDisplay::IsClosed |
( |
| ) |
const |
|
inline |
Returns true if the window has been closed.
◆ IsOpen()
bool glDisplay::IsOpen |
( |
| ) |
const |
|
inline |
Returns true if the window is open.
◆ onEvent()
void glDisplay::onEvent |
( |
uint |
msg, |
|
|
int |
a, |
|
|
int |
b |
|
) |
| |
◆ Render() [1/2]
void glDisplay::Render |
( |
glTexture * |
texture, |
|
|
float |
x = 5.0f , |
|
|
float |
y = 30.0f |
|
) |
| |
Render an OpenGL texture.
- Note
- for more texture rendering methods,
- See also
- glTexture
◆ Render() [2/2]
void glDisplay::Render |
( |
float * |
image, |
|
|
uint32_t |
width, |
|
|
uint32_t |
height, |
|
|
float |
x = 5.0f , |
|
|
float |
y = 30.0f , |
|
|
bool |
normalize = true |
|
) |
| |
Render a CUDA float4 image using OpenGL interop If normalize is true, the image's pixel values will be rescaled from the range of [0-255] to [0-1] If normalize is false, the image's pixel values are assumed to already be in the range of [0-1] Note that if normalization is selected to be performed, it will be done in-place on the image.
◆ RenderOnce()
void glDisplay::RenderOnce |
( |
float * |
image, |
|
|
uint32_t |
width, |
|
|
uint32_t |
height, |
|
|
float |
x = 5.0f , |
|
|
float |
y = 30.0f , |
|
|
bool |
normalize = true |
|
) |
| |
Begin the frame, render one CUDA float4 image using OpenGL interop, and end the frame.
Note that this function is only useful if you are rendering a single texture per frame. If normalize is true, the image's pixel values will be rescaled from the range of [0-255] to [0-1] If normalize is false, the image's pixel values are assumed to already be in the range of [0-1] Note that if normalization is selected to be performed, it will be done in-place on the image
◆ SetBackgroundColor()
void glDisplay::SetBackgroundColor |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b, |
|
|
float |
a |
|
) |
| |
|
inline |
Set the background color.
- Parameters
-
r | background RGBA color, red component (0.0-1.0f) |
g | background RGBA color, green component (0.0-1.0f) |
b | background RGBA color, blue component (0.0-1.0f) |
a | background RGBA color, alpha component (0.0-1.0f) |
◆ SetTitle()
void glDisplay::SetTitle |
( |
const char * |
str | ) |
|
Set the window title string.
◆ UserEvents()
void glDisplay::UserEvents |
( |
| ) |
|
◆ DEFAULT_TITLE
const char* glDisplay::DEFAULT_TITLE |
|
static |
◆ mAvgTime
float glDisplay::mAvgTime |
|
protected |
◆ mBgColor
float glDisplay::mBgColor[4] |
|
protected |
◆ mContextGL
GLXContext glDisplay::mContextGL |
|
protected |
◆ mDisplayX
Display* glDisplay::mDisplayX |
|
protected |
◆ mHeight
uint32_t glDisplay::mHeight |
|
protected |
◆ mInteropTex
◆ mLastTime
timespec glDisplay::mLastTime |
|
protected |
◆ mScreenX
Screen* glDisplay::mScreenX |
|
protected |
◆ mVisualX
XVisualInfo* glDisplay::mVisualX |
|
protected |
◆ mWidth
uint32_t glDisplay::mWidth |
|
protected |
◆ mWindowClosed
bool glDisplay::mWindowClosed |
|
protected |
◆ mWindowClosedMsg
Atom glDisplay::mWindowClosedMsg |
|
protected |
◆ mWindowX
Window glDisplay::mWindowX |
|
protected |
◆ screenIdx
const int glDisplay::screenIdx = 0 |
|
staticprotected |
The documentation for this class was generated from the following file: