MCPcopy Create free account
hub / github.com/JACoders/OpenJK / UI_DrawGLInfo

Function UI_DrawGLInfo

code/ui/ui_main.cpp:3730–3772  ·  view source on GitHub ↗

================= UI_DrawKeyBindStatus ================= */

Source from the content-addressed store, hash-verified

3728=================
3729*/
3730static void UI_DrawGLInfo(rectDef_t *rect, float scale, vec4_t color, int textStyle, int iFontIndex)
3731{
3732#define MAX_LINES 64
3733 char buff[4096];
3734 char * eptr = buff;
3735 const char *lines[MAX_LINES];
3736 int y, numLines=0, i=0;
3737
3738 y = rect->y;
3739 Text_Paint(rect->x, y, scale, color, va("GL_VENDOR: %s",uiInfo.uiDC.glconfig.vendor_string), rect->w, textStyle, iFontIndex);
3740 y += 15;
3741 Text_Paint(rect->x, y, scale, color, va("GL_VERSION: %s: %s", uiInfo.uiDC.glconfig.version_string,uiInfo.uiDC.glconfig.renderer_string), rect->w, textStyle, iFontIndex);
3742 y += 15;
3743 Text_Paint(rect->x, y, scale, color, "GL_PIXELFORMAT:", rect->w, textStyle, iFontIndex);
3744 y += 15;
3745 Text_Paint(rect->x, y, scale, color, va ("Color(%d-bits) Z(%d-bits) stencil(%d-bits)",uiInfo.uiDC.glconfig.colorBits, uiInfo.uiDC.glconfig.depthBits, uiInfo.uiDC.glconfig.stencilBits), rect->w, textStyle, iFontIndex);
3746 y += 15;
3747 // build null terminated extension strings
3748 Q_strncpyz(buff, uiInfo.uiDC.glconfig.extensions_string, sizeof(buff));
3749 int testy=y-16;
3750 while ( testy <= rect->y + rect->h && *eptr && (numLines < MAX_LINES) )
3751 {
3752 while ( *eptr && *eptr == ' ' )
3753 *eptr++ = '\0';
3754
3755 // track start of valid string
3756 if (*eptr && *eptr != ' ')
3757 {
3758 lines[numLines++] = eptr;
3759 testy+=16;
3760 }
3761
3762 while ( *eptr && *eptr != ' ' )
3763 eptr++;
3764 }
3765
3766 numLines--;
3767 while (i < numLines)
3768 {
3769 Text_Paint(rect->x, y, scale, color, lines[i++], rect->w, textStyle, iFontIndex);
3770 y += 16;
3771 }
3772}
3773
3774/*
3775=================

Callers 1

UI_OwnerDrawFunction · 0.70

Calls 3

Q_strncpyzFunction · 0.85
Text_PaintFunction · 0.70
vaFunction · 0.50

Tested by

no test coverage detected