本文整理汇总了C++中consoleClear函数的典型用法代码示例。如果您正苦于以下问题:C++ consoleClear函数的具体用法?C++ consoleClear怎么用?C++ consoleClear使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了consoleClear函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: CMD
void CMD(void){
char CMD[256];
//int NUMBINPUT;
consoleClear();
iprintf("Weclome to debug screen\n");
while(1){
scanf("%s", CMD);
if(!strcmp(CMD, "/server")){
debug = true;
break;
}
else if((!strcmp(CMD, "/version")) || (!strcmp(CMD, "/ver"))){
iprintf("Version: %d\n", VERSION);
}
else if((!strcmp(CMD, "/help")) || (!strcmp(CMD, "/?"))){
iprintf("%s", HELP);
}
else if(!strcmp(CMD, "/back")){
consoleClear();
break;
}
else if(!strcmp(CMD, "/clear")){
consoleClear();
}
else if(!strcmp(CMD, "/exit")){
exit(0);
}
else{
iprintf("Unknown Command\n");
}
}
}
开发者ID:GimpTV,项目名称:wiicraft-code,代码行数:32,代码来源:main.cpp
示例2: FrameProc
bool FrameProc(){
bluVent bluMe = tblu->Input_PumpQueue();
if(bluMe.msg == KEYPRESS){
if(bluMe.keys == KEY_A){
for(int i = 0; i < 150; i++){
tblu->GFX_PlayAnimation(&bsp, &tban);
tblu->GFX_BltSpr(&bsp);
swiWaitForVBlank();
consoleClear();
iprintf("\x1b[10;0H Sprite= 1\n");
}
}
if(bluMe.keys == KEY_B){
for(int i = 0; i < 150; i++){
tblu->GFX_PlayAnimation(&bsp, &tban2);
tblu->GFX_BltSpr(&bsp);
swiWaitForVBlank();
consoleClear();
iprintf("\x1b[10;0H Sprite= 2\n");
}
}
if(bluMe.keys == KEY_DOWN){
bluVent b = {QUIT};
tblu->Input_PushEvent(b);
}
}
if(bluMe.msg == QUIT){
return true;
}
//this is just a test hope it works, if program, idles wait for input
tblu->Input_KeysPressed();
return false;
}
开发者ID:leffuy,项目名称:babycthulu,代码行数:34,代码来源:template.cpp
示例3: consoleSelect
void Display::clearGfx(){
consoleSelect(&subConsole);
consoleClear();
consoleSelect(&mainConsole);
consoleClear();
oamClear(&oamSub, 0, 0);
oamClear(&oamMain, 17, 110);
}
开发者ID:SBRK,项目名称:MIDI-Control-DS,代码行数:8,代码来源:display.cpp
示例4: main
int main(int argc, char** argv)
{
gfxInitDefault();
InitOutput();
consoleClear();
Print("Press A to begin...\n");
// unsigned int test_counter = 0; // Moving it here causes this app to refuse to boot at all.
while (aptMainLoop()) {
gfxFlushBuffers();
gfxSwapBuffers();
hidScanInput();
u32 kDown = hidKeysDown();
if (kDown & KEY_START) {
break;
} else if (kDown & KEY_A) {
consoleClear();
unsigned int test_counter = 0; // This configuration works, but obviously only test 0 would run.
TestCaller tests[] = {
FS::TestAll,
CPU::Integer::TestAll,
CPU::Memory::TestAll,
Kernel::TestAll,
GPU::TestAll
};
if (test_counter < (sizeof(tests) / sizeof(tests[0]))) {
tests[test_counter]();
test_counter++;
} else {
break;
}
Log("\n");
Print("Press A to continue...\n");
}
gspWaitForVBlank();
}
consoleClear();
gfxExit();
DeinitOutput();
return 0;
}
开发者ID:MerryMage,项目名称:hwtests,代码行数:54,代码来源:main.cpp
示例5: reset_screens
// Clears the screen and rewrites the "Made by" sentence
void reset_screens()
{
consoleSelect(&top_screen);
consoleClear();
set_font_color(cyan);
iprintf("Made by Lennart Kroes, s1062295");
consoleSelect(&bottom_screen);
consoleClear();
set_font_color(cyan);
iprintf("Made by Lennart Kroes, s1062295");
}
开发者ID:L3n-M3n,项目名称:SchoolCode,代码行数:12,代码来源:main.cpp
示例6: reset_screens
// Clears the screen and rewrites the "Made by" sentence on screen
void reset_screens()
{
Color default_color = yellow;
consoleSelect(&top_screen);
consoleClear();
set_font_color(default_color);
puts("Made by Lennart Kroes, s1062295\n");
consoleSelect(&bottom_screen);
consoleClear();
set_font_color(default_color);
puts("Made by Lennart Kroes, s1062295\n");
}
开发者ID:L3n-M3n,项目名称:SchoolCode,代码行数:13,代码来源:nintendo_ds.cpp
示例7: main
int main() {
gfxInitDefault();
consoleInit(GFX_TOP, NULL);
Filesystem fs;
std::string path = "pk/save/main";
if( fs.isInitialized() )
std::cout << "X: Export save file\nY: Inject save file\n\nSTART: Exit\n\n";
else
std::cout << "Failed to initialize filesystem, press START to exit.";
while(aptMainLoop()) {
hidScanInput();
u32 kDown = hidKeysDown();
if( fs.isInitialized() ) {
if(kDown & KEY_X) {
if( fs.exportSaveFile(path) )
std::cout << "Success! Savefile exported in " << path << ".\n";
else
std:: cout << "Failed!";
waitA();
consoleClear();
std::cout << "X: Export save file\nY: Inject save file\n\nSTART: Exit\n\n";
}
if(kDown & KEY_Y) {
if( fs.exportSaveFile(path) )
std::cout << "Success! Savefile imported\n";
else
std:: cout << "Failed!";
waitA();
consoleClear();
std::cout << "X: Export save file\nY: Inject save file\n\nSTART: Exit\n\n";
}
}
if(kDown & KEY_START) break;
gfxFlushBuffers();
gfxSwapBuffers();
gspWaitForVBlank();
}
gfxExit();
return 0;
}
开发者ID:Slashcash,项目名称:pkm-save-manager,代码行数:50,代码来源:main.cpp
示例8: action_download_json
void action_download_json()
{
consoleClear();
download_JSON();
load_JSON_data();
}
开发者ID:lavanoid,项目名称:CIAngel,代码行数:7,代码来源:main.cpp
示例9: updateConsole
static void updateConsole()
{
consoleClear();
iprintf("\n \x1b[36mLots of models\n Draw mode: %s\n Model: %s\n\n",
drawMode ? "LINES" : "TRIANGLES", getModelName());
}
开发者ID:lfzawacki,项目名称:ds-model-example,代码行数:7,代码来源:main.cpp
示例10: ui_pause
void ui_pause(const char* message) {
consoleSelect(&top_screen);
consoleClear();
printf("%s\n\n\n\n\nA = Continue", message);
gfxFlushBuffers();
gfxSwapBuffers();
gspWaitForVBlank();
while (aptMainLoop()) {
hidScanInput();
if (hidKeysDown() & KEY_A) {
consoleClear();
svcSleepThread(100000000);
break;
}
}
}
开发者ID:svanheulen,项目名称:mhx_data_manager,代码行数:16,代码来源:ui.c
示例11: consoleInitProgress
void consoleInitProgress(const char* header, const char* text, const float progress) {
consoleClear();
// Print progress bar borders
int progressBarY = consoleCurrent->consoleHeight / 2 - 1;
consoleCurrent->cursorY = progressBarY;
int startX = ProgressBarPadding;
int endX = consoleCurrent->consoleWidth - ProgressBarPadding + 1;
int startY = progressBarY;
for (int i = startX; i < endX; i++) {
// Draw left and right border
for (int j = 0; j < 12; j++) {
consoleCurrent->frameBuffer[((startX * 8 - 3) * 240) + (230 - (startY * 8)) + j] = 0xffff;
consoleCurrent->frameBuffer[((endX * 8 - 6) * 240) + (230 - (startY * 8)) + j] = 0xffff;
}
// Draw top and bottom borders
for (int j = 0; j < (i < endX - 1 ? 8 : 6); j++) {
consoleCurrent->frameBuffer[((i * 8 + j - 3) * 240) + (239 - (startY * 8 - 3))] = 0xffff;
consoleCurrent->frameBuffer[((i * 8 + j - 3) * 240) + (239 - ((startY + 1) * 8 + 2))] = 0xffff;
}
}
// Print header
consoleCurrent->cursorY = progressBarY - 2;
consoleCurrent->cursorX = ProgressBarPadding;
std::printf("%s%s%s", CONSOLE_YELLOW, header, CONSOLE_RESET);
// Set data
consoleSetProgressData(text, progress);
}
开发者ID:Hamcha,项目名称:lumaupdate,代码行数:33,代码来源:console.cpp
示例12: action_toggle_install
void action_toggle_install()
{
consoleClear();
CConfig::Mode nextMode = CConfig::Mode::INSTALL_CIA;
switch (config.GetMode())
{
case CConfig::Mode::DOWNLOAD_CIA:
nextMode = CConfig::Mode::INSTALL_CIA;
break;
case CConfig::Mode::INSTALL_CIA:
nextMode = CConfig::Mode::INSTALL_TICKET;
break;
case CConfig::Mode::INSTALL_TICKET:
nextMode = CConfig::Mode::DOWNLOAD_CIA;
break;
}
if (nextMode == CConfig::Mode::INSTALL_TICKET || nextMode == CConfig::Mode::INSTALL_CIA)
{
if (!bSvcHaxAvailable)
{
nextMode = CConfig::Mode::DOWNLOAD_CIA;
printf(CONSOLE_RED "Kernel access not available.\nCan't enable Install modes.\nYou can only make a CIA.\n" CONSOLE_RESET);
wait_key_specific("\nPress A to continue.", KEY_A);
}
}
config.SetMode(nextMode);
}
开发者ID:lavanoid,项目名称:CIAngel,代码行数:30,代码来源:main.cpp
示例13: main
int main(void) {
consoleDemoInit();
Keyboard *kbd = keyboardDemoInit();
kbd->OnKeyPressed = OnKeyPressed;
while(1) {
char myName[256];
iprintf("What is your name?\n");
scanf("%s", myName);
iprintf("\nHello %s", myName);
scanKeys();
while(!keysDown())scanKeys();
swiWaitForVBlank();
consoleClear();
}
return 0;
}
开发者ID:anitha2012,项目名称:evandrix.github.com,代码行数:26,代码来源:keymain.c
示例14: menu_cb_choose_file
s32 menu_cb_choose_file (s32 idx, void *param) {
s32 curidx = idx;
s32 loaded = 0;
while (aptMainLoop()) {
gspWaitForVBlank();
curidx = print_file_list(curidx, &g_file_list);
u32 kDown = wait_key();
if (kDown & KEY_B) {
break;
}
else if (kDown & KEY_A) {
consoleClear();
loaded = menu_execute_function(curidx, &g_file_list, &curidx);
printf("%s\n", loaded? "[+] Success":"[!] Failure");
wait_any_key();
if (loaded)
break;
}
else if (kDown & KEY_UP) {
curidx--;
}
else if (kDown & KEY_DOWN) {
curidx++;
}
gfxFlushBuffers();
gfxSwapBuffers();
}
return 0;
}
开发者ID:MuhamadYULIANTO,项目名称:arm9loaderhax,代码行数:32,代码来源:menus.c
示例15: consoleClear
void Menu::Main()
{
consoleClear();
printf("\n netxmms-nds\n ___________\n\n"
" A - CONNECT\n"
" B - CONFIGURE\n\n"
" START - INFORMATION");
while(1) {
swiWaitForVBlank();
scanKeys();
u32 entry = keysDown();
if(entry & KEY_A) {
Menu::ConnectWifi();
return;
}
else if(entry & KEY_B) {
Menu::Configuration();
return;
}
else if(entry & KEY_START) {
Menu::Information();
return;
}
}
}
开发者ID:blahblahson,项目名称:netxmms,代码行数:28,代码来源:menu.cpp
示例16: DSGM_InitText
void DSGM_InitText(DSGM_Layer *layer) {
DSGM_Debug("Init text: screen %d, layerNumber %d, vramId %d\n", layer->screen, layer->layerNumber, DSGM_text[layer->screen][layer->layerNumber].bgId);
ConsoleFont font;
if(layer->background != DSGM_DEFAULT_FONT) {
font.gfx = bgGetGfxPtr(layer->vramId);
DSGM_UnlockBackgroundPalette(layer->screen);
font.pal = (u16 *)&(layer->screen == DSGM_TOP ? VRAM_E_EXT_PALETTE : VRAM_H_EXT_PALETTE)[layer->layerNumber][0];
font.numColors = 2;
font.numChars = 127;
font.bpp = 4;
font.asciiOffset = 0;
font.convertSingleColor = false;
}
consoleInit(&DSGM_text[layer->screen][layer->layerNumber], layer->layerNumber, BgType_Text4bpp, BgSize_T_256x256, layer->mapBase, layer->tileBase, layer->screen, layer->background == DSGM_DEFAULT_FONT);
layer->vramId = DSGM_text[layer->screen][layer->layerNumber].bgId;
if(layer->background != DSGM_DEFAULT_FONT) {
consoleSetFont(&DSGM_text[layer->screen][layer->layerNumber], &font);
DSGM_LockBackgroundPalette(layer->screen);
}
DSGM_textLayer[layer->screen] = layer->layerNumber;
consoleSelect(&DSGM_text[layer->screen][layer->layerNumber]);
consoleClear();
}
开发者ID:CTurt,项目名称:dsgmLib,代码行数:30,代码来源:DSGM_text.c
示例17: main
int main()
{
consoleDemoInit();
uint ticks = 0;
TimerStates state = timerState_Stop;
int down = keysDown();
while(!(down & KEY_START))
{
swiWaitForVBlank();
consoleClear();
scanKeys();
down = keysDown();
if(state == timerState_Running)
{
ticks += timerElapsed(0);
}
if(down & KEY_A)
{
if(state == timerState_Stop)
{
timerStart(0, ClockDivider_1024, 0, NULL);
state = timerState_Running;
}
else if(state == timerState_Pause)
{
timerUnpause(0);
state = timerState_Running;
}
else if(state == timerState_Running)
{
ticks += timerPause(0);
state = timerState_Pause;
}
}
else if(down & KEY_B)
{
timerStop(0);
ticks = 0;
state = timerState_Stop;
}
iprintf("Press A to start and pause the \ntimer, B to clear the timer \nand start to quit the program.\n\n");
iprintf("ticks: %u\n", ticks);
iprintf("second: %u:%u\n", ticks/TIMER_SPEED, ((ticks%TIMER_SPEED)*1000) /TIMER_SPEED);
}
if(state != timerState_Stop)
{
timerStop(0);
}
return 0;
}
开发者ID:scallopedllama,项目名称:zoidbergengine,代码行数:57,代码来源:main.c
示例18: consoleOff
void consoleOff(void)
{
#if PLATFORM == WINDOWS
consoleClear( );
#elif PLATFORM == UNIX || PLATFORM == OSX
refresh( );
endwin( );
#endif
}
开发者ID:dwaynedwards,项目名称:WordPad,代码行数:9,代码来源:console.c
示例19: drawHelp
void drawHelp(void)
{
consoleSelect(&logConsole);
consoleClear();
printf(" Welcome in tvds, a tdvs clone.\n");
printf("\n");
switch (state)
{
case STATE_BROWSE:
{
printf("> [Up/Down] Select file/folder\n");
printf("> [L/R] Swap between Save/Sdmc folder\n");
printf("> [A] Navigate inside a folder\n");
printf("> [B] Return to the parent folder\n");
printf("> [X] Delete the current file/folder\n");
printf("> [Y] Copy the current file/folder\n");
break;
}
case STATE_BACKUP:
{
printf("> [Up/Down] Select backup\n");
printf("> [A] Inject the selected backup back\n");
printf("> [X] Delete the selected backup\n");
printf("> [Y] Create a new backup\n");
break;
}
default: break;
}
printf("> [Select] Print these instructions\n");
printf("> [Start] Exit tvds\n");
printf("\n");
consoleSelectDefault();
consoleSelect(&titleConsole);
consoleClear();
printf("Title id: 0x%016llx", titleid);
consoleSelectDefault();
}
开发者ID:gocario,项目名称:tvds,代码行数:44,代码来源:main.c
示例20: filePrintFileList
void filePrintFileList(const char *dir, int first, int select, int count, bool cancel = false)
{
if (select < first)
select = first;
consoleSelect(&lowerScreen);
consoleSetWindow(&lowerScreen, 0, 0, 32, 19);
consoleClear();
char *buf = (char*)data;
for (int i = 0; i < first; i++) {
buf = strchr(buf, '\n') + 1;
}
for (int i = first; (i < first + 18) && (i < count); i++) {
char *newline = strchr(buf, '\n');
int linelen = newline - buf;
*newline = 0;
if (*buf == 'd') {
if (i != select)
iprintf("[%.29s]\n", buf+1);
else
iprintf("-->[%.26s]\n", buf+1);
} else {
if (i != select)
iprintf("%.31s\n", buf+1);
else
iprintf("-->%.28s\n", buf+1);
}
*newline = '\n';
buf += linelen+1;
}
consoleSelect(&lowerScreen);
consoleSetWindow(&lowerScreen, 0, 18, 32, 6);
consoleClear();
iprintf("================================");
if (cancel)
iprintf(stringsGetMessageString(STR_FS_WRITE));
else
iprintf(stringsGetMessageString(STR_FS_READ));
}
开发者ID:suloku,项目名称:nds-savegame-manager,代码行数:43,代码来源:fileselect.cpp
注:本文中的consoleClear函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论