当前注册人数162855人 邮箱: 密码: 注册新用户 忘记密码
首页 C/C++/MFC C# ASP.NET VB.NET MATLAB   站内搜索 BBS讨论社区 下载代码说明/积分规则
为什么要注册?

1. 可以直接免费从本站下载代码,防止邮件发送不到您的邮箱,或登录不了国外网站

2. 可以设定关键字,当有您关心的代码收录时,邮件通知您

3. 对这里的代码进行评分和评论

4. 可以和大家一起分享你的源代码,得到更多的建议

Double Buffered Graphics using DirectDraw

VC6中使用DirectDraw实现双缓冲区绘图(避免图像闪烁)

2008年05月19日
VC6, NT4, Win2K, VS6, MFC, DirectX, Dev, Intermediate
文章及示例代码展示如何用我的CDXSurfaceMgr类实现DirectDraw中的双缓冲区绘图。
相关知识

通常在绘图的时候,你都不会直接在BeginPaint或CDC中使用HDC,如果你这样做了,那么当你绘制很多东西的时候,就有可能造成图像的闪烁。双缓冲就是用在这里实现图像的平滑的更新的。
有很多实现的方法,一种是在内存中创建一个兼容的HDC,然后拷贝内存到可见的HDC,另一种是我现在用的一个方法,使用一个DirectX的子集DirectDraw,实现一个接口的实例类CDXSurfaceMgr,实现双缓冲。

CDXSurfaceMgr creates a primary surface - one that is visible - and a secondary off screen surface that is the same size as the primary one but invisible. When you call BeginPaint an HDC attached to the secondary surface is returned; you do all your drawing into this; then EndPaint Blits(copies) the whole of the secondary surface onto the primary one and it appears on the window. If you have a capable graphics adapter on your machine then the Blit is very very fast, if you don't then the operation is obviously not as fast, but still very functional.
 

源代码原文下载:
Double Buffered Graphics using DirectDraw This article explains how my class CDXSurfaceMgr can be used to facilitate Double Buffered drawing.

源码图片

从本站下载附件及源代码(1个附件,已经成功下载381次)

最值得关注的外文源代码

Face Detection C++ Library with Skin and Motion Analysis
A DirectDraw Framework made of template classes
introductory example of how to create a simple application using the DirectDraw library
Super Brick Breaker - A Simple DirectDraw Game
评论(评论是增加积分的一个有效途径)
字数在300字内
请如实评论
本源代码共评论38次,此处显示最近20次评论! 查看所有评论

adamusi  2010年05月17日
学习一下
我是谁82  2010年04月09日
我要看看,不大会用
tqijin  2009年10月01日
刚被HP骗,现在又被你骗,哎
xiaomi0670  2009年05月30日
正是我想要的
bobo  2009年05月27日
谢谢
lz3270  2009年05月08日
也想看看,就是分不够了
yxl  2009年05月05日
haohao
wjn  2009年04月04日
用得到
wayroom  2009年03月27日
正是我想要的
abc2000  2009年03月02日
kankan
vsmagician  2009年03月01日
shishi
maweiqi  2009年02月19日
这个东西不可用,解压不了
dnlrh  2008年12月12日
是不是文件已经损坏 无法解压缩啊
aloe1980  2008年12月10日
good
snowwhy  2008年11月20日
太赞了
abc2000  2008年11月19日
不错
codemole  2008年11月17日
了解一下
wildwest  2008年10月21日
非常好,谢谢
blwinner12  2008年10月21日
原来注册了就可以下载了,呵呵
chubiao  2008年10月16日
打不开。
字数在300字内
请如实评论
CopyRight (C) codesoso.com 2007-2009 All Rights Reserved   免责声明