23 #ifndef __GL_VIEWPORT_H__ 24 #define __GL_VIEWPORT_H__ 47 static glDisplay*
Create(
float r=0.05f,
float g=0.05f,
float b=0.05f,
float a=1.0f );
57 static glDisplay*
Create(
const char* title,
float r=0.05f,
float g=0.05f,
float b=0.05f,
float a=1.0f );
87 void Render(
float* image, uint32_t width, uint32_t height,
float x=5.0f,
float y=30.0f,
bool normalize=
true );
96 void RenderOnce(
float* image, uint32_t width, uint32_t height,
float x=5.0f,
float y=30.0f,
bool normalize=
true );
106 void onEvent( uint msg,
int a,
int b );
Screen * mScreenX
Definition: glDisplay.h:161
timespec mLastTime
Definition: glDisplay.h:172
bool IsOpen() const
Returns true if the window is open.
Definition: glDisplay.h:111
static const char * DEFAULT_TITLE
Default title bar name.
Definition: glDisplay.h:150
float mBgColor[4]
Definition: glDisplay.h:174
Window mWindowX
Definition: glDisplay.h:163
Atom mWindowClosedMsg
Definition: glDisplay.h:167
GLXContext mContextGL
Definition: glDisplay.h:164
uint32_t GetHeight() const
Get the height of the window (in pixels)
Definition: glDisplay.h:131
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.
bool mWindowClosed
Definition: glDisplay.h:166
bool IsClosed() const
Returns true if the window has been closed.
Definition: glDisplay.h:116
uint32_t GetWidth() const
Get the width of the window (in pixels)
Definition: glDisplay.h:126
void onEvent(uint msg, int a, int b)
UI event handler.
void BeginRender(bool userEvents=true)
Clear window and begin rendering a frame.
float mAvgTime
Definition: glDisplay.h:173
void SetBackgroundColor(float r, float g, float b, float a)
Set the background color.
Definition: glDisplay.h:145
XVisualInfo * mVisualX
Definition: glDisplay.h:162
OpenGL display window / video viewer.
Definition: glDisplay.h:37
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.
static const int screenIdx
Definition: glDisplay.h:158
Display * mDisplayX
Definition: glDisplay.h:160
uint32_t mWidth
Definition: glDisplay.h:169
float GetFPS() const
Get the average frame time (in milliseconds).
Definition: glDisplay.h:121
~glDisplay()
Destroy window.
void SetTitle(const char *str)
Set the window title string.
void UserEvents()
Process UI events.
OpenGL texture with CUDA interoperability.
Definition: glTexture.h:35
void Render(glTexture *texture, float x=5.0f, float y=30.0f)
Render an OpenGL texture.
glTexture * mInteropTex
Definition: glDisplay.h:165
uint32_t mHeight
Definition: glDisplay.h:170
void EndRender()
Finish rendering and refresh / flip the backbuffer.