GLEWContext* glewGetContext()
48 returnNCBI_NS_NCBI::CGLGlewContext::GetInstance().GetGlewContext();
60CGLGlewContext& CGLGlewContext::GetInstance()
62 staticCGLGlewContext instance;
78 const char*
str=
reinterpret_cast<const char*
>(glGetString(GL_RENDERER));
83 _TRACE(
"GL_VERSION = "<< glGetString(GL_VERSION));
84 _TRACE(
"GL_RENDERER = "<< glGetString(GL_RENDERER));
85 _TRACE(
"GL_EXTENSIONS = "<< glGetString(GL_EXTENSIONS));
90 if(s.find(
"software renderer") != string::npos) {
92<<
"CGlUtils::GetAccelerated(): " 93 "auto-detected non-hardware-accelerated platform");
97<<
"CGlUtils::GetAccelerated(): " 98 "auto-detected hardware-accelerated platform");
113 const char*
value= getenv(
"NCBI_GBENCH_GLERROR");
135 msg=
"CGlUtils::CheckGlError(): unknown error";
138 caseGL_INVALID_OPERATION:
139 msg=
"CGlUtils::CheckGlError(): invalid operation";
142 caseGL_INVALID_ENUM:
143 msg=
"CGlUtils::CheckGlError(): invalid enum";
146 caseGL_INVALID_VALUE:
147 msg=
"CGlUtils::CheckGlError(): invalid value";
150 caseGL_STACK_OVERFLOW:
151 msg=
"CGlUtils::CheckGlError(): stack overflow";
154 caseGL_STACK_UNDERFLOW:
155 msg=
"CGlUtils::CheckGlError(): stack underflow";
158 caseGL_OUT_OF_MEMORY:
159 msg=
"CGlUtils::CheckGlError(): out of memory";
168GLint
error= glGetError();
169 if(
error== GL_NO_ERROR) {
210 LOG_POST(
Info<<
"OpenGL Vendor: "<< glGetString(GL_VENDOR));
211 LOG_POST(
Info<<
"OpenGL Renderer: "<< glGetString(GL_RENDERER));
212 LOG_POST(
Info<<
"OpenGL Version: "<< glGetString(GL_VERSION));
213 LOG_POST(
Info<<
"OpenGL Extensions: "<< glGetString(GL_EXTENSIONS));
218 floatprojection[16];
221glGetIntegerv(GL_VIEWPORT, viewport);
222glGetFloatv(GL_MODELVIEW_MATRIX, modelview);
223glGetFloatv(GL_PROJECTION_MATRIX, projection);
224glGetFloatv(GL_CURRENT_COLOR,
color);
227GLint green_bits = 0;
229GLint alpha_bits = 0;
230GLint depth_bits = 0;
231GLint stencil_bits = 0;
232glGetIntegerv(GL_RED_BITS, &red_bits);
233glGetIntegerv(GL_GREEN_BITS, &green_bits);
234glGetIntegerv(GL_BLUE_BITS, &blue_bits);
235glGetIntegerv(GL_ALPHA_BITS, &alpha_bits);
236glGetIntegerv(GL_DEPTH_BITS, &depth_bits);
237glGetIntegerv(GL_STENCIL_BITS, &stencil_bits);
241<<
" Red="<< red_bits <<
" bits" 242<<
" Green="<< green_bits <<
" bits" 243<<
" Blue="<< blue_bits <<
" bits" 244<<
" Alpha="<< alpha_bits <<
" bits");
245 LOG_POST(
Info<<
" Depth: "<< depth_bits <<
" bits");
246 LOG_POST(
Info<<
" Stencil: "<< alpha_bits <<
" bits");
249<< viewport[0] <<
", "<< viewport[1] <<
", " 250<< viewport[2] <<
", "<< viewport[3]);
255 for(
i= 0;
i< 4; ++
i) {
257 for(j = 0; j < 4; ++j) {
265 for(
i= 0;
i< 4; ++
i) {
267 for(j = 0; j < 4; ++j) {
279<< (glIsEnabled(GL_LIGHTING) ?
"enabled":
"disabled"));
281<< (glIsEnabled(GL_DEPTH_TEST) ?
"enabled":
"disabled"));
283<< (glIsEnabled(GL_CULL_FACE) ?
"enabled":
"disabled"));
285<< (glIsEnabled(GL_BLEND) ?
"enabled":
"disabled"));
287<< (glIsEnabled(GL_ALPHA_TEST) ?
"enabled":
"disabled"));
289<< (glIsEnabled(GL_TEXTURE_2D) ?
"enabled":
"disabled"));
294 #ifdef NCBI_OS_DARWIN 300 constGLdouble modelMatrix[16],
301 constGLdouble projMatrix[16],
302 constGLint viewport[4],
307GLKVector3
object{ (float)objx, (
float)objy, (float)objz };
308GLKMatrix4 model = GLKMatrix4Make(
309modelMatrix[0], modelMatrix[1], modelMatrix[2], modelMatrix[3],
310modelMatrix[4], modelMatrix[5], modelMatrix[6], modelMatrix[7],
311modelMatrix[8], modelMatrix[9], modelMatrix[10], modelMatrix[11],
312modelMatrix[12], modelMatrix[13], modelMatrix[14], modelMatrix[15]);
313GLKMatrix4 projection = GLKMatrix4Make(
314projMatrix[0], projMatrix[1], projMatrix[2], projMatrix[3],
315projMatrix[4], projMatrix[5], projMatrix[6], projMatrix[7],
316projMatrix[8], projMatrix[9], projMatrix[10], projMatrix[11],
317projMatrix[12], projMatrix[13], projMatrix[14], projMatrix[15]);
318GLKVector3
result= GLKMathProject(
object, model, projection,
const_cast<int*
>(viewport));
329 constGLdouble modelMatrix[16],
330 constGLdouble projMatrix[16],
331 constGLint viewport[4],
336GLKVector3 window{ (float)winx, (
float)winy, (float)winz };
337GLKMatrix4 model = GLKMatrix4Make(
338modelMatrix[0], modelMatrix[1], modelMatrix[2], modelMatrix[3],
339modelMatrix[4], modelMatrix[5], modelMatrix[6], modelMatrix[7],
340modelMatrix[8], modelMatrix[9], modelMatrix[10], modelMatrix[11],
341modelMatrix[12], modelMatrix[13], modelMatrix[14], modelMatrix[15]);
342GLKMatrix4 projection = GLKMatrix4Make(
343projMatrix[0], projMatrix[1], projMatrix[2], projMatrix[3],
344projMatrix[4], projMatrix[5], projMatrix[6], projMatrix[7],
345projMatrix[8], projMatrix[9], projMatrix[10], projMatrix[11],
346projMatrix[12], projMatrix[13], projMatrix[14], projMatrix[15]);
347 boolsuccess =
false;
348GLKVector3
result= GLKMathUnproject(window, model, projection,
const_cast<int*
>(viewport), &success);
352 return(success ? GL_TRUE : GL_FALSE);
static const char * str(char *buf, int n)
NCBI_XNCBI_EXPORT void Abort(void)
Smart abort function.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Info(CExceptionArgs_Base &args)
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.
static EAccelState m_Accel
static EGlDiagMode GetDiagnosticMode()
Get current diagnostic (error handling) mode.
static void DumpState()
Dump many of the most common OpenGL states.
static bool CheckGlError()
Check if there are any OpenGL errors.
static string GetErrMsg(GLint error)
Get message for specified OpenGL error.
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)
static EAccelState GetAccelerated(void)
Get the status of hardware acceleration.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)
Convert double to string.
const GenericPointer< typename T::ValueType > T2 value
int strcmp(const char *str1, const char *str2)
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
Standard mechanism to include OpenGL headers for all platforms.
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4