23 CFBORender::CFBORender(
unsigned int width,
unsigned int height,
const bool skip_glut_window ) :
26 m_win_used(!skip_glut_window),
27 m_default_bk_color(.6f,.6f,.6f,1)
29 #if MRPT_HAS_OPENCV && MRPT_HAS_OPENGL_GLUT 36 if(!glutGet(GLUT_INIT_STATE))
40 char *argv[1] = { NULL };
41 glutInit(&argc, argv);
45 m_win = glutCreateWindow(
"CFBORender");
54 #ifdef MRPT_OS_WINDOWS 80 # if defined(GL_TEXTURE_RECTANGLE_NV) 82 # elif defined(GL_TEXTURE_RECTANGLE_ARB) 110 #if MRPT_HAS_OPENGL_GLUT 148 #if MRPT_HAS_OPENCV && MRPT_HAS_OPENGL_GLUT 155 buffer.getChannelCount() != 3 ||
156 buffer.isOriginTopLeft() != false )
176 #if MRPT_HAS_OPENGL_GLUT 218 #if MRPT_HAS_OPENCV && MRPT_HAS_OPENGL_GLUT 234 # if defined(GL_TEXTURE_RECTANGLE_NV) 236 # elif defined(GL_TEXTURE_RECTANGLE_ARB) 263 #if MRPT_HAS_OPENGL_GLUT 267 const GLubyte *extensions = NULL;
272 where = (
GLubyte *) strchr(extension,
' ');
273 if (where || *extension ==
'\0')
282 where = (
GLubyte *) strstr((
const char *)
start, extension);
285 terminator = where + strlen(extension);
286 if (where ==
start || *(where - 1) ==
' ')
287 if (*terminator ==
' ' || *terminator ==
'\0')
#define ASSERT_EQUAL_(__A, __B)
GLAPI void GLAPIENTRY glDeleteTextures(GLsizei n, const GLuint *textures)
GLAPI void GLAPIENTRY glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
int isExtensionSupported(const char *extension)
Provide information on Framebuffer object extension.
GLAPI void GLAPIENTRY glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
A class for storing images as grayscale or RGB bitmaps.
#define THROW_EXCEPTION(msg)
void getFrame2(const COpenGLScene &scene, mrpt::utils::CImage &image)
Render the scene and get the rendered rgb image.
#define GL_TEXTURE_RECTANGLE_NV
mrpt::utils::TColorf m_default_bk_color
void(GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC)(GLsizei n, const GLuint *framebuffers)
GLAPI void GLAPIENTRY glBindTexture(GLenum target, GLuint texture)
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
CCamera & getCamera(const COpenGLScene &scene)
Get a reference to the scene camera.
void(GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC)(GLenum target, GLuint framebuffer)
virtual ~CFBORender()
Destructor.
COpenGLViewportPtr getViewport(const std::string &viewportName=std::string("main")) const
Returns the viewport with the given name, or NULL if it does not exist; note that the default viewpor...
#define glDeleteFramebuffersEXT
void render_text_messages(const int w, const int h) const
Renders the messages to the current opengl rendering context (to be called OUT of MRPT mrpt::opengl r...
#define GL_COLOR_ATTACHMENT0_EXT
#define GL_TEXTURE_RECTANGLE_EXT
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLAPI void GLAPIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
void setCamera(const COpenGLScene &scene, const CCamera &camera)
Change the scene camera.
void resize(unsigned int width, unsigned int height)
Resize the rendering canvas size.
GLAPI const GLubyte *GLAPIENTRY glGetString(GLenum name)
GLAPI void GLAPIENTRY glGenTextures(GLsizei n, GLuint *textures)
#define glFramebufferTexture2DEXT
#define glGenFramebuffersEXT
void render() const
Render this scene.
#define GL_FRAMEBUFFER_EXT
The namespace for 3D scene representation and rendering.
This class allows the user to create, load, save, and render 3D scenes using OpenGL primitives...
void(GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
#define glBindFramebufferEXT
#define GL_TEXTURE_RECTANGLE_ARB
A camera: if added to a scene, the viewpoint defined by this camera will be used instead of the camer...
GLenum GLsizei GLsizei height
void(GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC)(GLsizei n, GLuint *framebuffers)
GLAPI void GLAPIENTRY glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
void getFrame(const COpenGLScene &scene, mrpt::utils::CImage &image)
Render the scene and get the rendered rgb image.