Jump to content

  • Log In with Google      Sign In   
  • Create Account


My games look like crap


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 nanoware   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 June 2001 - 01:56 PM

When I use graphics in my Turbo C++, they look really nasty, and they flicker. I know that I am supposed to use a back surface or something, but I don''t know how to do it. I also need to know how to use bitmaps or some other graphics. Thanks

Sponsor:

#2 Kylotan   Moderators   -  Reputation: 3333

Like
Likes
Like

Posted 28 June 2001 - 02:42 PM

Look up ''double buffering''. Basically, the idea is that you have an area of memory, identical in size and type to your screen memory. You draw to that buffer, and then copy it all to the main screen memory in one go. Doing it in one go reduces the chance of flickering, with the only disadvantage being that you need extra memory to do it this way. However, nearly all games use some variation of this technique.

#3 flame_warrior   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 June 2001 - 09:29 PM

Hi,
If you are using BGI, it will be slow, use mode13. If you are using mode13 then you have to wait for a vertical blanking, i.e the reposition of beam of crt to next y value with the initial x value and also copy everything to memory before copying onto the surface - look up memcpy.

#4 dwarfsoft   Moderators   -  Reputation: 1211

Like
Likes
Like

Posted 28 June 2001 - 11:47 PM

In order to wait for the vertical retrace in mode 13h you use the following code:

  
void vsync(void)
{
// wait for verticle retrace to avoid flicker

while (inportb(0x3da) & 0x08);
/* vga is in retrace */
while (!(inportb(0x3da) & 0x08));
/* wait for start of retrace */

}


Probably even faster if you can _inline it. This code was cut directly out of Vaelek''s ''Fire How To'' article here on GDNet

-Chris Bennett of Dwarfsoft - The future of RPGs Thanks to all the goblins in the GDCorner niche

#5 nanoware   Members   -  Reputation: 122

Like
Likes
Like

Posted 29 June 2001 - 08:54 AM

Thanks for your help guys, I will get into it right now!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS