Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Flickering starfield in DDraw

This topic is 6265 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to program a simple starfield with DirectDraw and the results are depressing. Yes, there IS a starfield, but it behaves very oddly. Firstly, some stars disappear in the middle of the screen, and the stars on top flicker annoyingly. Not to mention the fact that there's a sporadic collection of horizontal lines that represent the mouse cursor - even though I have turned the mouse cursor off with SetCursor(NULL); AND ShowCursor(FALSE);. My code is simple: o Clear the screen with Blt colorfill o Add 1 to the stars' y coordinate, if (y >= 200) y = 0 o Draw the stars o Flip Here's the code that draws the stars:
void StarField::Draw(_int16 *Surface, long pitch)
  int i;
  i = NUM_STARS;
    Surface[Stars[i].x+Stars[i].y*pitch] = 0xffff;
As you probably see from the code, the pointer to surface memory and pitch are passed to the method. I don't know if this has any relevance, but I am doing this in 320x200 with 16 bit colors. rk Edited by - rk on September 23, 2001 4:32:21 AM

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!