本文整理汇总了C++中PrintText函数的典型用法代码示例。如果您正苦于以下问题:C++ PrintText函数的具体用法?C++ PrintText怎么用?C++ PrintText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PrintText函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loop
void
loop()
{
SDL_Event event;
/* Check for events */
/*SDL_WaitEvent(&event); emscripten does not like waiting*/
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_KEYDOWN:
case SDL_KEYUP:
PrintKey(&event.key.keysym, (event.key.state == SDL_PRESSED) ? SDL_TRUE : SDL_FALSE, (event.key.repeat) ? SDL_TRUE : SDL_FALSE);
break;
case SDL_TEXTEDITING:
PrintText("EDIT", event.text.text);
break;
case SDL_TEXTINPUT:
PrintText("INPUT", event.text.text);
break;
case SDL_MOUSEBUTTONDOWN:
/* Any button press quits the app... */
case SDL_QUIT:
done = 1;
break;
default:
break;
}
}
#ifdef __EMSCRIPTEN__
if (done) {
emscripten_cancel_main_loop();
}
#endif
}
示例2: GetColor
void GUITextBox::Draw()
{
if(IsVisible())
{
COLOR4 color = GetColor();
Box(GetX(), GetY(), GetWidth(), GetHeight(),
color.r, color.g, color.b, color.a);
if(GetCaption() && GetCaptionFont())
{
COLOR4 c_color = GetCaptionColor();
glColor4ub(c_color.r, c_color.g, c_color.b, c_color.a);
PrintText(GetCaption(), GetCaptionFont(),
GetX() + GetCaptionX(), GetY() + GetCaptionY());
}
if(GetTextFont())
{
COLOR4 t_color = GetTextColor();
glColor4ub(t_color.r, t_color.g, t_color.b, t_color.a);
PrintText(GetText(), GetTextFont(),
GetX() + GetTextX(), GetY() + GetTextY());
}
}
}
示例3: timeGetTime
void CTibia::SpellTimers(void)
{
char buf[32];
int time;
unsigned int *pointer = (unsigned int*)Address::GAMESCREENPTR;
unsigned int *pointer2 = (unsigned int*)(*pointer + 0x30);
unsigned int *pointer3 = (unsigned int*)(*pointer2 + 0x04);
SGameScreen *gs = (SGameScreen*)(*pointer3);
int y = gs->Y, x = gs->X + gs->Width - 5;
unsigned int t = timeGetTime();
if(isMagicShield > t)
{
time = isMagicShield - t;
sprintf_s(buf, 32, "Magic Shield: %.2d:%.2d:%.1d", (time/1000/60), (time/1000 % 60), (time/100 % 10));
PrintText(1, x, y, 2, 0, 255, 255, buf, 2);
y += 12;
}
if(isInvisible > t)
{
time = isInvisible - t;
sprintf_s(buf, 32, "Invisible: %.2d:%.2d:%.1d", (time/1000/60), (time/1000 % 60), (time/100 % 10));
PrintText(1, x, y, 2, 255, 0, 255, buf, 2);
y += 12;
}
if(isHaste > t)
{
time = isHaste - t;
sprintf_s(buf, 32, "Haste: %.2d:%.2d:%.1d", (time/1000/60), (time/1000 % 60), (time/100 % 10));
PrintText(1, x, y, 2, 0, 255, 0, buf, 2);
y += 12;
}
}
示例4: identd
static void identd (void *arg, int c, void *cbd)
{
struct sockaddr_in addr;
socklen_t len = sizeof (addr);
int read_sok = accept (ident_sok, (struct sockaddr *) &addr, &len);
if (read_sok < 0)
{
//perror ("accept");
PrintText (current_sess, "Identd startup error. Restarting.\n");
identd_stop ();
identd_start ();
return;
}
char outbuf [256];
snprintf (outbuf, sizeof (outbuf), "%%\tServicing ident request from %s\n",
inet_ntoa (addr.sin_addr));
PrintText (current_sess, outbuf);
struct two_ints *x = (struct two_ints *)malloc(sizeof(struct two_ints));
x->sock = read_sok;
x->tag = fe_input_add (read_sok, FIA_READ, (input_callback)identd_reply, x);
}
示例5: dns_name_callback
static void
dns_name_callback (GObject *obj, GAsyncResult *result, gpointer user_data)
{
GResolver *resolver = G_RESOLVER(obj);
session *sess = (session*)user_data;
GList* addrs;
gchar* addr;
GList* list;
g_return_if_fail (is_session (sess));
addrs = g_resolver_lookup_by_name_finish (resolver, result, NULL);
if (addrs)
{
PrintText (sess, _("Resolved to:"));
for (list = g_list_first (addrs); list; list = g_list_next (list))
{
addr = g_inet_address_to_string (list->data);
PrintTextf (sess, " %s", addr);
}
g_resolver_free_addresses (addrs);
}
else
PrintText (sess, _("Not found"));
}
示例6: module_init
int module_init (int ver, struct module *mod, struct session *sess)
{
/* This check *MUST* be done first */
if (ver != MODULE_IFACE_VER)
return 1;
if (module_find (name) != NULL) {
/* We are already loaded */
PrintText(sess, "Module xchat-autogb already loaded\n");
return 1;
}
PrintText(sess, "Loaded module xchat-autogb\n");
mod->name = name;
mod->desc = desc;
chanmsg_sig.signal = XP_CHANMSG;
chanmsg_sig.callback = XP_CALLBACK(autogb_chanmsg);
chanmsg_sig.naddr = &chanmsg_next;
chanmsg_sig.mod = mod;
privmsg_sig.signal = XP_PRIVMSG;
privmsg_sig.callback = XP_CALLBACK(autogb_privmsg);
privmsg_sig.naddr = &privmsg_next;
privmsg_sig.mod = mod;
hook_signal(&chanmsg_sig);
hook_signal(&privmsg_sig);
big2gb_init();
return 0;
}
示例7: PrintText
void VM_Dsr::SymbolTableItem( CParseDsrSymbol *smb, long line, long level )
{
if( smb )
PrintText( smb->name, line, level );
#if _DEBUG
else
PrintText( QString( _T("/*!!! internal error: null symbol record !!!*/") ), line, level );
#endif
}
示例8: SPARK_INSTANCE_SWTICH_TO_WORKTHREAD
void CMainDlg::DoInWorkThread(int a, int b)
{
// 一行代码让此函数运行在线程中
SPARK_INSTANCE_SWTICH_TO_WORKTHREAD(CMainDlg, DoInWorkThread, a, b);
PrintText(L"工作线程ID:%d,开始工作,休息2秒", ::GetCurrentThreadId());
::Sleep(2000);
int n = a + b;
PrintText(L"工作线程ID:%d,完成工作,结果:%d", ::GetCurrentThreadId(), n);
}
示例9: PrintText
void cMenu::DrawTextBox(int index, int x, int y)
{
TextBoxes[index].x = x;
TextBoxes[index].y = y;
PrintText(TextBoxes[index].Name, x + 5, y - 15, White, Font.g_pFont);
PrintText(const_cast<char *>(TextBoxes[index].Variable->c_str()), x + 5, y + 5, White, Font.g_pFont);
if ( TextBoxes[index].Focused )
DrawNonFilledRectangle(x,y,100,20,Red);
else
DrawNonFilledRectangle(x,y,100,20,White);
}
示例10: PrintGlobals
//
// PrintGlobals
//
void PrintGlobals(void)
{
int i = 0;
#if HUD_ANTS
glRasterPos2i(10, 48+14);
PrintText("ANTS: %d", ant_globals->alive_ants);
#endif
#if HUD_SECS
glRasterPos2i(10, 48+28);
PrintText("TIME: %0.1f", ant_globals->seconds);
#endif
#if HUD_TIME_T
glRasterPos2i(10, 48+42);
PrintText("TIME_T: %0.0f", ant_globals->time_t);
#endif
#if HUD_NEST_FOOD
glRasterPos2i(10, 48+56);
PrintText("FOOD: %0.0f", ant_globals->nest_food);
//PrintText("FOOD: %ld", ant_globals.ticks);
#endif
#if HUD_GARDEN
glRasterPos2i(10, 48+70);
PrintText("GARD: %d", ant_globals->garden);
//PrintText("FOOD: %ld", ant_globals.ticks);
#endif
#if HUD_POS
// note: hud_NEST_FOOD must be turned off
glRasterPos2i(10, 48+56);
PrintText("x: %0.2f y: %0.2f", GetBotX(), GetBotY());
#endif
#if HUD_HEALTH
glRasterPos2i(10, 48+70);
PrintText("LIFE: %0.2f", ant_globals->player_health);
//PrintText("FOOD: %ld", ant_globals.ticks);
#endif
#if HUD_SCORE
for (i = 0; i < MAX_SCORE_DISPLAY; i++)
{
glRasterPos2i(10, (SCREEN_HEIGHT-14)-(i*14));
PrintText("P%d %0.2f %d",
ant_globals->score_obj[i].name,
ant_globals->score_obj[i].score,
ant_globals->score_obj[i].kills);
} // end of the for
#endif
} // end of the function
示例11: i386PrintFrames
void
i386PrintFrames(PKTRAP_FRAME TrapFrame)
{
FRAME *Frame;
PrintText("Frames:\n");
for (Frame = (FRAME*)TrapFrame->Ebp;
Frame != 0 && (ULONG_PTR)Frame < STACK32ADDR;
Frame = Frame->Next)
{
PrintText("%p ", Frame->Address);
}
}
示例12: set_showval
static void
set_showval (session *sess, const struct prefs *var, char *tbuf)
{
int len, dots, j;
len = strlen (var->name);
memcpy (tbuf, var->name, len);
dots = 29 - len;
if (dots < 0)
dots = 0;
tbuf[len++] = '\003';
tbuf[len++] = '2';
for (j=0;j<dots;j++)
tbuf[j + len] = '.';
len += j;
switch (var->type)
{
case TYPE_STR:
sprintf (tbuf + len, "\0033:\017 %s\n",
(char *) &prefs + var->offset);
break;
case TYPE_INT:
sprintf (tbuf + len, "\0033:\017 %d\n",
*((int *) &prefs + var->offset));
break;
case TYPE_BOOL:
if (*((int *) &prefs + var->offset))
sprintf (tbuf + len, "\0033:\017 %s\n", "ON");
else
sprintf (tbuf + len, "\0033:\017 %s\n", "OFF");
break;
}
PrintText (sess, tbuf);
}
示例13: PrintDlg_OnCommand
void PrintDlg_OnCommand(HWND hDlg, int id,HWND hwndCtl, UINT codeNotify)
{
char szText[256];
switch (id)
{
case IDC_PRINT:
GetDlgItemText(hDlg, IDC_EDIT_TEXT, szText, 256);
PrintText(hDlg, szText);
break;
case IDC_DISPLAY:
GetDlgItemText(hDlg, IDC_EDIT_TEXT, szText, 256);
PrintToDisplay(hDlg, szText);
break;
case IDCANCEL:
case IDM_EXIT:
PostMessage(GetParent(hDlg),WM_DESTROY,
(WPARAM)0, (LPARAM)0);
DestroyWindow(hDlgMain);
hDlgMain = NULL;
break;
default:
break;
}
}
示例14: cmd_country
CommandResult
cmd_country (struct session *sess, gchar *tbuf, gchar *word[], gchar *word_eol[])
{
gchar *code = word[2];
if (*code)
{
/* search? */
if (strcmp (code, "-s") == 0)
{
country_search (word[3], sess, (void *)PrintTextf);
return CMD_EXEC_OK;
}
/* search, but forgot the -s */
if (strchr (code, '*'))
{
country_search (code, sess, (void *)PrintTextf);
return CMD_EXEC_OK;
}
sprintf (tbuf, "%s = %s\n", code, country (code));
PrintText (sess, tbuf);
return CMD_EXEC_OK;
}
return CMD_EXEC_FAIL;
}
示例15: ZeroMemory
void DDScreen::PrintNum(int x, int y, int fixed, int fraction)
{
char text[40];
ZeroMemory(&text,40);
sprintf(text, "%8i.%8i", fixed, fraction );
PrintText(x,y,text);
}