Go to the documentation of this file.
42 #include <OpenGL/gl.h>
70 GLRenderer(
unsigned width,
unsigned height,
float near = 0.1,
float far = 10.0);
116 GLuint
setShadersFromFile(
const std::string& vertex_filename,
const std::string& fragment_filename);
125 GLuint
setShadersFromString(
const std::string& vertex_shader,
const std::string& fragment_shader);
224 GLuint
loadShaders(
const std::string& vertex_source,
const std::string& fragment_source)
const;
233 GLuint
createShader(GLuint shaderID,
const std::string& source)
const;
299 static std::map<std::thread::id, std::pair<unsigned, GLuint> >
context_;
static void createGLContext()
create the OpenGL context if required. Only on context is created for each thread
void getColorBuffer(unsigned char *buffer) const
retrieves the color buffer from OpenGL
void initFrameBuffers()
initializes the frame buffer objects
float fy_
focal length in y-direction of camera in pixels
void setClippingRange(float near, float far)
sets the near and far clipping plane distances in meters
static bool glutInitialized_
void getDepthBuffer(float *buffer) const
retrieves the depth buffer from OpenGL
void callList(GLuint list) const
executes a OpenGL list
GLuint program_
handle to program that is currently used
GLuint getColorTexture() const
returns the handle of the color buffer as an OpenGL texture object
GLuint depth_id_
handle to depth buffer
void end() const
finalizes the frame buffers after rendering and/or manipulating
GLuint setShadersFromString(const std::string &vertex_shader, const std::string &fragment_shader)
loads, compiles, links and adds GLSL shaders from string to the current OpenGL context.
GLuint getDepthTexture() const
returns the handle of the depth buffer as an OpenGL texture object
GLuint fbo_id_
handle to frame buffer object
GLuint rgb_id_
handle to color buffer
const float & getNearClippingDistance() const
returns the distance of the near clipping plane in meters
GLuint setShadersFromFile(const std::string &vertex_filename, const std::string &fragment_filename)
loads, compiles, links and adds GLSL shaders from files to the current OpenGL context.
void setBufferSize(unsigned width, unsigned height)
set the size of fram buffers
static void deleteGLContext()
deletes OpenGL context for the current thread
float cx_
x-coordinate of principal point of camera in pixels
GLuint rbo_id_
handle to render buffer object
float cy_
y-coordinate of principal point of camera in pixels
GLuint createShader(GLuint shaderID, const std::string &source) const
create a OpenGL shader object from the shader source code
void begin() const
initializes the frame buffers for rendering and or manipulating
~GLRenderer()
destructor, destroys frame buffer objects and OpenGL context
MOVEIT_CLASS_FORWARD(Job)
void readShaderCodeFromFile(const std::string &filename, std::string &source) const
reads shader source code from file to a string
unsigned height_
height of frame buffer objects in pixels
GLRenderer(unsigned width, unsigned height, float near=0.1, float far=10.0)
constructs the frame buffer object in a new OpenGL context.
unsigned width_
width of frame buffer objects in pixels
float far_
distance of far clipping plane in meters
void deleteFrameBuffers()
deletes the frame buffer objects
void setCameraParameters() const
sets the OpenGL camera parameters
float fx_
focal length in x-direction of camera in pixels
unsigned getWidth() const
returns the width of the frame buffer objectsin pixels
static std::map< std::thread::id, std::pair< unsigned, GLuint > > context_
map from thread id to OpenGL context
const float & getFarClippingDistance() const
returns the distance of the far clipping plane in meters
GLuint loadShaders(const std::string &vertex_source, const std::string &fragment_source) const
Compiles, Links and adds the GLSL shaders from strings containing the source codes.
const GLuint & getProgramID() const
unsigned getHeight() const
returns the height of the frame buffer objects in pixels
float near_
distance of near clipping plane in meters
static std::mutex context_lock_
perception
Author(s): Ioan Sucan
, Jon Binney , Suat Gedikli
autogenerated on Sat Mar 15 2025 02:26:49