mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 03:33:28 +08:00
Fixed OpenGL-specific compilation warning (unused function)
This commit is contained in:
parent
7474ad81d9
commit
8393d755f6
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user