Thread: A question related to BGI

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    7

    A question related to BGI

    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.

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    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.

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Why are you using BGI?

    gg

  4. #4
    Registered User
    Join Date
    Oct 2007
    Posts
    7

    Thanks for Response grumpy

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

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    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.

  6. #6
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    College is forcing you to code in BGI?

    OMG. I would look for another college.

  7. #7
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by grumpy View Post
    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).
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A question related to dynamic memory allocation
    By spiit231 in forum C Programming
    Replies: 2
    Last Post: 03-11-2008, 12:25 AM
  2. Design layer question
    By mdoland in forum C# Programming
    Replies: 0
    Last Post: 10-19-2007, 04:22 AM
  3. Yacc question related to %type
    By g_p in forum Tech Board
    Replies: 0
    Last Post: 05-31-2007, 09:55 AM
  4. Question related to getpid and getppid
    By g_p in forum C Programming
    Replies: 4
    Last Post: 12-18-2006, 11:35 AM
  5. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM