[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Sean O'Connor's Games • View topic - Double Buffering

Double Buffering

Anything to do with programming games...

Double Buffering

Postby Darren » Fri Jul 08, 2005 11:54 pm

Darren
 
Posts: 13
Joined: Fri Jul 08, 2005 11:49 pm

Postby qwas » Sat Jul 09, 2005 6:23 am

Proud member of Seans forum since 14th April 2005. 1 year and still counting.
Now to spam those 30 messages to get into 3rd place in post count. :D

I'd like to buy your soul please.
http://www.mindistortion.net/iwantyours ... lex_Rider2
User avatar
qwas
 
Posts: 350
Joined: Thu Apr 14, 2005 6:00 pm
Location: London, UK

Postby Sean OConnor » Mon Jul 11, 2005 6:05 am

Yes, I can see what you are doing wrong!

In this line you are telling your application that the background is painted with a white brush:

wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);

and in this line:

InvalidateRect(hwnd, NULL, true);

you are telling the computer to redraw the entire screen ("NULL") but first repaint the screen with a white brush ("true"). That's why it will keep flickering white each time you redraw a frame.

I always do:

wndclass.hbrBackground = NULL;

and

InvalidateRect(hwnd, NULL, FALSE);

If you want to have a white background just fill the offscreen bitmap with a white brush before drawing everything to it and then when you BLT that to the screen everything will look OK.
User avatar
Sean OConnor
 
Posts: 1298
Joined: Fri Sep 03, 2004 7:47 am
Location: Cambridge, UK

Postby Darren » Mon Jul 11, 2005 4:29 pm

thanks, that solved the problem. everything looks great :)
Darren
 
Posts: 13
Joined: Fri Jul 08, 2005 11:49 pm

Postby Fighter_Ace » Mon Jul 11, 2005 8:02 pm

User avatar
Fighter_Ace
 
Posts: 409
Joined: Mon Sep 06, 2004 4:36 am
Location: Sacramento, CA, United States of America - Also can be found somewhere in the land of 1's and 0's

Postby frawsty » Tue Jul 12, 2005 1:43 am

Johnny
--------
http://www.funkyfreshdesigns.com
Web Dev, Game Dev, Computer Support, Networking and more!
User avatar
frawsty
 
Posts: 77
Joined: Sat Jun 04, 2005 3:40 pm
Location: So Cal, USA

Postby Sean OConnor » Tue Jul 12, 2005 7:10 am

User avatar
Sean OConnor
 
Posts: 1298
Joined: Fri Sep 03, 2004 7:47 am
Location: Cambridge, UK

Postby frawsty » Tue Jul 12, 2005 2:22 pm

Johnny
--------
http://www.funkyfreshdesigns.com
Web Dev, Game Dev, Computer Support, Networking and more!
User avatar
frawsty
 
Posts: 77
Joined: Sat Jun 04, 2005 3:40 pm
Location: So Cal, USA

Postby Sean OConnor » Tue Jul 12, 2005 3:47 pm

User avatar
Sean OConnor
 
Posts: 1298
Joined: Fri Sep 03, 2004 7:47 am
Location: Cambridge, UK

Postby frawsty » Tue Jul 12, 2005 4:00 pm

ah I thought CBitmap was in MFC. That's what I used, you prolly did it dif. I've got the bitmap control down now so it's time for writing the game loop :D
Johnny
--------
http://www.funkyfreshdesigns.com
Web Dev, Game Dev, Computer Support, Networking and more!
User avatar
frawsty
 
Posts: 77
Joined: Sat Jun 04, 2005 3:40 pm
Location: So Cal, USA

Postby Sean OConnor » Tue Jul 12, 2005 8:40 pm

Yes, CBitmap sounds like an MFC thing. It's probably just some sort of wrapper thing for the HBITMAP that I would use myself.
User avatar
Sean OConnor
 
Posts: 1298
Joined: Fri Sep 03, 2004 7:47 am
Location: Cambridge, UK

Postby frawsty » Tue Jul 12, 2005 9:15 pm

yep i looked, it has a bunch of functions within the class. this is good stuff!
Johnny
--------
http://www.funkyfreshdesigns.com
Web Dev, Game Dev, Computer Support, Networking and more!
User avatar
frawsty
 
Posts: 77
Joined: Sat Jun 04, 2005 3:40 pm
Location: So Cal, USA

Postby frawsty » Tue Jul 12, 2005 9:16 pm

i wish directx was this easy hehe
Johnny
--------
http://www.funkyfreshdesigns.com
Web Dev, Game Dev, Computer Support, Networking and more!
User avatar
frawsty
 
Posts: 77
Joined: Sat Jun 04, 2005 3:40 pm
Location: So Cal, USA

Postby Fighter_Ace » Wed Jul 13, 2005 7:50 pm

User avatar
Fighter_Ace
 
Posts: 409
Joined: Mon Sep 06, 2004 4:36 am
Location: Sacramento, CA, United States of America - Also can be found somewhere in the land of 1's and 0's

Postby frawsty » Wed Jul 13, 2005 9:28 pm

Johnny
--------
http://www.funkyfreshdesigns.com
Web Dev, Game Dev, Computer Support, Networking and more!
User avatar
frawsty
 
Posts: 77
Joined: Sat Jun 04, 2005 3:40 pm
Location: So Cal, USA

Next

Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron