From 2c3092ef280cb6b95c4f8fec88f8b0a2e469bb0a Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Fri, 15 Mar 2013 10:14:16 +0000 Subject: [PATCH] gpu: rename FrameBuffer to Framebuffer. --- src/gpu/framebuffer.cpp | 28 ++++++++++++++-------------- src/lol/gpu/framebuffer.h | 14 +++++++------- src/lol/gpu/shader.h | 2 +- tutorial/08_fbo.cpp | 6 +++--- tutorial/12_voronoi.cpp | 18 +++++++++--------- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/gpu/framebuffer.cpp b/src/gpu/framebuffer.cpp index 5ac1bf0e..363fe237 100644 --- a/src/gpu/framebuffer.cpp +++ b/src/gpu/framebuffer.cpp @@ -33,13 +33,13 @@ namespace lol { // -// The FrameBufferData class +// The FramebufferData class // ------------------------- // -class FrameBufferData +class FramebufferData { - friend class FrameBuffer; + friend class Framebuffer; ivec2 m_size; @@ -55,11 +55,11 @@ class FrameBufferData }; // -// The FrameBufferFormat struct +// The FramebufferFormat struct // ---------------------- // -uint32_t FrameBufferFormat::GetFormat() +uint32_t FramebufferFormat::GetFormat() { switch (m_format) { @@ -156,7 +156,7 @@ uint32_t FrameBufferFormat::GetFormat() return 0; } -uint32_t FrameBufferFormat::GetFormatOrder() +uint32_t FramebufferFormat::GetFormatOrder() { switch (m_format) { @@ -226,12 +226,12 @@ uint32_t FrameBufferFormat::GetFormatOrder() } // -// The FrameBuffer class +// The Framebuffer class // ---------------------- // -FrameBuffer::FrameBuffer(ivec2 size, FrameBufferFormat fbo_format) - : m_data(new FrameBufferData) +Framebuffer::Framebuffer(ivec2 size, FramebufferFormat fbo_format) + : m_data(new FramebufferData) { m_data->m_size = size; #if defined USE_D3D9 @@ -317,7 +317,7 @@ FrameBuffer::FrameBuffer(ivec2 size, FrameBufferFormat fbo_format) #endif } -FrameBuffer::~FrameBuffer() +Framebuffer::~Framebuffer() { #if defined USE_D3D9 || defined _XBOX m_data->m_surface->Release(); @@ -337,7 +337,7 @@ FrameBuffer::~FrameBuffer() delete m_data; } -ShaderTexture FrameBuffer::GetTexture() const +ShaderTexture Framebuffer::GetTexture() const { ShaderTexture ret; #if defined USE_D3D9 || defined _XBOX @@ -348,12 +348,12 @@ ShaderTexture FrameBuffer::GetTexture() const return ret; } -ivec2 FrameBuffer::GetSize() const +ivec2 Framebuffer::GetSize() const { return m_data->m_size; } -void FrameBuffer::Bind() +void Framebuffer::Bind() { #if defined USE_D3D9 || defined _XBOX if (FAILED(g_d3ddevice->GetRenderTarget(0, &m_data->m_back_surface))) @@ -371,7 +371,7 @@ void FrameBuffer::Bind() #endif } -void FrameBuffer::Unbind() +void Framebuffer::Unbind() { #if defined USE_D3D9 if (FAILED(g_d3ddevice->SetRenderTarget(0, m_data->m_back_surface))) diff --git a/src/lol/gpu/framebuffer.h b/src/lol/gpu/framebuffer.h index 787ebe82..e400cf81 100644 --- a/src/lol/gpu/framebuffer.h +++ b/src/lol/gpu/framebuffer.h @@ -9,7 +9,7 @@ // // -// The FrameBuffer class +// The Framebuffer class // --------------------- // @@ -21,7 +21,7 @@ namespace lol { -struct FrameBufferFormat +struct FramebufferFormat { enum Value { @@ -88,18 +88,18 @@ struct FrameBufferFormat m_format; bool m_invert_rgb; - inline FrameBufferFormat(Value format=RGBA_8, bool invert_rgb=true) + inline FramebufferFormat(Value format=RGBA_8, bool invert_rgb=true) : m_format(format), m_invert_rgb(invert_rgb) {} inline uint32_t GetFormat(); inline uint32_t GetFormatOrder(); inline operator Value() { return m_format; } }; -class FrameBuffer +class Framebuffer { public: - FrameBuffer(ivec2 size, FrameBufferFormat fbo_format=FrameBufferFormat()); - ~FrameBuffer(); + Framebuffer(ivec2 size, FramebufferFormat fbo_format = FramebufferFormat()); + ~Framebuffer(); ShaderTexture GetTexture() const; ivec2 GetSize() const; @@ -108,7 +108,7 @@ public: void Unbind(); private: - class FrameBufferData *m_data; + class FramebufferData *m_data; }; } /* namespace lol */ diff --git a/src/lol/gpu/shader.h b/src/lol/gpu/shader.h index 99e56e0d..5186cf70 100644 --- a/src/lol/gpu/shader.h +++ b/src/lol/gpu/shader.h @@ -49,7 +49,7 @@ private: struct ShaderTexture { friend class Shader; - friend class FrameBuffer; + friend class Framebuffer; friend class Texture; public: diff --git a/tutorial/08_fbo.cpp b/tutorial/08_fbo.cpp index b0f89ff2..002ac803 100644 --- a/tutorial/08_fbo.cpp +++ b/tutorial/08_fbo.cpp @@ -70,7 +70,7 @@ public: memcpy(vertices, &m_vertices[0], m_vertices.Bytes()); m_vbo->Unlock(); - m_fbo = new FrameBuffer(Video::GetSize()); + m_fbo = new Framebuffer(Video::GetSize()); m_fbo->Bind(); Video::SetClearColor(vec4(0.f, 0.f, 0.f, 1.f)); Video::SetClearDepth(1.f); @@ -90,7 +90,7 @@ public: #if _XBOX /* FIXME: the Xbox enforces full EDRAM clears on each frame, so * we cannot expect the render target contents to be preserved. - * This code snippet should be moved inside the FrameBuffer class. */ + * This code snippet should be moved inside the Framebuffer class. */ m_shader->SetUniform(m_uni_flag, 1.f); m_shader->SetUniform(m_uni_texture, m_fbo->GetTexture(), 0); m_vdecl->SetStream(m_vbo, m_coord); @@ -126,7 +126,7 @@ private: ShaderUniform m_uni_flag, m_uni_point, m_uni_color, m_uni_texture; VertexDeclaration *m_vdecl; VertexBuffer *m_vbo; - FrameBuffer *m_fbo; + Framebuffer *m_fbo; double m_time; vec3 m_hotspot, m_color; bool m_ready; diff --git a/tutorial/12_voronoi.cpp b/tutorial/12_voronoi.cpp index 0f173666..1630f72f 100644 --- a/tutorial/12_voronoi.cpp +++ b/tutorial/12_voronoi.cpp @@ -94,7 +94,7 @@ public: for (int i = 0; i < MaxFboType; ++i) { - m_fbos.Push(new FrameBuffer(Video::GetSize()), 0, Array(), Array() ); + m_fbos.Push(new Framebuffer(Video::GetSize()), 0, Array(), Array() ); if (i == SrcVoronoiFbo) { @@ -128,7 +128,7 @@ public: m_fbos.Last().m1->Unbind(); } - temp_buffer = new FrameBuffer(Video::GetSize()); + temp_buffer = new Framebuffer(Video::GetSize()); temp_buffer->Bind(); Video::SetClearColor(vec4(0.f, 0.f, 0.f, 1.f)); Video::SetClearDepth(1.f); @@ -223,8 +223,8 @@ public: int buf = voronoi_points.Count() % 2; for (int j = 0; j < voronoi_points.Count(); ++j) { - FrameBuffer *dst_buf; - FrameBuffer *src_buf; + Framebuffer *dst_buf; + Framebuffer *src_buf; if (buf) { @@ -275,8 +275,8 @@ public: int buf = 0; while (1) { - FrameBuffer *dst_buf; - FrameBuffer *src_buf; + Framebuffer *dst_buf; + Framebuffer *src_buf; Shader *shader; if (curres == ivec2(0)) @@ -305,7 +305,7 @@ public: #if _XBOX /* FIXME: the Xbox enforces full EDRAM clears on each frame, so * we cannot expect the render target contents to be preserved. - * This code snippet should be moved inside the FrameBuffer class. */ + * This code snippet should be moved inside the Framebuffer class. */ //m_fbos[m_cur_fbo].m2->SetUniform(m_uni_flag, 1.f); //m_fbos[m_cur_fbo].m2->SetUniform(m_uni_texture, m_fbo->GetTexture(), 0); //m_vdecl->SetStream(m_vbo, m_fbos[m_cur_fbo].m4.Last()); @@ -365,8 +365,8 @@ private: VertexDeclaration *m_vdecl; VertexBuffer *m_vbo; - Array, Array > m_fbos; - FrameBuffer *temp_buffer; + Array, Array > m_fbos; + Framebuffer *temp_buffer; int mode; int m_cur_fbo;