Qbasicnews.com

Full Version: DirectX: DXFLIP in IBasic???
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Here is how to move a pixel to the right with DirectX and flipping:

1) draw background
2) increment X value
3) draw pixel
4) flip the changes

By drawing the background, you erase the pixel that was drawn at the last flip. Now if you don't draw a background or fill the screen with a color, you get that annoying white flicker when in full screen. Is there any way that I could avoid drawing a background, and have a line created from drawing each pixel? I want to be able to simulate a pixel falling from the top of the screen and when it hits the bottom, leave the pixel there, instead of erasing the pixel after it hits the bottom by drawing the background on the next draw.
Are you working with QB?
If your answer is yes, what I assume, I'd use a backbuffer. This means that you draw all the stuff to a buffer and put this whole thing to the screen. So you can avoid flickering...

Here's a very simple example (there are better ways to use backbuffers, but I think you can understand that one very well, and then go on to others):

http://q-tech.rpg-dev.net/resources.php?...=show&id=5
Post your question here.
double buffering, tripple buffering are common methods of eliminating flicker =P. But thanks for you informational post anyway.
Using Ibasic and DirectX, how is it possible to draw random pixels on the screen and have each of them stay there? When you draw a background, you only get to see only one pixel because the when you draw the background, it erases all previous pixels. Here's what I am talking about:

During the DX update message:
1) draw black background(DXFILL)
2) draw pixel at random location

What the above does is to generate blinking pixels on your screen. What I want to do is for each pixel that is drawn, it stays on screen. So what I want to know is how can I make the background black without using DXFILL and erasing any pixels that I have already drawn?
Redraw everything, or move the fill outside your loop...
Isn't this post in the wrong section? This is for QB programming help, not IBasic programming help...that's what General Programming is for...
QB or IB doesnt make much difference! Big Grin