本文整理汇总了C++中doupdate函数的典型用法代码示例。如果您正苦于以下问题:C++ doupdate函数的具体用法?C++ doupdate怎么用?C++ doupdate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了doupdate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: CON_Print
/*
==================
CON_Print
==================
*/
void CON_Print(const char *msg)
{
int col;
bool scroll = (lastline > scrollline && lastline <= scrollline + LOG_LINES);
if (!curses_on) {
CON_Print_tty(msg);
return;
}
// Print the message in the log window
CON_ColorPrint(logwin, msg, qtrue);
getyx(logwin, lastline, col);
if (col)
lastline++;
if (scroll) {
scrollline = lastline - LOG_LINES;
if (scrollline < 0)
scrollline = 0;
pnoutrefresh(logwin, scrollline, 0, 2, 1, LOG_LINES + 1, LOG_COLS + 1);
}
// Add the message to the log buffer
if (insert + strlen(msg) >= logbuf + sizeof(logbuf)) {
memmove(logbuf, logbuf + sizeof(logbuf) / 2, sizeof(logbuf) / 2);
memset(logbuf + sizeof(logbuf) / 2, 0, sizeof(logbuf) / 2);
insert -= sizeof(logbuf) / 2;
}
strcpy(insert, msg);
insert += strlen(msg);
// Update the scrollbar
CON_DrawScrollBar();
// Move the cursor back to the input field
CON_UpdateCursor();
doupdate();
}
开发者ID:DolceTriade,项目名称:OpenWolf,代码行数:43,代码来源:con_curses.cpp
示例2: doupdate
int STRUM2::run()
{
for (int i = 0; i < framesToRun(); i++) {
if (--_branch <= 0) {
doupdate();
_branch = getSkip();
}
float out[2];
out[0] = _strum->next() * _amp;
if (outputChannels() == 2) {
out[1] = out[0] * (1.0f - _pan);
out[0] *= _pan;
}
rtaddout(out);
increment();
}
return framesToRun();
}
开发者ID:RTcmix,项目名称:RTcmix,代码行数:23,代码来源:STRUM2.cpp
示例3: va_start
int
shNCursesInterface::diag (const char *format, ...)
{
int res;
va_list ap;
mColor = kMagenta;
va_start (ap, format);
char dbgbuf[100];
res = vsnprintf (dbgbuf, 100, format, ap);
if (mWin[kDiag]) {
wattrset (mWin[kDiag], ColorMap[kCyan]);
waddstr (mWin[kDiag], dbgbuf);
waddch (mWin[kDiag], '\n');
touchwin (mWin[kDiag]);
wnoutrefresh (mWin[kDiag]);
doupdate ();
}
debug.log ("%s", dbgbuf);
va_end (ap);
mColor = kGray;
return res;
}
开发者ID:ronw23,项目名称:prime-osx,代码行数:23,代码来源:NCUI.cpp
示例4: run
int PAN :: run()
{
const int samps = framesToRun() * inputChannels();
rtgetin(in, this, samps);
for (int i = 0; i < samps; i += inputChannels()) {
if (--branch <= 0) {
doupdate();
branch = skip;
}
float insig = in[i + inchan] * amp;
float out[2];
out[0] = insig * pan[0];
out[1] = insig * pan[1];
rtaddout(out);
increment();
}
return framesToRun();
}
开发者ID:CreativeInquiry,项目名称:RTcmix,代码行数:23,代码来源:PAN.cpp
示例5: showmenu
void showmenu(struct MENU *menu)
{
struct ITEM *itemptr; /* points to each item in turn */
int ctr = 1; /* counts each item */
wattrset(menu->menuwin, BOXATTR); /* set to bg+/b */
colorwin(menu->menuwin); /* color window */
box(menu->menuwin, ACS_VLINE, ACS_HLINE); /* draw border */
itemptr = menu->itemlist; /* point to start */
wattrset(menu->menuwin, STDATTR);
do { /* display items */
wmove(menu->menuwin, ctr, 1);
showitem(menu, itemptr, NOTSELECTED); /* show items, initially unselected */
ctr++;
itemptr = itemptr->next;
} while (ctr <= menu->itemcount);
update_panels();
doupdate();
}
开发者ID:saintkepha,项目名称:airtraf,代码行数:23,代码来源:menurt.c
示例6: timeout
void Ozette::run() {
if (_editors.empty()) show_browser();
timeout(100);
do {
if (sig_io_flag.exchange(false)) {
_shell.poll();
}
int ch = fix_control_quirks(getch());
switch (ch) {
case Control::UpArrow: show_browser(); break;
case Control::NewFile: new_file(); break;
case Control::Open: open_file(); break;
case Control::Directory: change_directory(); break;
case Control::Help: show_help(); break;
case Control::Execute: execute(); break;
case KEY_F(4): search(); break;
case KEY_F(5): build(); break;
default: _done |= !_shell.process(ch);
}
update_panels();
doupdate();
} while (!_done);
}
开发者ID:marssaxman,项目名称:ozette,代码行数:23,代码来源:ozette.cpp
示例7: render_cb
/*
* render_cb
*
* Called by the rendering loop, which is the tightest of the event loops.
* It writes any modified state to the screen, and tries not to calculate much
* itself, since it has to return quickly.
* Repeat: .02 seconds
*/
void render_cb(EV_P_ ev_timer *w, int revents)
{
spin_render_loop();
if (game_is_paused)
pause_loop();
tick();
free_nouns();
update_nouns();
dock_update();
print_dock();
update_map_control();
update_panels(); /* Were slowing down performance, unnecessary */
doupdate();
MAPBOOK->restack(ACTIVE);
map_refresh(ACTIVE);
ev_timer_again(EV_DEFAULT, w);
}
开发者ID:linehan,项目名称:barnacle,代码行数:31,代码来源:loop.c
示例8: readline_recreate
/**
* Recreate the 2 readline panels with respect to the screen size.
*
* @param rows Size of the screen in rows
* @param cols Size of the screen in cols
* @return Void
*/
void
readline_recreate(int rows, int cols)
{
struct term_window_size newsize = {
.rows = 1,
.cols = cols,
.start_row = rows - 1,
.start_col = 0,
};
readline_pan1 = term_resize_panel(readline_pan1, &newsize);
readline_pan2 = term_resize_panel(readline_pan2, &newsize);
apply_readline_options(panel_window(readline_pan1));
apply_readline_options(panel_window(readline_pan2));
}
/**
* Puts the currently active readline panel on the top of all panels
* in the stack.
*/
void
readline_top_panel(void)
{
if (panel_state == PANEL1_ACTIVE) {
if (readline_pan1)
(void) top_panel(readline_pan1);
} else if (panel_state == PANEL2_ACTIVE) {
if (readline_pan2)
(void) top_panel(readline_pan2);
} else {
sw_assert_not_reached();
}
update_panels();
(void) doupdate();
}
开发者ID:uhlin,项目名称:swirc,代码行数:44,代码来源:readline.c
示例9: input_loop
static void
input_loop(int portfd)
{
if (portfd >= FD_SETSIZE)
{
destroy_screen();
fputs("File descriptor too large\n", stderr);
exit(1);
}
for (;;)
{
fd_set fds;
FD_ZERO(&fds);
FD_SET(STDIN_FILENO, &fds);
FD_SET(portfd, &fds);
int rc = select(portfd + 1, &fds, 0, 0, 0);
if (rc <= 0)
{
if (rc < 0 && errno != EINTR)
exit_error("select", errno);
continue;
}
if (FD_ISSET(portfd, &fds))
receive_kctext(portfd, win_output);
if (FD_ISSET(STDIN_FILENO, &fds)
&& handle_key_input(portfd, win_input))
break;
wnoutrefresh(win_input);
doupdate();
}
}
开发者ID:danielkitta,项目名称:kcio,代码行数:37,代码来源:kcterm.c
示例10: popupWin
/******************************************************\
* Description: Creates a "window popup" where given *
* the parameters, and message, it *
* creates a window and displays the *
* message. Some current restrictions *
* are that it must only be one line, and*
* it is assumed that the text is padded *
* with one space left for the border and*
* another space left for aesthetics *
\******************************************************/
void popupWin(char *msg, int time)
{
WINDOW *tmpwin;
int y = (LINES / 2) - 3, /* calc location */
len = strlen(msg),
x = (COLS - len)/2;
y = (y < 2) ? 2 : y; /* minimum height */
time = (!time) ? 2 : time;
tmpwin = drawbox(y, x, 5, len + 6); /* create window */
keypad(tmpwin, TRUE);
mvwprintw(tmpwin,2,3, msg); /* output mesg */
wmove(tmpwin,2,len+4);
wrefresh(tmpwin);
if (time == -1)
wgetch(tmpwin);
else
sleep(time); /* wait */
delwin(tmpwin);
wtouchln(windows->hex, y - 1, 5, 1); /* touch windows */
wtouchln(windows->ascii, y - 1, 5, 1);
wtouchln(windows->address, y - 1, 5, 1);
wtouchln(windows->hex_outline, y, 5, 1);
wtouchln(windows->ascii_outline, y, 5, 1);
wtouchln(windows->scrollbar, y, 5, 1);
refreshall(windows); /* refresh all wins */
doupdate();
}
开发者ID:nilcons-contrib,项目名称:hexcurse,代码行数:47,代码来源:screen.c
示例11: addfield
void addfield(struct FIELDLIST *list, unsigned int len,
unsigned int y, unsigned int x, char *initstr)
{
struct FIELD *newfield;
int i;
newfield = malloc(sizeof(struct FIELD));
if (list->list == NULL) {
list->list = newfield;
newfield->prevfield = newfield;
newfield->nextfield = newfield;
} else {
newfield->prevfield = list->list->prevfield;
list->list->prevfield->nextfield = newfield;
list->list->prevfield = newfield;
newfield->nextfield = list->list;
}
newfield->xpos = x;
newfield->ypos = y;
newfield->len = len;
newfield->tlen = strlen(initstr);
newfield->buf = malloc(len + 1);
strcpy(newfield->buf, initstr);
wattrset(list->fieldwin, FIELDATTR);
wmove(list->fieldwin, y, x);
for (i = 1; i <= (signed)len; i++)
wprintw(list->fieldwin, " ");
wmove(list->fieldwin, y, x);
wprintw(list->fieldwin, "%s", initstr);
update_panels();
doupdate();
}
开发者ID:nullren,项目名称:sillypoker,代码行数:37,代码来源:input.c
示例12: destroymenu
void destroymenu(struct MENU *menu)
{
struct ITEM *tnode;
struct ITEM *tnextnode;
if (menu->itemlist != NULL) {
tnode = menu->itemlist;
tnextnode = menu->itemlist->next;
tnode->prev->next = NULL;
while (tnode != NULL) {
free(tnode);
tnode = tnextnode;
if (tnextnode != NULL)
tnextnode = tnextnode->next;
}
}
del_panel(menu->menupanel);
delwin(menu->menuwin);
update_panels();
doupdate();
}
开发者ID:saintkepha,项目名称:airtraf,代码行数:24,代码来源:menurt.c
示例13: main
int main()
{
WINDOW *my_wins[3];
PANEL *my_panels[3];
int lines = 15, cols = 45, y = 2, x = 4, i;
initscr();
cbreak();
noecho();
/* Create windows for the panels */
my_wins[0] = newwin(lines, cols, y, x);
my_wins[1] = newwin(lines, cols, y + 1, x + 5);
my_wins[2] = newwin(lines, cols, y + 2, x + 10);
/*
* Create borders around the windows so that you can see the effect
* of panels
*/
for(i = 0; i < 3; ++i)
box(my_wins[i], 0, 0);
/* Attach a panel to each window */ /* Order is bottom up */
my_panels[0] = new_panel(my_wins[0]); /* Push 0, order: stdscr-0 */
my_panels[1] = new_panel(my_wins[1]); /* Push 1, order: stdscr-0-1 */
my_panels[2] = new_panel(my_wins[2]); /* Push 2, order: stdscr-0-1-2 */
/* Update the stacking order. 2nd panel will be on top */
update_panels();
/* Show it on the screen */
doupdate();
getch();
endwin();
}
开发者ID:lavenliu,项目名称:linuxc,代码行数:36,代码来源:panel_simple.c
示例14: run
int MSHAKERS :: run()
{
int i;
float out[2];
for (i = 0; i < framesToRun(); i++) {
if (--branch <= 0) {
doupdate();
branch = getSkip();
}
out[0] = theShake->tick() * aamp;
if (outputChannels() == 2) {
out[1] = out[0] * (1.0 - pctleft);
out[0] *= pctleft;
}
rtaddout(out);
increment();
}
return framesToRun();
}
开发者ID:CLOUDS-Interactive-Documentary,项目名称:RTCmix,代码行数:24,代码来源:MSHAKERS.cpp
示例15: loop
/**
* Main game loop.
*/
static void loop(void)
{
extern nyancat_t nc;
gametime_t time;
int key_ready = 0, ch;
/* switch to intro mode */
gamemode_enter(mode_intro);
gamemode_draw();
while (gamemode_valid()) {
/* look for the first to run event */
time = queue_get_first_time();
if (time) {
/* wait for time to run the first event form queue or the first
* keypress, wichever comes first. */
key_ready = io_wait_for_key(time);
} else {
/* no event queue item found */
io_wait_for_key(0);
key_ready = 1;
}
if (key_ready > 0) {
ch = getch();
/* no redraw call explicite because this should be done bey the
* key handlers called functions */
gamemode_key(ch);
} else {
/* TODO find a better way for prevening hight cpu usage here. But
* for now insert a sleep for the minimum ticks used in game */
usleep(SECOND * TICK(0.1));
queue_run_until(time);
}
doupdate();
}
}
开发者ID:buharin,项目名称:fastbuild_python,代码行数:39,代码来源:main.c
示例16: view_flush
void view_flush() {
/* fill the screen with blanks */
int x,y;
for(y=0;y<getmaxy(stdscr);y++)
for(x=0;x<getmaxx(stdscr);x++)
mvaddch(y,x,' '); /* empty the screen */
attron(A_BOLD);
for(y=0;y<getmaxy(stdscr)-1;y++)
mvaddch(y,0,'~'); /* display blank lines */
attroff(A_BOLD);
/* display the message at the bottom of the screen */
mvaddstr(getmaxy(stdscr)-1,0,displayed_message());
if(view_layout.hsplit) {
/* paint a line down the center */
attrset(A_REVERSE);
for(y=0;y<getmaxy(stdscr)-1;y++)
mvaddch(y,view_layout.v1size,'|');
attrset(A_NORMAL);
/* display a bottom row with info */
/* buffer 1 info */
/* buffer 2 info */
} else if(view_layout.vsplit) {
/* display a line through the middle */
attrset(A_REVERSE);
attrset(A_NORMAL);
} else {
/* just draaw the view */
draw_view(view_layout.active,0,0,getmaxy(stdscr)-1,getmaxx(stdscr));
}
/* update and refresh the screen (curses stuff) */
doupdate();
refresh();
}
开发者ID:bytbox,项目名称:iv,代码行数:36,代码来源:view.c
示例17: ex_draw
static void ex_draw()
{
log_msg("EXCMD", "ex_draw");
werase(ex.nc_win);
if (ex.ex_state == EX_CMD_STATE)
menu_draw(ex.menu);
pos_T max = layout_size();
wchar_t *wline = str2wide(ex.line);
int len = 2 + wcswidth(wline, -1);
int offset = MAX(len - (max.col - 1), 0);
mvwaddch(ex.nc_win, 0, 0, ex.state_symbol);
mvwaddwstr(ex.nc_win, 0, 1, &wline[offset]);
mvwchgat(ex.nc_win, 0, 0, 1, A_NORMAL, ex.col_symb, NULL);
mvwchgat(ex.nc_win, 0, 1, -1, A_NORMAL, ex.col_text, NULL);
doupdate();
curs_set(1);
wmove(ex.nc_win, 0, (ex.curpos + 1) - offset);
wnoutrefresh(ex.nc_win);
free(wline);
}
开发者ID:jollywho,项目名称:nav,代码行数:24,代码来源:ex_cmd.c
示例18: get_event
/* Returns a character read from stdin with appropriate interpretation */
int get_event (Gpm_Event *event, int redo_event, int block)
{
int c;
static int flag; /* Return value from select */
static int dirty = 3;
if ((dirty == 1) || is_idle ()){
refresh ();
doupdate ();
dirty = 1;
} else
dirty++;
vfs_timeout_handler ();
c = block ? getch_with_delay () : get_key_code (1);
if (!c) {
/* Code is 0, so this is a Control key or mouse event */
return EV_NONE; /* FIXME: mouse not supported */
}
return c;
}
开发者ID:OS2World,项目名称:UTIL-SHELL-Midnight_Commander,代码行数:25,代码来源:key_nt.c
示例19: run
int MBANDEDWG :: run()
{
int i;
float out[2];
for (i = 0; i < framesToRun(); i++) {
if (--branch <= 0) {
doupdate();
branch = getSkip();
}
out[0] = theBar->tick(velocity) * amp;
if (outputChannels() == 2) {
out[1] = out[0] * (1.0 - pctleft);
out[0] *= pctleft;
}
rtaddout(out);
increment();
}
return framesToRun();
}
开发者ID:eriser,项目名称:rtcmix-android,代码行数:24,代码来源:MBANDEDWG.cpp
示例20: case_key_left
/**
* Key left
*/
static void
case_key_left(volatile struct readline_session_context *ctx)
{
struct current_cursor_pos yx;
if (ctx->bufpos == 0) {
term_beep();
return;
}
if (loLim_isset(ctx->act, ctx->prompt_size)) {
magic_swap_panels(ctx, false);
}
ctx->bufpos--;
yx = term_get_pos(ctx->act);
if (wmove(ctx->act, yx.cury, yx.curx - 1) == ERR) {
readline_error(EPERM, "wmove");
}
update_panels();
(void) doupdate();
}
开发者ID:uhlin,项目名称:swirc,代码行数:27,代码来源:readline.c
注:本文中的doupdate函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论