BOOL __stdcall PHook::hkSwapBuffers(_In_ HDC hdc)
{
if (!init)
{
//MessageBox(NULL, "1", "2", MB_OK);
init = true;
}
HWND hwnd = GetForegroundWindow();
if (hwnd && checkptr())
{
POINT cur;
GetCursorPos(&cur);
ScreenToClient(hwnd, &cur);
PHook::SetupOrtho();
glShadeModel(GL_SMOOTH);
/*glBegin(GL_QUADS);
glColor4f(1.0F, 0.0F, 0.5F, 0.5F);
glVertex2f(cur.x + 50, cur.y + 30);
glVertex2f(cur.x + 250.0, cur.y + 30);
glVertex2f(cur.x + 250.0, cur.y + 250.0);
glVertex2f(cur.x + 50, cur.y + 250.0);
glEnd();*/
glColor4f(0.5F, 7.0F, 0.1F, 1.0F);
wglUseFontBitmaps(hdc, 0, 256, 1000);
glRasterPos2f(cur.x + 30.0, cur.y + 65.0);
glListBase(1000);
/*int screen[2];
glGetIntegerv(GL_VIEWPORT, screen);*/
char totxt[256];
char totxt2[256];
memset(totxt, 0, 256);
OemToCharA(buff2, totxt);
CharToOemA(buff2, totxt2);
glCallLists(10, GL_UNSIGNED_BYTE, totxt);
glRasterPos2f(cur.x + 30.0, cur.y + 80.0);
glCallLists(20, GL_UNSIGNED_BYTE, buff2);
glRasterPos2f(cur.x + 30.0, cur.y + 95.0);
glCallLists(20, GL_UNSIGNED_BYTE, totxt2);
glFlush();
glDeleteLists(1000, 256);
PHook::Restore();
}
return oSwapBuffers(hdc);
}