Console flicker updating when win32
I am working on a Tetris game and need to draw it in a Win API window. I tried to repaint the window in the WM_PAINT message but it poses another problem, it doesn't paint the board that it did before.I draw the board using Fill Rect() function and clear the screen with a self-defined function that also uses Fill Rect() to clear the screen. I tried to paint my board again with the same procedure I used to paint the window but can't figure out how to do it, I passed the RECT structure with self-defined co-ordinates to the paint function but all it shows is a blank screen. Do tell me if this question needs any more clarification. It's just the standard windows API to suspend the execution of the current thread for a given amount of time. Another viable approach, and often more useful for low latency applications like games, is to simply measure time at each iteration of the event loop and advance the game by that. Will have to look into Timers as this is my first time working on win32 app.Hello guys I use the Explorer 16 with the PICtail Plus 2 Board and the 24FJ128GA010 PIC.Now when I update a static text which box I drawed with the GDD the display flickers in this area.The other important point is, that you have to create your window without a background brush set (regardless of using GDI, DX or GL) to avoid exactly that flickering problem.– Of course the best thing to do would be not using the Win32 API directly and instead rely on a game application framework, like SDL or SFML.
This program runs various child programs including console program and shell command script(.cmd).Could that have to do with the fact that the display controller doesn't support double-buffering with display data?I don't know anything about Microchip's graphic display library. I know that the flicker appears every 2.5 sec, when the display is rewritten.Generally double buffering is used to avoid things like shearing, which I doubt you're having problems with in console mode.I recommend following Mad Cow's suggestion - his comments are spot on. drawing the content while it's being updated), then create two buffers, and keep a pointer to the current one that's been updated and render from the other.