UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
TripleBufferTexture Class Reference

#include <opengl_utils.hpp>

Collaboration diagram for TripleBufferTexture:
Collaboration graph

Public Member Functions

void allocateTextures ()
 
Texture & get_back ()
 
Texture & get_front ()
 
bool is_new_front_available () const
 
void swap_back ()
 
void swap_front ()
 

Private Attributes

Texture back
 
Texture front
 
Texture mid
 
bool new_front_available = false
 

Detailed Description

Class containing 3 Texture objects to use as a triple buffer.

Definition at line 348 of file opengl_utils.hpp.

Member Function Documentation

◆ allocateTextures()

void TripleBufferTexture::allocateTextures ( )
inline

Definition at line 350 of file opengl_utils.hpp.

350 {
351 back.allocate();
352 mid.allocate();
353 front.allocate();
354 }
void allocate(int w, int h, GLint internal_fmt)

References Texture::allocate(), back, front, and mid.

Referenced by PanoramaScene::PanoramaScene().

Here is the call graph for this function:

◆ get_back()

Texture & TripleBufferTexture::get_back ( )
inline

Returns a reference to the back texture

Definition at line 359 of file opengl_utils.hpp.

359{ return back; }

References back.

Referenced by PanoramaScene::put_frame().

◆ get_front()

Texture & TripleBufferTexture::get_front ( )
inline

Returns a reference to the front texture

Definition at line 364 of file opengl_utils.hpp.

364{ return front; }

References front.

Referenced by PanoramaScene::render().

◆ is_new_front_available()

bool TripleBufferTexture::is_new_front_available ( ) const
inline

Returns the state of the flag indicating a new texture

Definition at line 387 of file opengl_utils.hpp.

387{ return new_front_available; }

References new_front_available.

Referenced by PanoramaScene::render().

◆ swap_back()

void TripleBufferTexture::swap_back ( )
inline

Should be called after writing to back texture is finished. Swaps the back and mid textures and sets a flag indicating that a new texture is available for reading

Definition at line 371 of file opengl_utils.hpp.

371 {
372 back.swap(mid);
373 new_front_available = true;
374 }
void swap(Texture &o)

References back, mid, new_front_available, and Texture::swap().

Referenced by PanoramaScene::put_frame().

Here is the call graph for this function:

◆ swap_front()

void TripleBufferTexture::swap_front ( )
inline

Swaps front and mid texture. Unsets the flag indicating a new texture.

Definition at line 379 of file opengl_utils.hpp.

379 {
380 front.swap(mid);
381 new_front_available = false;
382 }

References front, mid, new_front_available, and Texture::swap().

Referenced by PanoramaScene::render().

Here is the call graph for this function:

Member Data Documentation

◆ back

Texture TripleBufferTexture::back
private

Definition at line 390 of file opengl_utils.hpp.

Referenced by allocateTextures(), get_back(), and swap_back().

◆ front

Texture TripleBufferTexture::front
private

Definition at line 391 of file opengl_utils.hpp.

Referenced by allocateTextures(), get_front(), and swap_front().

◆ mid

Texture TripleBufferTexture::mid
private

Definition at line 392 of file opengl_utils.hpp.

Referenced by allocateTextures(), swap_back(), and swap_front().

◆ new_front_available

bool TripleBufferTexture::new_front_available = false
private

Definition at line 394 of file opengl_utils.hpp.

Referenced by is_new_front_available(), swap_back(), and swap_front().


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