I made a small program that displays a 3d cube that you can scale on any axis using the arrow keys. Only problem is that im using cleardevice();
for refreshing the cube ( so that there is no "smearing" when scaling the cube ). that works fine its just that every time the cube refreshes using this method the screen goes black for a split second resulting in annoying flickering. Is there a better way of refreshing the screen every time the user changes the cube?
I did actually research this but i wasnt able to find anything suitable (Maybe im just bad at researching but i couldn't find anything for the live of me)
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
there are 2 ways to handle this:
Double buffering
I do not use BGI so I stick to their docs. for WinBGIm you can use
On oldstyle BGI use this:
use vertical synchronization with monitor
You need to wait for VSync before calling
cleardevice();
. On DOS you can use VGA BIOS or direct VGA/VESA access to obtain the signal. On higher OS you need to use some kind of gfx API or Driver API to get VSync.In both cases consult the documentation for target platform.