Skip to content

Commit

Permalink
gl_utils: Rename Framebuffer to avoid symbol collision
Browse files Browse the repository at this point in the history
Avoid collision with Drm Framebuffer
  • Loading branch information
mpiatka committed Oct 17, 2024
1 parent 83cf5b2 commit 98975b3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/video_display/opengl_conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class Rendering_convertor : public Frame_convertor{

GlProgram program;
Model quad;
Framebuffer fbuf;
Gl_framebuffer fbuf;
GLint width_uniform_location = -1;
Texture input_tex;
};
Expand Down
1 change: 0 additions & 1 deletion src/video_display/opengl_panorama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ void main(){
}
)END";


PanoramaScene::PanoramaScene(): PanoramaScene(GlProgram(persp_vert_src, persp_frag_src),
Model::get_sphere()) { }

Expand Down
2 changes: 1 addition & 1 deletion src/video_display/opengl_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ void Texture::allocate(){
}


void Framebuffer::attach_texture(GLuint tex){
void Gl_framebuffer::attach_texture(GLuint tex){
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
Expand Down
16 changes: 8 additions & 8 deletions src/video_display/opengl_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,23 +202,23 @@ class Texture{
/**
* RAII wrapper for an OpenGL framebuffer object
*/
class Framebuffer{
class Gl_framebuffer{
public:
/**
* Constructs a new framebuffer object
*/
Framebuffer(){
Gl_framebuffer(){
glGenFramebuffers(1, &fbo);
}

~Framebuffer(){
~Gl_framebuffer(){
glDeleteFramebuffers(1, &fbo);
}

Framebuffer(const Framebuffer&) = delete;
Framebuffer(Framebuffer&& o) { swap(o); }
Framebuffer& operator=(const Framebuffer&) = delete;
Framebuffer& operator=(Framebuffer&& o) { swap(o); return *this; }
Gl_framebuffer(const Gl_framebuffer&) = delete;
Gl_framebuffer(Gl_framebuffer&& o) { swap(o); }
Gl_framebuffer& operator=(const Gl_framebuffer&) = delete;
Gl_framebuffer& operator=(Gl_framebuffer&& o) { swap(o); return *this; }

/**
* Returns the underlying OpenGL framebuffer id
Expand All @@ -242,7 +242,7 @@ class Framebuffer{
}

private:
void swap(Framebuffer& o){
void swap(Gl_framebuffer& o){
std::swap(fbo, o.fbo);
}

Expand Down
4 changes: 2 additions & 2 deletions src/video_display/openxr_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class Gl_interop_swapchain{
return images[idx].image;
}

Framebuffer& get_framebuffer(size_t idx){
Gl_framebuffer& get_framebuffer(size_t idx){
return framebuffers[idx];
}

Expand Down Expand Up @@ -342,7 +342,7 @@ class Gl_interop_swapchain{
}

Openxr_swapchain xr_swapchain;
std::vector<Framebuffer> framebuffers;
std::vector<Gl_framebuffer> framebuffers;
std::vector<XrSwapchainImageOpenGLKHR> images;
};

Expand Down

0 comments on commit 98975b3

Please sign in to comment.