Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DirectX: DXFLIP in IBasic???
#1
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.
Fade to nothing... your weakness disgusts me..."
Reply
#2
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
B 4 EVER
Reply
#3
Post your question here.
Reply
#4
double buffering, tripple buffering are common methods of eliminating flicker =P. But thanks for you informational post anyway.
Reply
#5
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?
Fade to nothing... your weakness disgusts me..."
Reply
#6
Redraw everything, or move the fill outside your loop...
Reply
#7
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...
I'd knock on wood, but my desk is particle board.
Reply
#8
QB or IB doesnt make much difference! Big Grin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)