Go to the documentation of this file.
38 #if MRPT_HAS_OPENGL_GLUT
40 glGenBuffers(1, &buffer);
41 this->buffer_id = buffer;
42 this->created_from = std::this_thread::get_id();
51 static const bool showErrs =
52 (::getenv(
"MRPT_REVEAL_OPENGL_BUFFER_LEAKS") !=
nullptr);
54 #if MRPT_HAS_OPENGL_GLUT
55 if (created_from == std::this_thread::get_id())
58 glDeleteBuffers(1, &buffer_id);
63 static double tLast = 0;
65 if (tNow - tLast > 2.0)
72 std::cerr <<
"[COpenGLBuffer::RAII_Impl] *Warning* Leaking memory "
73 "since Buffer was acquired from a different thread "
74 "and cannot free it from this thread, call stack:"
85 #if MRPT_HAS_OPENGL_GLUT
87 glBindBuffer(
static_cast<GLenum
>(
type), buffer_id);
93 #if MRPT_HAS_OPENGL_GLUT
95 if (created_from != std::this_thread::get_id())
return;
97 glBindBuffer(
static_cast<GLenum
>(
type), 0);
103 #if MRPT_HAS_OPENGL_GLUT
106 static_cast<GLenum
>(
type), byteCount,
data,
static_cast<GLenum
>(
usage));
static struct FontData data
static time_point now() noexcept
Returns the current time using the currently selected Clock source.
RAII_Impl(COpenGLBuffer::Type t)
std::string asString() const
Prints all backtrace entries, one per line in a human-readable format.
#define ASSERT_(f)
Defines an assertion mechanism.
static double toDouble(const time_point t) noexcept
Converts a timestamp to a UNIX time_t-like number, with fractional part.
void getCallStackBackTrace(TCallStackBackTrace &out_bt)
Returns a list of strings representing the current call stack backtrace.
See: getCallStackBackTrace()
std::shared_ptr< RAII_Impl > m_impl
The namespace for 3D scene representation and rendering.
void destroy()
Automatically called upon destructor, no need for the user to call it in normal situations.
void allocate(const void *data, int byteCount)
Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sun Jul 19 17:54:30 UTC 2020 | |