Fixed OpenGL-specific compilation warning (unused function)

This commit is contained in:
Maksim Shabunin 2018-02-09 13:21:17 +03:00
parent 7474ad81d9
commit 8393d755f6

View File

@ -57,51 +57,40 @@ using namespace cv::cuda;
namespace namespace
{ {
#ifndef HAVE_OPENGL #ifndef HAVE_OPENGL
inline void throw_no_ogl() { CV_Error(cv::Error::OpenGlNotSupported, "The library is compiled without OpenGL support"); } inline static void throw_no_ogl() { CV_Error(cv::Error::OpenGlNotSupported, "The library is compiled without OpenGL support"); }
#else #elif defined _DEBUG
inline void throw_no_ogl() { CV_Error(cv::Error::OpenGlApiCallError, "OpenGL context doesn't exist"); } inline static bool checkError(const char* file, const int line, const char* func = 0)
bool checkError(const char* file, const int line, const char* func = 0)
{ {
GLenum err = gl::GetError(); GLenum err = gl::GetError();
if (err != gl::NO_ERROR_) if (err != gl::NO_ERROR_)
{ {
const char* msg; const char* msg;
switch (err) switch (err)
{ {
case gl::INVALID_ENUM: case gl::INVALID_ENUM:
msg = "An unacceptable value is specified for an enumerated argument"; msg = "An unacceptable value is specified for an enumerated argument";
break; break;
case gl::INVALID_VALUE: case gl::INVALID_VALUE:
msg = "A numeric argument is out of range"; msg = "A numeric argument is out of range";
break; break;
case gl::INVALID_OPERATION: case gl::INVALID_OPERATION:
msg = "The specified operation is not allowed in the current state"; msg = "The specified operation is not allowed in the current state";
break; break;
case gl::OUT_OF_MEMORY: case gl::OUT_OF_MEMORY:
msg = "There is not enough memory left to execute the command"; msg = "There is not enough memory left to execute the command";
break; break;
default: default:
msg = "Unknown error"; msg = "Unknown error";
}; };
cvError(CV_OpenGlApiCallError, func, msg, file, line); cvError(CV_OpenGlApiCallError, func, msg, file, line);
return false; return false;
} }
return true; return true;
} }
#endif #endif // HAVE_OPENGL
} // namespace
#define CV_CheckGlError() CV_DbgAssert( (checkError(__FILE__, __LINE__, CV_Func)) ) #define CV_CheckGlError() CV_DbgAssert( (checkError(__FILE__, __LINE__, CV_Func)) )
} // namespace
#ifdef HAVE_OPENGL #ifdef HAVE_OPENGL
namespace namespace