From fc1e2c3b9112c3b37030a48e610e4588d3745f5e Mon Sep 17 00:00:00 2001 From: cutealien Date: Fri, 15 Apr 2022 18:36:56 +0000 Subject: [PATCH] Rename some internal/unused draw2DImage function in COpenGLDriver to draw2DImageQuad to avoid warnings. Also added a bit documentation about what it's purpose seems to be (hope I got it right...). git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6336 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/COpenGLCoreTexture.h | 2 +- source/Irrlicht/COpenGLDriver.cpp | 4 ++-- source/Irrlicht/COpenGLDriver.h | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/source/Irrlicht/COpenGLCoreTexture.h b/source/Irrlicht/COpenGLCoreTexture.h index 071d4339..4e354a9e 100644 --- a/source/Irrlicht/COpenGLCoreTexture.h +++ b/source/Irrlicht/COpenGLCoreTexture.h @@ -318,7 +318,7 @@ public: glClear(GL_COLOR_BUFFER_BIT); - Driver->draw2DImage(this, layer, true); + Driver->draw2DImageQuad(this, layer, true); IImage* tmpImage = Driver->createImage(ECF_A8R8G8B8, Size); glReadPixels(0, 0, Size.Width, Size.Height, GL_RGBA, GL_UNSIGNED_BYTE, tmpImage->getData()); diff --git a/source/Irrlicht/COpenGLDriver.cpp b/source/Irrlicht/COpenGLDriver.cpp index 48662109..f508a066 100644 --- a/source/Irrlicht/COpenGLDriver.cpp +++ b/source/Irrlicht/COpenGLDriver.cpp @@ -1444,7 +1444,7 @@ void COpenGLDriver::draw2DImage(const video::ITexture* texture, const core::rect } -void COpenGLDriver::draw2DImage(const video::ITexture* texture, u32 layer, bool flip) +void COpenGLDriver::draw2DImageQuad(const video::ITexture* texture, u32 layer, bool flip) { if (!texture || !CacheHandler->getTextureCache().set(0, texture)) return; @@ -3968,7 +3968,7 @@ IImage* COpenGLDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RE if (format==video::ECF_UNKNOWN) format=getColorFormat(); - // TODO: Maybe we could support more formats (floating point and some of those beyond ECF_R8), didn't really try yet + // TODO: Maybe we could support more formats (floating point and some of those beyond ECF_R8), didn't really try yet if (IImage::isCompressedFormat(format) || IImage::isDepthFormat(format) || IImage::isFloatingPointFormat(format) || format >= ECF_R8) return 0; diff --git a/source/Irrlicht/COpenGLDriver.h b/source/Irrlicht/COpenGLDriver.h index b51890f8..b65efb36 100644 --- a/source/Irrlicht/COpenGLDriver.h +++ b/source/Irrlicht/COpenGLDriver.h @@ -147,7 +147,10 @@ namespace video const core::rect& sourceRect, const core::rect* clipRect = 0, const video::SColor* const colors = 0, bool useAlphaChannelOfTexture = false) IRR_OVERRIDE; - virtual void draw2DImage(const video::ITexture* texture, u32 layer, bool flip); + // Was some helper function used in previous texture locking. Currently not accessible for users + // and also no longer needed internally (unless we switch back to old texture lock code). + // It seems to draw the texture to a fullscreen quad. Also allows drawing one side of a cubemap texture. + void draw2DImageQuad(const video::ITexture* texture, u32 layer, bool flip); //! draws a set of 2d images, using a color and the alpha channel of the //! texture if desired.