1 #ifndef GUI_OPENGL___GL_UTILS__HPP
2 #define GUI_OPENGL___GL_UTILS__HPP
74 static bool CheckGlError();
80 static string GetErrMsg(GLint
error);
83 static void DumpState();
87 static EAccelState GetAccelerated(
void);
102 #define CHECK_GLERROR() {\
103 GLint error = glGetError(); \
104 if (error != GL_NO_ERROR) { \
105 static CGlUtils::EGlDiagMode mode = CGlUtils::GetDiagnosticMode(); \
106 string msg = CGlUtils::GetErrMsg(error); \
109 case CGlUtils::eLogPost: \
110 LOG_POST(Error << msg); \
112 case CGlUtils::eAbort: \
113 LOG_POST(Error << msg); \
116 case CGlUtils::eThrow: \
117 NCBI_THROW(COpenGLException, eGlError, msg); \
119 case CGlUtils::eUndefined: \
120 case CGlUtils::eIgnore: \
151 static CGLGlewContext& GetInstance();
153 GLEWContext* GetGlewContext() {
return m_GLEWContext; }
154 void SetGlewContext(GLEWContext* gc) { m_GLEWContext = gc; }
157 CGLGlewContext() : m_GLEWContext(
NULL) {}
158 GLEWContext* m_GLEWContext;
179 glColor4fv(
color.GetColorArray());
197 #ifdef NCBI_OS_DARWIN
203 const GLdouble modelMatrix[16],
204 const GLdouble projMatrix[16],
205 const GLint viewport[4],
214 const GLdouble modelMatrix[16],
215 const GLdouble projMatrix[16],
216 const GLint viewport[4],
227 const GLdouble modelMatrix[16],
228 const GLdouble projMatrix[16],
229 const GLint viewport[4],
234 return gluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, winx, winy, winz);
241 const GLdouble modelMatrix[16],
242 const GLdouble projMatrix[16],
243 const GLint viewport[4],
248 return gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz);
CGlAttrGuard - guard class for restoring OpenGL attributes.
class CRgbaColor provides a simple abstraction for managing colors.
Include a standard set of the NCBI C++ Toolkit most basic headers.
int gluProjectX(GLdouble objx, GLdouble objy, GLdouble objz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *winx, GLdouble *winy, GLdouble *winz)
EAccelState
status of hardware acceleration.
void glRectC(const TModelRect &rc)
static EAccelState m_Accel
static void DumpState()
Dump many of the most common OpenGL states.
CGlAttrGuard(GLbitfield mask)
void glColorC(const CRgbaColor &color)
static void SetAccelerated(EAccelState acc)
Set the status of hardware acceleration.
int gluUnProjectX(GLdouble winx, GLdouble winy, GLdouble winz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *objx, GLdouble *objy, GLdouble *objz)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define NCBI_GUIOPENGL_EXPORT