The reason why i haven't posted it in the game programming section is, i am not creating a game.
I want to redraw the current screen (even forcefully) something analogous to refresh() function call in NCurses.
Any attempt to help me is greatly appreciated as i have searched google for hours and cant find anything like it.

05-25-2008

grumpy

Short answer is: you can't.

The general rule with BGI is that, to refresh a screen, you need to repeat all the steps (at least, since the last ClearViewPort() or ClearDevice() call - depending on what you want to refresh) you did to get to the latest state.

05-25-2008

Codeplug

Why are you using BGI?

gg

05-25-2008

progue

Thanks for Response grumpy

Collage forced us to code in BGI.....
So no clear cut way huh....Ncurses is way way better .

05-25-2008

grumpy

Ncurses better? Not really ..... just different.

BGI is implemented with the assumption that it has exclusive control of the screen. This was a valid assumption at the time, and meant that there should be nothing writing to or corrupting the screen - hence no need to refresh. Ncurses is written without that assumption, hence needed an ability to refresh(), and all the overhead that introduces.

05-25-2008

VirtualAce

College is forcing you to code in BGI?

OMG. I would look for another college.

05-25-2008

Mario F.

Quote:

Originally Posted by grumpy

This was a valid assumption at the time, and meant that there should be nothing writing to or corrupting the screen - hence no need to refresh. Ncurses is written without that assumption, hence needed an ability to refresh(), and all the overhead that introduces.

Another reason for refresh is to provide flush functionality to streamed buffers in ncurses. It has also a major role in displaying windows and pads and updating their contents (which is basically the ability to update only portions of the screen).