本文整理汇总了C++中showcursor函数的典型用法代码示例。如果您正苦于以下问题:C++ showcursor函数的具体用法?C++ showcursor怎么用?C++ showcursor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showcursor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: r_core_visual_hud
static int r_core_visual_hud(RCore *core) {
const char *f = R2_LIBDIR"/radare2/"R2_VERSION"/hud/main";
char *homehud = r_str_home (R2_HOMEDIR"/hud");
char *res = NULL;
char *p = 0;
showcursor (core, R_TRUE);
if (homehud)
res = r_cons_hud_file (homehud);
if (!res) {
if (r_file_exists (f))
res = r_cons_hud_file (f);
else r_cons_message ("Cannot find hud file");
}
r_cons_clear ();
if (res) {
p = strchr (res, '\t');
core->printidx = 1;
r_cons_printf ("%s\n", res);
r_cons_flush ();
if (p) r_core_cmd0 (core, p+1);
free (res);
}
showcursor (core, R_FALSE);
r_cons_flush ();
free (homehud);
return (int)(size_t)p;
}
示例2: r_core_visual_hud
R_API int r_core_visual_hud(RCore *core) {
const char *c = r_config_get (core->config, "hud.path");
const char *f = R2_LIBDIR"/radare2/"R2_VERSION"/hud/main";
char *homehud = r_str_home (R2_HOMEDIR"/hud");
char *res = NULL;
char *p = 0;
showcursor (core, true);
if (c && *c && r_file_exists (c))
res = r_cons_hud_file (c);
if (!res && homehud)
res = r_cons_hud_file (homehud);
if (!res && r_file_exists (f))
res = r_cons_hud_file (f);
if (!res)
r_cons_message ("Cannot find hud file");
r_cons_clear ();
if (res) {
p = strchr (res, '\t');
r_cons_printf ("%s\n", res);
r_cons_flush ();
if (p) r_core_cmd0 (core, p+1);
free (res);
}
showcursor (core, false);
r_cons_flush ();
free (homehud);
return (int)(size_t)p;
}
示例3: r_core_visual_prompt
R_API int r_core_visual_prompt (RCore *core) {
char buf[1024];
int ret;
#if __UNIX__
r_line_set_prompt (Color_RESET":> ");
#else
r_line_set_prompt (":> ");
#endif
showcursor (core, true);
r_cons_fgets (buf, sizeof (buf), 0, NULL);
if (!strcmp (buf, "q")) {
ret = false;
} else if (*buf) {
r_line_hist_add (buf);
r_core_cmd (core, buf, 0);
r_cons_flush ();
ret = true;
} else {
ret = false;
//r_cons_any_key (NULL);
r_cons_clear00 ();
showcursor (core, false);
}
return ret;
}
示例4: r_core_visual_prompt
R_API int r_core_visual_prompt (RCore *core) {
char buf[1024];
int ret;
ut64 oseek = core->offset;
#if __UNIX__
r_line_set_prompt (Color_RESET":> ");
#else
r_line_set_prompt (":> ");
#endif
showcursor (core, R_TRUE);
r_cons_fgets (buf, sizeof (buf), 0, NULL);
if (*buf) {
r_line_hist_add (buf);
r_core_cmd (core, buf, 0);
r_cons_flush ();
ret = R_TRUE;
} else {
ret = R_FALSE;
//r_cons_any_key ();
r_cons_clear00 ();
showcursor (core, R_FALSE);
}
if (curset) r_core_seek (core, oseek, 1);
return ret;
}
示例5: main
/// Main loop and input handling
int main() {
hidecursor();
gen(level);
setColor(2);
printf("Welcome! Use WASD to move.\n");
setColor(6);
printf("Hit any key to start.\n");
anykey();
draw();
while (1) {
// Input
if (kbhit()) {
char k = getch();
int oldx = x, oldy = y;
if (k == 'a') { --x; ++moves; }
else if (k == 'd') { ++x; ++moves; }
else if (k == 'w') { --y; ++moves; }
else if (k == 's') { ++y; ++moves; }
else if (k == 27) break;
// Collisions
if (lvl[x][y] & WALL) { x = oldx; y = oldy; }
else if (lvl[x][y] & COIN) { coins++; lvl[x][y] ^= COIN; }
else if (lvl[x][y] & TORCH) { torch+=20; lvl[x][y] ^= TORCH; }
else if (lvl[x][y] & STAIRS_DOWN) gen(++level);
// Drawing
draw();
// Die
if (--torch <= 0) break;
}
}
showcursor();
return 0;
}
示例6: cursor_stay
void cursor_stay()
{
if ((cursor_shown == FALSE) || (in_startup_mode == TRUE)) {
cursor_shown = TRUE;
showcursor(TRUE);
}
}
示例7: fatal
void fatal(const char *s, ...) // failure exit
{
if(++errors <= 2) // print up to one extra recursive error
{
defvformatbigstring(msg, s, s);
if(logfile) logoutf("%s", msg);
#ifndef WIN32
fprintf(stderr, "%s\n", msg);
#endif
if(errors <= 1) // avoid recursion
{
if(SDL_WasInit(SDL_INIT_VIDEO))
{
showcursor(true);
SDL_WM_GrabInput(SDL_GRAB_OFF);
cleargamma();
}
#ifdef WIN32
defformatstring(cap, "%s: Error", VERSION_NAME);
MessageBox(NULL, msg, cap, MB_OK|MB_SYSTEMMODAL);
#endif
SDL_Quit();
}
}
exit(EXIT_FAILURE);
}
示例8: visual_search
// TODO: integrate in '/' command with search.inblock ?
static void visual_search (RCore *core) {
const ut8 *p;
int len, d = cursor;
char str[128], buf[258];
r_line_set_prompt ("search byte/string in block: ");
r_cons_fgets (str, sizeof (str), 0, NULL);
len = r_hex_str2bin (str, (ut8*)buf);
if (*str=='"') {
char *e = strncpy (buf, str+1, sizeof (buf)-1);
if (e) { --e; if (*e=='"') *e=0; }
len = strlen (buf);
} else
if (len<1) {
strncpy (buf, str, sizeof (buf)-1);
len = strlen (str);
}
p = r_mem_mem (core->block+d, core->blocksize-d,
(const ut8*)buf, len);
if (p) {
cursor = (int)(size_t)(p-core->block);
if (len>1) {
ocursor = cursor+len-1;
} else ocursor = -1;
showcursor (core, true);
eprintf ("FOUND IN %d\n", cursor);
r_cons_any_key (NULL);
} else {
eprintf ("Cannot find bytes\n");
r_cons_any_key (NULL);
r_cons_clear00 ();
}
}
示例9: cursor_stay
void cursor_stay()
{
if ((cursor_shown == false) || (in_startup_mode == true))
{
cursor_shown = true;
showcursor(true);
}
}
示例10: cursor_go
void cursor_go()
{
if (in_startup_mode == TRUE)
return;
if (cursor_shown == TRUE) {
cursor_shown = FALSE;
showcursor(FALSE);
}
}
示例11: quit
void quit(World *world) {
//cls();
locate(1, 1);
setColor(WHITE);
printf("GAME OVER\nRESULTS:[LEVEL: %d HP:%d LIFE:%d]\n", world->level.level,
world->player.hp, world->player.life);
showcursor();
exit(EXIT_SUCCESS);
}
示例12: inputgrab
void inputgrab(bool on)
{
#ifndef WIN32
if(!(screen->flags & SDL_FULLSCREEN)) SDL_WM_GrabInput(SDL_GRAB_OFF);
else
#endif
SDL_WM_GrabInput(on ? SDL_GRAB_ON : SDL_GRAB_OFF);
showcursor(!on);
}
示例13: cursor_go
void cursor_go()
{
if (in_startup_mode == true) return;
if (cursor_shown == true)
{
cursor_shown = false;
showcursor(false);
}
}
示例14: check_game_done
void check_game_done()
{
through_sending();
if (All_Done == true)
{
lose_graphics();
showcursor(true);
PostQuitMessage(0);
}
}
示例15: tty_fix
int tty_fix (void)
{
if (!havemodes)
{
return 0;
}
showcursor();
/* "stty sane" */
return tcsetattr(fileno(stdin), TCSANOW, &savemodes);
}