• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PrintText函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PrintText函数的典型用法代码示例。如果您正苦于以下问题:C++ PrintText函数的具体用法?C++ PrintText怎么用?C++ PrintText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了PrintText函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
}
开发者ID:agangzz,项目名称:CorsixTH-Android,代码行数:34,代码来源:checkkeys.c


示例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());
		}
	}
}
开发者ID:lightsgoout,项目名称:interview,代码行数:25,代码来源:gui_textbox.cpp


示例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;
	}
}
开发者ID:Stiju,项目名称:OrkBot,代码行数:32,代码来源:Tibia.cpp


示例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);
}
开发者ID:Aspekta,项目名称:xchataqua,代码行数:25,代码来源:identd.c


示例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"));
}
开发者ID:TheWug,项目名称:hexchat,代码行数:27,代码来源:inbound.c


示例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;
}
开发者ID:suntong,项目名称:zh-autoconvert,代码行数:31,代码来源:xchat-autogb.c


示例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
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:9,代码来源:vmidsr.cpp


示例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);
}
开发者ID:java131313,项目名称:sparkthreadpool,代码行数:12,代码来源:maindlg.cpp


示例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);

}
开发者ID:Leystryku,项目名称:mentranium,代码行数:14,代码来源:Menu.cpp


示例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 
开发者ID:berlinbrown,项目名称:OctaneMechOpenGLGame,代码行数:63,代码来源:globals.cpp


示例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);
    }
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:14,代码来源:i386bug.c


示例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);
}
开发者ID:JordanKinsley,项目名称:hexchat,代码行数:34,代码来源:cfgfiles.c


示例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;
    }
}
开发者ID:jiangguang5201314,项目名称:ZNginx,代码行数:28,代码来源:BACKPRNT.C


示例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;
}
开发者ID:TingPing,项目名称:conspire,代码行数:26,代码来源:country.c


示例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);
}
开发者ID:BackupTheBerlios,项目名称:utgs-svn,代码行数:7,代码来源:DDScreen.cpp


示例16: glFeedbackBuffer

void mglLine::scale( int rel_x, int rel_y, float x_dir, float y_dir )
{
    GLfloat* buff = new GLfloat[5];
    glFeedbackBuffer( 5, GL_2D, buff );
    dprintf("before scaling: x1=%d, y1=%d, x2=%d, y2=%d\n", x1, y1, x2, y2 ); 
    
    glRenderMode( GL_FEEDBACK );
    glPushMatrix();
       glScalef( x_dir, y_dir, 1 );
       draw();
    glPopMatrix();

    //int xdiff = (int)buff[1] - x1;
    //int ydiff = (int)buff[2] - y1;
    x1 = ((int)buff[1] );
    y1 = ((int)buff[2] );
    x2 = ((int)buff[3] );
    y2 = ((int)buff[4] );

    delete[] buff;
    dprintf("after scaling:  x1=%d, y1=%d, x2=%d, y2=%d\n", x1, y1, x2, y2 ); 
    
    char mstr[20];
    itoa( x1, mstr, 10 );
    PrintText( 50,50, mstr );
}
开发者ID:mrotaru,项目名称:cg_project_1,代码行数:26,代码来源:mglLine.cpp


示例17: identd

static int
identd (void *unused)
{
	int sok, read_sok, len;
	char *p;
	char buf[256];
	char outbuf[256];
	struct sockaddr_in addr;

	sok = socket (AF_INET, SOCK_STREAM, 0);
	if (sok == INVALID_SOCKET)
		return 0;

	len = 1;
	setsockopt (sok, SOL_SOCKET, SO_REUSEADDR, (char *) &len, sizeof (len));

	memset (&addr, 0, sizeof (addr));
	addr.sin_family = AF_INET;
	addr.sin_port = htons (113);

	if (bind (sok, (struct sockaddr *) &addr, sizeof (addr)) == SOCKET_ERROR)
	{
		closesocket (sok);
		return 0;
	}

	if (listen (sok, 1) == SOCKET_ERROR)
	{
		closesocket (sok);
		return 0;
	}

	len = sizeof (addr);
	read_sok = accept (sok, (struct sockaddr *) &addr, &len);
	closesocket (sok);
	if (read_sok == INVALID_SOCKET)
		return 0;

	snprintf (outbuf, sizeof (outbuf), "%%\tServicing ident request from %s\n",
				 inet_ntoa (addr.sin_addr));
	PrintText (menu_sess, outbuf);

	recv (read_sok, buf, sizeof (buf) - 1, 0);
	buf[sizeof (buf) - 1] = 0;	  /* ensure null termination */

	p = strchr (buf, ',');
	if (p)
	{
		snprintf (outbuf, sizeof (outbuf) - 1, "%d, %d : USERID : UNIX : %s\r\n",
					 atoi (buf), atoi (p + 1), prefs.username);
		outbuf[sizeof (outbuf) - 1] = 0;	/* ensure null termination */
		send (read_sok, outbuf, strlen (outbuf), 0);
	}

	sleep (1);
	closesocket (read_sok);
	identd_is_running = FALSE;

	return 0;
}
开发者ID:UIKit0,项目名称:picogui,代码行数:60,代码来源:identd.c


示例18: notify_showlist

void
notify_showlist (struct session *sess)
{
	char outbuf[256];
	struct notify *notify;
	GSList *list = notify_list;
	struct notify_per_server *servnot;
	int i = 0;

	EMIT_SIGNAL (XP_TE_NOTIFYHEAD, sess, NULL, NULL, NULL, NULL, 0);
	while (list)
	{
		i++;
		notify = (struct notify *) list->data;
		servnot = notify_find_server_entry (notify, sess->server);
		if (servnot && servnot->ison)
			snprintf (outbuf, sizeof (outbuf), _("  %-20s online\n"), notify->name);
		else
			snprintf (outbuf, sizeof (outbuf), _("  %-20s offline\n"), notify->name);
		PrintText (sess, outbuf);
		list = list->next;
	}
	if (i)
	{
		sprintf (outbuf, "%d", i);
		EMIT_SIGNAL (XP_TE_NOTIFYNUMBER, sess, outbuf, NULL, NULL, NULL, 0);
	} else
		EMIT_SIGNAL (XP_TE_NOTIFYEMPTY, sess, NULL, NULL, NULL, NULL, 0);
}
开发者ID:cremno,项目名称:hexchat,代码行数:29,代码来源:notify.c


示例19: identd_really_start

void
identd_really_start ()
{
	if (ident_sok >= 0)
		return;
	
	ident_sok = launch_identd_helper ();
	
	if (ident_sok < 0)
		PrintText (current_sess, "Unable to start identd\n");
	else
	{
		ident_tag = fe_input_add (ident_sok, FIA_READ, (input_callback)identd, NULL);
		PrintText (current_sess, "identd started\n");
	}
}
开发者ID:Aspekta,项目名称:xchataqua,代码行数:16,代码来源:identd.c


示例20: CreateObject

ObjectStruct* CreateObject(u16                          objectType, 
                           ObjectFunctionType           updateFunction, 
                           ObjectFunctionType           destroyFunction,
                           ObjectFunctionType           drawFunction,
                           ObjectCollisionFunctionType  collisionFunction)
{
    if (!CanCreateObject(objectType))
    {
        return 0;
    }

    // Tries to find a free slot in the object array. 
    // If there isn't, the object won't be created.

    ObjectCollection* objectCollection = objectCollections[objectType];

    u16 loop = 0;
    ObjectStruct* tempObjectList = objectCollection->objectList;
    u16 numAliveObjects = 0;
    u16 numDeadObjects = 0;
    for (; loop < objectCollection->maxActiveObjects; loop++)
    {
        ObjectStruct* object = tempObjectList;
        if (object->objectState == OBJECTSTATE_FREE)
        {
            totalActiveObjects++;
            object->updateFunction      = (ObjectFunctionTypePrototype)updateFunction;
            object->destroyFunction     = (ObjectFunctionTypePrototype)destroyFunction;
            object->drawFunction        = (ObjectFunctionTypePrototype)drawFunction;
            object->collisionFunction   = (ObjectCollisionFunctionPrototype)collisionFunction;
            object->objectState         = OBJECTSTATE_ACTIVE;
            object->objectType          = objectType;
            objectCollection->numActiveObjects++;

#ifdef DEBUG_OBJECT_MANAGEMENT
            KDebug_Alert("Created Object. Objects Total:");
            PrintNumber(totalActiveObjects);
#endif
            return object;
        }
        else if (object->objectState == OBJECTSTATE_ACTIVE)
        {
            numAliveObjects++;
        }
        else if (object->objectState == OBJECTSTATE_INACTIVE)
        {
            numDeadObjects++;
        }

        tempObjectList++;
    }
#ifdef DEBUG_OBJECT_MANAGEMENT
    KDebug_Alert("Could not add object. Too many created");
    PrintNumber(numAliveObjects);
    PrintNumber(numDeadObjects);
#endif
    PrintText("none avialable");
    return 0;
}
开发者ID:yoyz,项目名称:genesis,代码行数:59,代码来源:Objects.c



注:本文中的PrintText函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PrintTextf函数代码示例发布时间:2022-05-30
下一篇:
C++ PrintString函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap