Commit 8393d755 authored by Maksim Shabunin's avatar Maksim Shabunin

Fixed OpenGL-specific compilation warning (unused function)

parent 7474ad81
...@@ -56,53 +56,42 @@ using namespace cv::cuda; ...@@ -56,53 +56,42 @@ 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();
if (err != gl::NO_ERROR_)
{ {
GLenum err = gl::GetError(); const char* msg;
switch (err)
if (err != gl::NO_ERROR_)
{ {
const char* msg; case gl::INVALID_ENUM:
msg = "An unacceptable value is specified for an enumerated argument";
switch (err) break;
{ case gl::INVALID_VALUE:
case gl::INVALID_ENUM: msg = "A numeric argument is out of range";
msg = "An unacceptable value is specified for an enumerated argument"; break;
break; case gl::INVALID_OPERATION:
msg = "The specified operation is not allowed in the current state";
case gl::INVALID_VALUE: break;
msg = "A numeric argument is out of range"; case gl::OUT_OF_MEMORY:
break; msg = "There is not enough memory left to execute the command";
break;
case gl::INVALID_OPERATION: default:
msg = "The specified operation is not allowed in the current state"; msg = "Unknown error";
break; };
cvError(CV_OpenGlApiCallError, func, msg, file, line);
case gl::OUT_OF_MEMORY: return false;
msg = "There is not enough memory left to execute the command";
break;
default:
msg = "Unknown error";
};
cvError(CV_OpenGlApiCallError, func, msg, file, line);
return false;
}
return true;
} }
#endif return true;
}
#define CV_CheckGlError() CV_DbgAssert( (checkError(__FILE__, __LINE__, CV_Func)) ) #endif // HAVE_OPENGL
} // namespace } // namespace
#define CV_CheckGlError() CV_DbgAssert( (checkError(__FILE__, __LINE__, CV_Func)) )
#ifdef HAVE_OPENGL #ifdef HAVE_OPENGL
namespace namespace
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment