Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GLvoid GlPrint(const char* fmt, ...){
- char text[256];
- va_list ap;
- if (fmt == NULL) return;
- va_start(ap, fmt);
- vsprintf_s(text, 256, fmt, ap);
- va_end(ap);
- glPushAttrib(GL_LIST_BIT);
- glListBase(base - 32);
- glCallLists(strlen(text), GL_UNSIGNED_BYTE, text);
- glPopAttrib();
- }
- GLvoid GlText(HDC dc, const char* text, ERGB color, GLint x, GLint y) {
- RECT rect;
- GetWindowRect(WindowFromDC(dc), &rect);
- int width = rect.right - rect.left;
- int height = rect.bottom - rect.top;
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(0, width, height, 0, 0, 1);
- glDisable(GL_DEPTH_TEST);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0, 0, 0);
- glColor3f(RGB_TO_FLOAT(color.r, color.g, color.b));
- glRasterPos2i(x, y);
- GlPrint(text);
- glEnable(GL_DEPTH_TEST);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement