NVIDIA Index example code nvidia_logo_transpbg.gif Up
Opengl_application_buffer Class Reference

opengl application buffer More...

#include <opengl_application_buffer.h>

Inheritance diagram for Opengl_application_buffer:

Public Member Functions

 Opengl_application_buffer ()
 default constructor More...
 
virtual ~Opengl_application_buffer ()
 destructor More...
 
virtual mi::math::Vector_struct< mi::Uint32, 2 > get_resolution () const
 get the buffer resolution. More...
 
virtual mi::Uint32 * get_z_buffer_ptr ()
 get the pointer of Z-buffer. More...
 
void set_use_color_buffer (bool is_use)
 Set use color buffer (for debug) More...
 
bool is_use_color_buffer () const
 Is use color buffer (for debug) More...
 
mi::math::Color * get_color_buffer_ptr ()
 Get Color buffer. More...
 
void set_z_buffer_precision (mi::Uint32 precision)
 Set Z-buffer precision (bits) More...
 
mi::Uint32 get_z_buffer_precision () const
 Get Z-buffer precision (bits) More...
 
void resize_buffer (mi::math::Vector_struct< mi::Uint32, 2 > const &new_resolution)
 resize the buffer. More...
 
void clear_buffer ()
 clear buffer More...
 
bool is_buffer_allocated () const
 is buffer allocated More...
 
bool debug_write_buffer_to_file (nv::index::app::IApplication_layer *app_layer, std::string const &fname)
 debug: dump RGBA and Z to ppm image (no alpha) More...
 

Static Public Member Functions

static mi::Sint32 get_pixel_index (mi::Sint32 width, mi::Sint32 height, mi::Sint32 x, mi::Sint32 y)
 get pixel index. Assume buffer size is less than 2G. More...
 

Detailed Description

opengl application buffer

This implementation has no dependency to OpenGL.

Definition at line 21 of file opengl_application_buffer.h.

Constructor & Destructor Documentation

 Opengl_application_buffer()

Opengl_application_buffer::Opengl_application_buffer ( )

default constructor

Definition at line 16 of file opengl_application_buffer.cpp.

 ~Opengl_application_buffer()

Opengl_application_buffer::~Opengl_application_buffer ( )
virtual

destructor

Definition at line 28 of file opengl_application_buffer.cpp.

Member Function Documentation

 clear_buffer()

void Opengl_application_buffer::clear_buffer ( )

clear buffer

Definition at line 100 of file opengl_application_buffer.cpp.

 debug_write_buffer_to_file()

bool Opengl_application_buffer::debug_write_buffer_to_file ( nv::index::app::IApplication_layer *  app_layer,
std::string const &  fname 
)

debug: dump RGBA and Z to ppm image (no alpha)

Parameters
[in]app_layerapplication layer interface to use image component
[in]fnameoutput file basename. {fname}.rgba.ppm, and {fname}.z.ppm file will be created.
Returns
true when succeeded.

Definition at line 135 of file opengl_application_buffer.cpp.

 get_color_buffer_ptr()

mi::math::Color * Opengl_application_buffer::get_color_buffer_ptr ( )

Get Color buffer.

Definition at line 59 of file opengl_application_buffer.cpp.

 get_pixel_index()

static mi::Sint32 Opengl_application_buffer::get_pixel_index ( mi::Sint32  width,
mi::Sint32  height,
mi::Sint32  x,
mi::Sint32  y 
)
inlinestatic

get pixel index. Assume buffer size is less than 2G.

Definition at line 82 of file opengl_application_buffer.h.

 get_z_buffer_precision()

mi::Uint32 Opengl_application_buffer::get_z_buffer_precision ( ) const

Get Z-buffer precision (bits)

Returns
precision of z-buffer in bits

Definition at line 81 of file opengl_application_buffer.cpp.

 is_buffer_allocated()

bool Opengl_application_buffer::is_buffer_allocated ( ) const

is buffer allocated

Returns
true when the buffer is allocated.

Definition at line 124 of file opengl_application_buffer.cpp.

 is_use_color_buffer()

bool Opengl_application_buffer::is_use_color_buffer ( ) const

Is use color buffer (for debug)

Definition at line 47 of file opengl_application_buffer.cpp.

 resize_buffer()

void Opengl_application_buffer::resize_buffer ( mi::math::Vector_struct< mi::Uint32, 2 > const &  new_resolution)

resize the buffer.

usually causing memory allocation.

Parameters
[in]new_resolutionnew resolution of this buffer.

Definition at line 87 of file opengl_application_buffer.cpp.

 set_use_color_buffer()

void Opengl_application_buffer::set_use_color_buffer ( bool  is_use)

Set use color buffer (for debug)

Definition at line 53 of file opengl_application_buffer.cpp.

 set_z_buffer_precision()

void Opengl_application_buffer::set_z_buffer_precision ( mi::Uint32  precision)

Set Z-buffer precision (bits)

Parameters
[in]precisionof z-buffer in bits

Definition at line 65 of file opengl_application_buffer.cpp.


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