Board index » delphi » Image flickering
Martin Kronbor
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
Martin Kronbor
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Image flickering
I'm making a program that uses svga 256 colors. I have found out that the
putimage xorput does not work in this mode. I have therefor made a routine that gets the background array before the image is being put to the screen. Then the program overwrites the the image with the old screen and so on. It seems to work, but I have a small problem with the routine. Sometimes the How can I update the screen without this flickering. Is there a kind of I would like the answer to be in Turbo Pascal 7.0 The hopefull Martin Kronborg |
JKe73060
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Image flickeringQuote>It seems to work, but I have a small problem with the routine. Sometimes the screen to avoid flickering. Also if the routine that writes to the screen is to slow you will still have flickering. James |
Martin Fitzpatric
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Image flickeringhi martin, Quote> How can I update the screen without this flickering. Is there a kind of monitor redraw moves from the bottom back to the top-left....)... This is usually long enough to do the update... The problem is if you're doing the actual calculation etc. during this period it will be too slow. I've never done this under SVGA, but under MCGA (which fits nicely in one segment) the way I do it is to set aside a buffer in memory. Once you've got that, redirect your drawing routines to draw to this You'll need to search out the vertical retrace routines for svga (Im not All the best, hope this is of some help - If you have any questions, Martin Fitzpatrick -- |
Peter de Jo
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Image flickeringHi, After reading the two other comments I would suggest to use double The nice thing about this is that you can only swap the two pages Peter de Jong |
Arsène von Wys
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Image flickeringMartin Fitzpatrick <poohsti...@pmail.net> schrieb im Beitrag <3748273E.B1AAD...@pmail.net>... Quote> hi martin, For instance, the sync rate of the VESA modes is not given as it is for the MCGA mode (70Hz). I have a refresh rate of 150Hz in that mode, so the usable VSync time will be only a fragment of 6.67ms. Using 640*480*256, one already has 307200bytes to copy to video memory (including bank switches if you are using banked modes). That makes 46mb per second - which is still within the possible if you had 6.67ms to draw the screen. However, the VSnyc time will only be about half of it, making your program only run on extremly fast PCI cards and AGP cards correctly - note that interruptions such as Timer, Multitasking, not-so-fast Processor etc. will make the case worse. Better thing to do is to use two pages in video mem, because then you just Quote> You'll need to search out the vertical retrace routines for svga (Im not -- |
Steve Bennet
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Image flickeringHi all, Speaking from personal experience, the 'wait for vertical retrace' thing is pretty much a red herring. I used to use code that did that for years in various projects, then one time disabled it to see what happened...nothing much. You do need double buffering of some sort though...the simplest with relatively decent hardware (dx2/66 +) is to allocate a chunk of memory as the video buffer, write to that for as long as you want, then dump the whole thing in one hit to vid memory. Pretty easy...not exactly 'double buffering' but still :) Steve |