Console flicker updating when win32 benefit backdating rules

02 Oct

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.

Initially it displayed one GUI window and one console window (created with options for child process creation to prevent showing of console window altogether but failed at short and I think it is practically impossible. We can ignore temporary window flicker at the startup.

But is it really impossible to hide child console window completely?

The flicker is expected; you're creating a console window and then hiding it.

The question is, why do you create a console window at all, if you don't want the user to see it?

I have a console app that needs to display the state of items, but rather than having text scroll by like mad I'd rather see the current status keep showing up on the same lines.

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.

Any suggestion regarding that would be helpful too and please don't go into anything [email protected] Riaz: There are two important things to be aware of when writing a game for Windows: If it's graphics heavy and does a lot of animations: Don't use the GDI!

It's slow and cumbersome to use for writing games; use Direct X or Open GL instead.