더블버퍼링 질문 드립니다.

thslrtoo의 이미지

Win32 API 공부를 하다 궁금한게 생겨 질문드립니다.
예제를 따라 공부를 하다 화면 깜빡임 때문에 더블 버퍼링이라는 방법에 대해 알게되었습니다.
더블 버퍼링이 어떻게 되는건지는 아는데 왜 더블 버퍼링을 사용한다고 해서 깜빡임이 없어지는건지는 모르겠습니다.

가상의 화면에 그림을 그릴 객체를 모두 그리고 메인 화면에 덮어 씌우나
그냥 화면에 차례대로 덮어 씌우나 그리는건 똑같은데(빠르게, 연속적으로 덮어씌우는것)
왜 더블 버퍼링 방법을 쓰면 깜빡이지 않나요??

yhsuk의 이미지

잘은 모르지만 검색해보니 원리 자체는 수직 동기화에 맞춰서 뿌려주기 때문인 것 같네요.
수직 동기화에 맞춰주는 게 없는 단순 더블 버퍼링은 화면 크기가 커지면 깜빡이는 경우도 있을 것 같고...

http://www.devpia.com/MAEUL/Contents/Detail.aspx?BoardID=52&MAEULNo=20&no=32002&ref=32002

http://www.gpgstudy.com/forum/viewtopic.php?p=114769

Signature :) - "여유를 갖고 행동하되 게을러지지 말자"

smarinemj의 이미지

간혹 화면을 몽땅 지우고 다시 그리는 경우가 있죠.
이런 경우 확실히 개선됩니다

ifree의 이미지

화면에 그림을 그리는데 시간이 걸리고 경우에 따라서는 있는 그림을 완전히 지우고 다시 그려야 하기 때문이죠.
버퍼 1에 그림을 완전히 그린 후에 화면을 버퍼 1로 전환,
다시 버퍼 2에 그림을 완전히 그린 후에 화면을 버퍼 2로 전환,
이 과정을 반복하여 그림이 그려지는 과정을 숨기고 완전한 그림만을 깜빡임 없이 화면에 보낼 수 있습니다..

shint의 이미지

영어는 모르지만. ㅡ_ㅡ;; 이것이 원인 같습니다.
When the BitBlt function converts a monochrome bitmap to color, it sets white bits (1) to the background color and black bits (0) to the foreground color. The foreground and background colors of the destination device context are used. To convert color to monochrome, BitBlt sets pixels that match the background color to white and sets all other pixels to black. BitBlt uses the foreground and background colors of the color device context to convert from color to monochrome.

아마도. 색을 채우는 과정이 보여져서 그런거 같습니다.
그러니까. 색을 채우는 과정이 보여지지 않으려면.
안보이는데서 채우다가. 완성된것을 보여주면 되는데. 그게 더블버퍼링이라고 합니다.

네이버에 더블 버퍼링'이라고 검색해보세요.

구글 번역기
http://translate.google.com/?hl=en&tab=wT

MSDN
http://msdn.microsoft.com/ko-kr/library/kwxzck32(v=vs.80).aspx
http://msdn.microsoft.com/ko-kr/library/fcbk8779(v=VS.80).aspx

Windows API 완전정복 가남사
챨스 페졸드에 Windows API
MFC 관련 서적
.NET 관련 서적 참고해 보세요.

----------------------------------------------------------------------------
젊음'은 모든것을 가능하게 만든다.

매일 1억명이 사용하는 프로그램을 함께 만들어보고 싶습니다.
정규 근로 시간을 지키는. 야근 없는 회사와 거래합니다.

각 분야별. 좋은 책'이나 사이트' 블로그' 링크 소개 받습니다. shintx@naver.com

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.