Update the console, without completely redrawing?

Hi, I have just a quick question. How do I update the console screen, without completely redrawing the entire screen?
linux will need quite some programming effort since it's all terminal specific stuff---
look into ncurses, or platform specific functions.
It is pretty simple, but requires a little bit of setup.

What exactly are you trying to do? Would a little gotoxy() type function do?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifdef _WIN32

  #include <windows.h>

  bool gotoxy( int column, int line )
    {
    COORD coord = { column, line };
    return SetConsoleCursorPosition(
      GetStdHandle( STD_OUTPUT_HANDLE ),
      coord
      );
    }

#else

  #include <term.h>
  #include <unistd.h> 

  bool gotoxy( int column, int line )
    {
    if (!cur_term)
      {
      int result;
      setupterm( NULL, STDOUT_FILENO, &result );
      if (result <= 0)
        return false;
      }
    putp( tparm( tigetstr( "cup" ), line, column, 0, 0, 0, 0, 0, 0, 0 ) );
    return true;
    }

#endif 

Hope this helps.
Topic archived. No new replies allowed.