diff --git a/src/gl/data/gl_vertexbuffer.cpp b/src/gl/data/gl_vertexbuffer.cpp index 9fc8a08257..1bfcf76da9 100644 --- a/src/gl/data/gl_vertexbuffer.cpp +++ b/src/gl/data/gl_vertexbuffer.cpp @@ -122,8 +122,8 @@ void FSkyVertexBuffer::BindVBO() // //========================================================================== -FFlatVertexBuffer::FFlatVertexBuffer(int width, int height) -: FFlatVertexGenerator(width, height) +FGLFlatVertexBuffer::FGLFlatVertexBuffer(int width, int height) +: FFlatVertexBuffer(width, height) { mVertexBuffer = screen->CreateVertexBuffer(); mIndexBuffer = screen->CreateIndexBuffer(); @@ -142,7 +142,7 @@ FFlatVertexBuffer::FFlatVertexBuffer(int width, int height) Copy(0, NUM_RESERVED); } -FFlatVertexBuffer::~FFlatVertexBuffer() +FGLFlatVertexBuffer::~FGLFlatVertexBuffer() { delete mIndexBuffer; delete mVertexBuffer; @@ -150,20 +150,20 @@ FFlatVertexBuffer::~FFlatVertexBuffer() mVertexBuffer = nullptr; } -void FFlatVertexBuffer::Copy(int start, int count) +void FGLFlatVertexBuffer::Copy(int start, int count) { Map(); memcpy(GetBuffer(start), &vbo_shadowdata[0], count * sizeof(FFlatVertex)); Unmap(); } -void FFlatVertexBuffer::OutputResized(int width, int height) +void FGLFlatVertexBuffer::OutputResized(int width, int height) { - FFlatVertexGenerator::OutputResized(width, height); + FFlatVertexBuffer::OutputResized(width, height); Copy(4, 4); } -void FFlatVertexBuffer::Bind(FRenderState &state) +void FGLFlatVertexBuffer::Bind(FRenderState &state) { state.SetVertexBuffer(mVertexBuffer, 0, 0); state.SetIndexBuffer(mIndexBuffer); @@ -175,10 +175,10 @@ void FFlatVertexBuffer::Bind(FRenderState &state) // //========================================================================== -void FFlatVertexBuffer::CreateVBO() +void FGLFlatVertexBuffer::CreateVBO() { vbo_shadowdata.Resize(mNumReserved); - FFlatVertexGenerator::CreateVertices(); + FFlatVertexBuffer::CreateVertices(); mCurIndex = mIndex = vbo_shadowdata.Size(); Copy(0, mIndex); mIndexBuffer->SetData(ibo_data.Size() * sizeof(uint32_t), &ibo_data[0]); diff --git a/src/gl/data/gl_vertexbuffer.h b/src/gl/data/gl_vertexbuffer.h index 35615bf6d3..5ca52bfee5 100644 --- a/src/gl/data/gl_vertexbuffer.h +++ b/src/gl/data/gl_vertexbuffer.h @@ -86,7 +86,7 @@ public: void EnableColorArray(bool on); }; -class FFlatVertexBuffer : public FFlatVertexGenerator +class FGLFlatVertexBuffer : public FFlatVertexBuffer { IVertexBuffer *mVertexBuffer; IIndexBuffer *mIndexBuffer; @@ -103,8 +103,8 @@ class FFlatVertexBuffer : public FFlatVertexGenerator public: - FFlatVertexBuffer(int width, int height); - ~FFlatVertexBuffer(); + FGLFlatVertexBuffer(int width, int height); + ~FGLFlatVertexBuffer(); void OutputResized(int width, int height); void Bind(FRenderState &state); diff --git a/src/gl/renderer/gl_postprocess.cpp b/src/gl/renderer/gl_postprocess.cpp index 737c6d6ce4..2a1ec74e5a 100644 --- a/src/gl/renderer/gl_postprocess.cpp +++ b/src/gl/renderer/gl_postprocess.cpp @@ -54,7 +54,7 @@ void FGLRenderer::RenderScreenQuad() { mVBO->Bind(gl_RenderState); gl_RenderState.ApplyBuffers(); - glDrawArrays(GL_TRIANGLE_STRIP, FFlatVertexBuffer::PRESENT_INDEX, 4); + glDrawArrays(GL_TRIANGLE_STRIP, FGLFlatVertexBuffer::PRESENT_INDEX, 4); } void FGLRenderer::PostProcessScene(int fixedcm, const std::function &afterBloomDrawEndScene2D) diff --git a/src/gl/renderer/gl_renderer.cpp b/src/gl/renderer/gl_renderer.cpp index 1d43e1fb4d..9bd70b43c9 100644 --- a/src/gl/renderer/gl_renderer.cpp +++ b/src/gl/renderer/gl_renderer.cpp @@ -99,7 +99,7 @@ void FGLRenderer::Initialize(int width, int height) glBindVertexArray(mVAOID); FGLDebug::LabelObject(GL_VERTEX_ARRAY, mVAOID, "FGLRenderer.mVAOID"); - mVBO = new FFlatVertexBuffer(width, height); + mVBO = new FGLFlatVertexBuffer(width, height); mSkyVBO = new FSkyVertexBuffer; mLights = new FLightBuffer(); mViewpoints = new GLViewpointBuffer; diff --git a/src/gl/renderer/gl_renderer.h b/src/gl/renderer/gl_renderer.h index 66da27cd77..bc3e1a2177 100644 --- a/src/gl/renderer/gl_renderer.h +++ b/src/gl/renderer/gl_renderer.h @@ -16,7 +16,7 @@ struct particle_t; class FCanvasTexture; -class FFlatVertexBuffer; +class FGLFlatVertexBuffer; class FSkyVertexBuffer; class OpenGLFrameBuffer; struct FDrawInfo; @@ -69,7 +69,7 @@ public: //FRotator mAngles; - FFlatVertexBuffer *mVBO = nullptr; + FGLFlatVertexBuffer *mVBO = nullptr; FSkyVertexBuffer *mSkyVBO = nullptr; FLightBuffer *mLights = nullptr; GLViewpointBuffer *mViewpoints = nullptr; diff --git a/src/gl/scene/gl_drawinfo.cpp b/src/gl/scene/gl_drawinfo.cpp index c7eda62f6a..a723e80ea9 100644 --- a/src/gl/scene/gl_drawinfo.cpp +++ b/src/gl/scene/gl_drawinfo.cpp @@ -319,7 +319,7 @@ void FDrawInfo::ClearScreen() glDisable(GL_MULTISAMPLE); glDisable(GL_DEPTH_TEST); - glDrawArrays(GL_TRIANGLE_STRIP, FFlatVertexBuffer::FULLSCREEN_INDEX, 4); + glDrawArrays(GL_TRIANGLE_STRIP, FGLFlatVertexBuffer::FULLSCREEN_INDEX, 4); glEnable(GL_DEPTH_TEST); if (multi) glEnable(GL_MULTISAMPLE); diff --git a/src/hwrenderer/data/flatvertices.cpp b/src/hwrenderer/data/flatvertices.cpp index 1decb2c042..fd034b4ba3 100644 --- a/src/hwrenderer/data/flatvertices.cpp +++ b/src/hwrenderer/data/flatvertices.cpp @@ -39,7 +39,7 @@ // //========================================================================== -FFlatVertexGenerator::FFlatVertexGenerator(int width, int height) +FFlatVertexBuffer::FFlatVertexBuffer(int width, int height) { vbo_shadowdata.Resize(NUM_RESERVED); @@ -73,7 +73,7 @@ FFlatVertexGenerator::FFlatVertexGenerator(int width, int height) vbo_shadowdata[19].Set(32767.0f, -32767.0f, -32767.0f, 0, 0); } -void FFlatVertexGenerator::OutputResized(int width, int height) +void FFlatVertexBuffer::OutputResized(int width, int height) { vbo_shadowdata[4].Set(0, 0, 0, 0, 0); vbo_shadowdata[5].Set(0, (float)height, 0, 0, 1); @@ -118,7 +118,7 @@ static F3DFloor *Find3DFloor(sector_t *target, sector_t *model) // //========================================================================== -int FFlatVertexGenerator::CreateIndexedSubsectorVertices(subsector_t *sub, const secplane_t &plane, int floor, int vi, FFlatVertexGenerator::FIndexGenerationInfo &gen) +int FFlatVertexBuffer::CreateIndexedSubsectorVertices(subsector_t *sub, const secplane_t &plane, int floor, int vi, FFlatVertexBuffer::FIndexGenerationInfo &gen) { if (sub->numlines < 3) return -1; @@ -144,7 +144,7 @@ int FFlatVertexGenerator::CreateIndexedSubsectorVertices(subsector_t *sub, const // //========================================================================== -int FFlatVertexGenerator::CreateIndexedSectorVertices(sector_t *sec, const secplane_t &plane, int floor, FFlatVertexGenerator::FIndexGenerationInfo &gen) +int FFlatVertexBuffer::CreateIndexedSectorVertices(sector_t *sec, const secplane_t &plane, int floor, FFlatVertexBuffer::FIndexGenerationInfo &gen) { int rt = ibo_data.Size(); int vi = vbo_shadowdata.Reserve(gen.vertices.Size()); @@ -175,7 +175,7 @@ int FFlatVertexGenerator::CreateIndexedSectorVertices(sector_t *sec, const secpl // //========================================================================== -int FFlatVertexGenerator::CreateIndexedVertices(int h, sector_t *sec, const secplane_t &plane, int floor, TArray &gen) +int FFlatVertexBuffer::CreateIndexedVertices(int h, sector_t *sec, const secplane_t &plane, int floor, TArray &gen) { sec->vboindex[h] = vbo_shadowdata.Size(); // First calculate the vertices for the sector itself @@ -221,7 +221,7 @@ int FFlatVertexGenerator::CreateIndexedVertices(int h, sector_t *sec, const secp // //========================================================================== -void FFlatVertexGenerator::CreateIndexedFlatVertices() +void FFlatVertexBuffer::CreateIndexedFlatVertices() { TArray gen; gen.Resize(level.sectors.Size()); @@ -270,7 +270,7 @@ void FFlatVertexGenerator::CreateIndexedFlatVertices() // //========================================================================== -void FFlatVertexGenerator::UpdatePlaneVertices(sector_t *sec, int plane) +void FFlatVertexBuffer::UpdatePlaneVertices(sector_t *sec, int plane) { int startvt = sec->vboindex[plane]; int countvt = sec->vbocount[plane]; @@ -291,7 +291,7 @@ void FFlatVertexGenerator::UpdatePlaneVertices(sector_t *sec, int plane) // //========================================================================== -void FFlatVertexGenerator::CreateVertices() +void FFlatVertexBuffer::CreateVertices() { vbo_shadowdata.Resize(NUM_RESERVED); CreateIndexedFlatVertices(); @@ -303,7 +303,7 @@ void FFlatVertexGenerator::CreateVertices() // //========================================================================== -void FFlatVertexGenerator::CheckPlanes(sector_t *sector) +void FFlatVertexBuffer::CheckPlanes(sector_t *sector) { if (sector->GetPlaneTexZ(sector_t::ceiling) != sector->vboheight[sector_t::ceiling]) { @@ -324,7 +324,7 @@ void FFlatVertexGenerator::CheckPlanes(sector_t *sector) // //========================================================================== -void FFlatVertexGenerator::CheckUpdate(sector_t *sector) +void FFlatVertexBuffer::CheckUpdate(sector_t *sector) { CheckPlanes(sector); sector_t *hs = sector->GetHeightSec(); diff --git a/src/hwrenderer/data/flatvertices.h b/src/hwrenderer/data/flatvertices.h index 3025a6820d..4e907e911b 100644 --- a/src/hwrenderer/data/flatvertices.h +++ b/src/hwrenderer/data/flatvertices.h @@ -41,7 +41,7 @@ struct FFlatVertex } }; -class FFlatVertexGenerator +class FFlatVertexBuffer { protected: TArray vbo_shadowdata; @@ -84,7 +84,7 @@ public: NUM_RESERVED = 20 }; - FFlatVertexGenerator(int width, int height); + FFlatVertexBuffer(int width, int height); void OutputResized(int width, int height); diff --git a/src/hwrenderer/scene/hw_drawinfo.h b/src/hwrenderer/scene/hw_drawinfo.h index cb885202b3..2c029cf36b 100644 --- a/src/hwrenderer/scene/hw_drawinfo.h +++ b/src/hwrenderer/scene/hw_drawinfo.h @@ -64,7 +64,7 @@ struct FDynLightData; struct HUDSprite; class Clipper; class HWPortal; -class FFlatVertexGenerator; +class FFlatVertexBuffer; class IRenderQueue; class HWScenePortalBase; class FRenderState; @@ -194,7 +194,7 @@ struct HWDrawInfo BitArray CurrentMapSections; // this cannot be a single number, because a group of portals with the same displacement may link different sections. area_t in_area; fixed_t viewx, viewy; // since the nodes are still fixed point, keeping the view position also fixed point for node traversal is faster. - FFlatVertexGenerator *mVBO; // this class needs access because the sector vertex updating is part of BSP traversal. + FFlatVertexBuffer *mVBO; // this class needs access because the sector vertex updating is part of BSP traversal. private: diff --git a/src/hwrenderer/scene/hw_portal.cpp b/src/hwrenderer/scene/hw_portal.cpp index 923d68eede..aed2942bfb 100644 --- a/src/hwrenderer/scene/hw_portal.cpp +++ b/src/hwrenderer/scene/hw_portal.cpp @@ -187,8 +187,8 @@ void HWPortal::DrawPortalStencil(HWDrawInfo *di, FRenderState &state, int pass) { // The cap's depth handling needs special treatment so that it won't block further portal caps. if (pass == STP_DepthRestore) di->SetDepthRange(1, 1); - di->Draw(DT_TriangleFan, state, FFlatVertexGenerator::STENCILTOP_INDEX, 4); - di->Draw(DT_TriangleFan, state, FFlatVertexGenerator::STENCILBOTTOM_INDEX, 4); + di->Draw(DT_TriangleFan, state, FFlatVertexBuffer::STENCILTOP_INDEX, 4); + di->Draw(DT_TriangleFan, state, FFlatVertexBuffer::STENCILBOTTOM_INDEX, 4); if (pass == STP_DepthRestore) di->SetDepthRange(0, 1); } }