<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:admin="http://webns.net/mvcb/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns="http://purl.org/rss/1.0/"
>

<channel rdf:about="http://sfpg.seesaa.net/">
<title>S.F.  Page</title>
<link>http://sfpg.seesaa.net/</link>
<description>Programming,Music,etc.</description>
<dc:language>ja</dc:language>
<admin:generatorAgent rdf:resource="http://blog.seesaa.jp/" />
<items>
<rdf:Seq>
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/132345178.html" />
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/132319369.html" />
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/132227277.html" />
<rdf:li rdf:resource="http://match.seesaa.jp/ot_listing.pl?aid=118396&amp;sid=sfpg&amp;tid=seesaa_hotspot&amp;k=%E6%97%A9%E7%A8%B2%E7%94%B0%E7%A5%AD&amp;hid=35" />
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/132199206.html" />
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/132198236.html" />
<rdf:li rdf:resource="http://match.seesaa.jp/ot_listing.pl?aid=118396&amp;sid=sfpg&amp;tid=seesaa_hotspot&amp;k=%E3%82%B5%E3%83%A0%E3%83%A9%E3%82%A4%E3%83%8F%E3%82%A4%E3%82%B9%E3%82%AF%E3%83%BC%E3%83%AB&amp;hid=35" />
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/132039269.html" />
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/131982675.html" />
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/131947541.html" />
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/131939541.html" />
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/131925927.html" />
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/131909466.html" />
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/131870538.html" />
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/131869828.html" />
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/131748343.html" />
<rdf:li rdf:resource="http://sfpg.seesaa.net/article/131733013.html" />
</rdf:Seq>
</items>
</channel>

<item rdf:about="http://sfpg.seesaa.net/article/132345178.html">
<link>http://sfpg.seesaa.net/article/132345178.html</link>
<title>ジェフ降格。。。</title>
<description>ジェフ千葉降格決定。。。来年立て直して、J1に復帰してしてきてほしいと思う。強かったころのジェフ。</description>
<dc:subject>日記</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-08T17:02:03+09:00</dc:date>
<content:encoded><![CDATA[
ジェフ千葉降格決定。。。<br />来年立て直して、J1に復帰してしてきてほしいと思う。<br />強かったころのジェフ。<br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/oQFkYoBxOis&hl=ja&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/oQFkYoBxOis&hl=ja&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
<item rdf:about="http://sfpg.seesaa.net/article/132319369.html">
<link>http://sfpg.seesaa.net/article/132319369.html</link>
<title>WASAPI(22)</title>
<description>ぼちぼちと実装を見直しつつ行っている。IAudioClientにはIsFormatSupported メソッドがある。HRESULT IsFormatSupported(  [in]   AUDCLNT_SHAREMODE ShareMode,  [in]   const WAVEFORMATEX *pFormat,  [out]  WAVEFORMATEX **ppClosestMatch);１つ目のパラメータは共有モードの指定、2つ目は確認したいフォーマット、3つ目は指定...</description>
<dc:subject>WASAPI</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-08T10:34:00+09:00</dc:date>
<content:encoded><![CDATA[
ぼちぼちと実装を見直しつつ行っている。<br />IAudioClientにはIsFormatSupported メソッドがある。<br /><blockquote>HRESULT IsFormatSupported(<br />  [in]   AUDCLNT_SHAREMODE ShareMode,<br />  [in]   const WAVEFORMATEX *pFormat,<br />  [out]  WAVEFORMATEX **ppClosestMatch<br />);</blockquote><br /><br />１つ目のパラメータは共有モードの指定、2つ目は確認したいフォーマット、3つ目は指定したWAVEFORMATはサポートしていないが、近いものを探してあった場合APIが返すフォーマットポインタのアドレスを指定する。<br />この3つ目のパラメータだが、共有モードでしか有効でない。排他モードだとかならずNULLが入り、HRESULTにAUDCLNT_E_UNSUPPORTED_FORMATが入る仕様となっている。排他モードだと相変わらず片っ端からサポートしているフォーマットをチェックしていかなくてはいけないのだろうか。ちょっとというか、かなり面倒臭い。<br /><br /><br /><br /><a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
<item rdf:about="http://sfpg.seesaa.net/article/132227277.html">
<link>http://sfpg.seesaa.net/article/132227277.html</link>
<title>コミック昭和史</title>
<description>僕は日本軍に関する本を読み漁っている。別にミリタリーマニアでもないのだけれど、やはり日本の近代史において一番重要な大東亜戦争における歴史的事実をできるだけ正確に把握しておきたいからである。なぜならば、戦争経験者はもうその寿命を向かえつつあるし、だれかがその事実を継承していかなければ、そのとき得られた貴重な経験、教訓が忘却され、また同じことが繰り返されるからだ。日本軍は戦略策定において欠陥があったのは事実で、そのために多くの犠牲を払って敗戦したというのがひとつの見方なのだけれど...</description>
<dc:subject>日記</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-07T08:06:57+09:00</dc:date>
<content:encoded><![CDATA[
僕は日本軍に関する本を読み漁っている。別にミリタリーマニアでもないのだけれど、やはり日本の近代史において一番重要な大東亜戦争における歴史的事実をできるだけ正確に把握しておきたいからである。<br />なぜならば、戦争経験者はもうその寿命を向かえつつあるし、だれかがその事実を継承していかなければ、そのとき得られた貴重な経験、教訓が忘却され、また同じことが繰り返されるからだ。<br /><br />日本軍は戦略策定において欠陥があったのは事実で、そのために多くの犠牲を払って敗戦したというのがひとつの見方なのだけれど、もう1つはあれだけの国力で、戦術によって列強を少なからず苦しめたという側面もある。<br />軍政面においては、9割は植民地支配で植民地配下の現地民から搾取の限りを尽くしたという部分と、1割の現地民尊重の民主主義的支配形態（まさに八紘一宇のスローガンどおり）の両側面を持っていた。<br /><br />水木しげるさんは、貴重な戦争体験者でもあり、日本の配色が濃くなりつつあった時期に召集され、ラバウルの近くのニューブリテン島で負傷し、ラバウルで終戦を迎えた。<br />そのため、水木さんはいくつかの兵隊目線での戦記漫画を書いている。<br />そこで書かれている水木さんはどちらかというと「変わり者」で上官からビンタされまくりな劣等兵である。漫画では兵隊の日常が克明に描かれている。本を読むと水木さん自体はまともな人間だと思うのだが、敗戦までの時代が狂っているので、「変わり者」扱いされていたことがわかる。<br /><br />僕が一番最初に読んだのは「総員玉砕せよ！」である。<br /><!-- amazon --><br /><div class="seesaa-asin-area"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061859935/sfprogrpage-22/ref=nosim" target="_blank"><img src="http://ecx.images-amazon.com/images/I/61RNJQA3QBL._SL160_.jpg" class="seesaa-asin-image" alt="総員玉砕せよ! (講談社文庫)" title="総員玉砕せよ! (講談社文庫)" border="0" align="left" hspace="20" /></a><div class="seesaa-asin-info"><p class="seesaa-asin-title"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061859935/sfprogrpage-22/ref=nosim" target="_blank">総員玉砕せよ! (講談社文庫)</a></p><ul><li class="seesaa-asin-label">作者: 水木 しげる</li><li class="seesaa-asin-label">出版社/メーカー: 講談社</li><li class="seesaa-asin-label">発売日: 1995/06</li><li class="seesaa-asin-label">メディア: 文庫</li></ul></div></div><div class="seesaa-asin-break"></div><br clear="all" /><br /><!--/ amazon --><br /><br />「コミック昭和史」は昭和という時代を水木さんの人生と照らし合わせながら描いている。もちろん戦記部分も充実している。<br /><br /><!-- amazon --><br /><div class="seesaa-asin-area"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061858270/sfprogrpage-22/ref=nosim" target="_blank"><img src="http://ecx.images-amazon.com/images/I/21ENP2SJM7L._SL160_.jpg" class="seesaa-asin-image" alt="コミック昭和史〈第8巻〉―高度成長以降 (講談社文庫)" title="コミック昭和史〈第8巻〉―高度成長以降 (講談社文庫)" border="0" align="left" hspace="20" /></a><div class="seesaa-asin-info"><p class="seesaa-asin-title"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061858270/sfprogrpage-22/ref=nosim" target="_blank">コミック昭和史〈第8巻〉―高度成長以降 (講談社文庫)</a></p><ul><li class="seesaa-asin-label">作者: 水木 しげる</li><li class="seesaa-asin-label">出版社/メーカー: 講談社</li><li class="seesaa-asin-label">発売日: 1994/11</li><li class="seesaa-asin-label">メディア: 文庫</li></ul></div></div><div class="seesaa-asin-break"></div><br clear="all" /><br /><!--/ amazon --><br /><!-- amazon --><br /><div class="seesaa-asin-area"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061858262/sfprogrpage-22/ref=nosim" target="_blank"><img src="http://ecx.images-amazon.com/images/I/21H257DCW5L._SL160_.jpg" class="seesaa-asin-image" alt="コミック 昭和史〈第7巻〉講和から復興 (講談社文庫)" title="コミック 昭和史〈第7巻〉講和から復興 (講談社文庫)" border="0" align="left" hspace="20" /></a><div class="seesaa-asin-info"><p class="seesaa-asin-title"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061858262/sfprogrpage-22/ref=nosim" target="_blank">コミック 昭和史〈第7巻〉講和から復興 (講談社文庫)</a></p><ul><li class="seesaa-asin-label">作者: 水木 しげる</li><li class="seesaa-asin-label">出版社/メーカー: 講談社</li><li class="seesaa-asin-label">発売日: 1994/11</li><li class="seesaa-asin-label">メディア: 文庫</li></ul></div></div><div class="seesaa-asin-break"></div><br clear="all" /><br /><!--/ amazon --><br /><!-- amazon --><br /><div class="seesaa-asin-area"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061858009/sfprogrpage-22/ref=nosim" target="_blank"><img src="http://ecx.images-amazon.com/images/I/21JT4R2PE3L._SL160_.jpg" class="seesaa-asin-image" alt="コミック昭和史〈第6巻〉―終戦から朝鮮戦争 (講談社文庫)" title="コミック昭和史〈第6巻〉―終戦から朝鮮戦争 (講談社文庫)" border="0" align="left" hspace="20" /></a><div class="seesaa-asin-info"><p class="seesaa-asin-title"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061858009/sfprogrpage-22/ref=nosim" target="_blank">コミック昭和史〈第6巻〉―終戦から朝鮮戦争 (講談社文庫)</a></p><ul><li class="seesaa-asin-label">作者: 水木 しげる</li><li class="seesaa-asin-label">出版社/メーカー: 講談社</li><li class="seesaa-asin-label">発売日: 1994/10</li><li class="seesaa-asin-label">メディア: 文庫</li></ul></div></div><div class="seesaa-asin-break"></div><br clear="all" /><br /><!--/ amazon --><br /><!-- amazon --><br /><div class="seesaa-asin-area"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061857991/sfprogrpage-22/ref=nosim" target="_blank"><img src="http://ecx.images-amazon.com/images/I/21NSZFW79KL._SL160_.jpg" class="seesaa-asin-image" alt="コミック昭和史〈第5巻〉太平洋戦争後半 (講談社文庫)" title="コミック昭和史〈第5巻〉太平洋戦争後半 (講談社文庫)" border="0" align="left" hspace="20" /></a><div class="seesaa-asin-info"><p class="seesaa-asin-title"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061857991/sfprogrpage-22/ref=nosim" target="_blank">コミック昭和史〈第5巻〉太平洋戦争後半 (講談社文庫)</a></p><ul><li class="seesaa-asin-label">作者: 水木 しげる</li><li class="seesaa-asin-label">出版社/メーカー: 講談社</li><li class="seesaa-asin-label">発売日: 1994/10</li><li class="seesaa-asin-label">メディア: 文庫</li></ul></div></div><div class="seesaa-asin-break"></div><br clear="all" /><br /><!--/ amazon --><br /><!-- amazon --><br /><div class="seesaa-asin-area"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/406185772X/sfprogrpage-22/ref=nosim" target="_blank"><img src="http://ecx.images-amazon.com/images/I/2174QVGCPJL._SL160_.jpg" class="seesaa-asin-image" alt="コミック昭和史〈第4巻〉太平洋戦争前半 (講談社文庫)" title="コミック昭和史〈第4巻〉太平洋戦争前半 (講談社文庫)" border="0" align="left" hspace="20" /></a><div class="seesaa-asin-info"><p class="seesaa-asin-title"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/406185772X/sfprogrpage-22/ref=nosim" target="_blank">コミック昭和史〈第4巻〉太平洋戦争前半 (講談社文庫)</a></p><ul><li class="seesaa-asin-label">作者: 水木 しげる</li><li class="seesaa-asin-label">出版社/メーカー: 講談社</li><li class="seesaa-asin-label">発売日: 1994/09</li><li class="seesaa-asin-label">メディア: 文庫</li></ul></div></div><div class="seesaa-asin-break"></div><br clear="all" /><br /><!--/ amazon --><br /><!-- amazon --><br /><div class="seesaa-asin-area"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061857711/sfprogrpage-22/ref=nosim" target="_blank"><img src="http://ecx.images-amazon.com/images/I/21SH3XAFPNL._SL160_.jpg" class="seesaa-asin-image" alt="コミック昭和史〈第3巻〉日中全面戦争~太平洋戦争開始 (講談社文庫)" title="コミック昭和史〈第3巻〉日中全面戦争~太平洋戦争開始 (講談社文庫)" border="0" align="left" hspace="20" /></a><div class="seesaa-asin-info"><p class="seesaa-asin-title"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061857711/sfprogrpage-22/ref=nosim" target="_blank">コミック昭和史〈第3巻〉日中全面戦争~太平洋戦争開始 (講談社文庫)</a></p><ul><li class="seesaa-asin-label">作者: 水木 しげる</li><li class="seesaa-asin-label">出版社/メーカー: 講談社</li><li class="seesaa-asin-label">発売日: 1994/09</li><li class="seesaa-asin-label">メディア: 文庫</li></ul></div></div><div class="seesaa-asin-break"></div><br clear="all" /><br /><!--/ amazon --><br /><!-- amazon --><br /><div class="seesaa-asin-area"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061857517/sfprogrpage-22/ref=nosim" target="_blank"><img src="http://ecx.images-amazon.com/images/I/21J8GSH6TWL._SL160_.jpg" class="seesaa-asin-image" alt="コミック昭和史 (第2巻) 満州事変~日中全面戦争" title="コミック昭和史 (第2巻) 満州事変~日中全面戦争" border="0" align="left" hspace="20" /></a><div class="seesaa-asin-info"><p class="seesaa-asin-title"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061857517/sfprogrpage-22/ref=nosim" target="_blank">コミック昭和史 (第2巻) 満州事変~日中全面戦争</a></p><ul><li class="seesaa-asin-label">作者: 水木 しげる</li><li class="seesaa-asin-label">出版社/メーカー: 講談社</li><li class="seesaa-asin-label">発売日: 1994/08</li><li class="seesaa-asin-label">メディア: 文庫</li></ul></div></div><div class="seesaa-asin-break"></div><br clear="all" /><br /><!--/ amazon --><br /><!-- amazon --><br /><div class="seesaa-asin-area"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061857509/sfprogrpage-22/ref=nosim" target="_blank"><img src="http://ecx.images-amazon.com/images/I/21FQNVN4QBL._SL160_.jpg" class="seesaa-asin-image" alt="コミック昭和史 (第1巻) 関東大震災~満州事変" title="コミック昭和史 (第1巻) 関東大震災~満州事変" border="0" align="left" hspace="20" /></a><div class="seesaa-asin-info"><p class="seesaa-asin-title"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4061857509/sfprogrpage-22/ref=nosim" target="_blank">コミック昭和史 (第1巻) 関東大震災~満州事変</a></p><ul><li class="seesaa-asin-label">作者: 水木 しげる</li><li class="seesaa-asin-label">出版社/メーカー: 講談社</li><li class="seesaa-asin-label">発売日: 1994/08</li><li class="seesaa-asin-label">メディア: 文庫</li></ul></div></div><div class="seesaa-asin-break"></div><br clear="all" /><br /><!--/ amazon --><br /><a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
<item rdf:about="http://match.seesaa.jp/ot_listing.pl?aid=118396&amp;sid=sfpg&amp;tid=seesaa_hotspot&amp;k=%E6%97%A9%E7%A8%B2%E7%94%B0%E7%A5%AD&amp;hid=35">
<link>http://match.seesaa.jp/ot_listing.pl?aid=118396&amp;sid=sfpg&amp;tid=seesaa_hotspot&amp;k=%E6%97%A9%E7%A8%B2%E7%94%B0%E7%A5%AD&amp;hid=35</link>
<title>[PR]注目のキーワード「早稲田祭」</title>
<description><![CDATA[
<a href="http://match.seesaa.jp/ot_listing.pl?aid=118396&sid=sfpg&tid=seesaa_hotspot&k=%E8%A1%8C%E3%81%A3%E3%81%A6%E3%81%8D%E3%81%BE%E3%81%97%E3%81%9F%20%E6%97%A9%E7%A8%B2%E7%94%B0%E7%A5%AD&hid=35">行ってきました 早稲田祭</a>&nbsp;|&nbsp;<a href="http://match.seesaa.jp/ot_listing.pl?aid=118396&sid=sfpg&tid=seesaa_hotspot&k=RT%20%E6%97%A9%E7%A8%B2%E7%94%B0%E7%A5%AD&hid=35">RT 早稲田祭</a>&nbsp;|&nbsp;<a href="http://match.seesaa.jp/ot_listing.pl?aid=118396&sid=sfpg&tid=seesaa_hotspot&k=%E6%97%A9%E7%A8%B2%E7%94%B0&hid=35">早稲田</a>&nbsp;|&nbsp;<a href="http://match.seesaa.jp/ot_listing.pl?aid=118396&sid=sfpg&tid=seesaa_hotspot&k=%E6%97%A9%E7%A8%B2%E7%94%B0%E7%A5%AD2009&hid=35">早稲田祭2009</a>&nbsp;|&nbsp;<a href="http://match.seesaa.jp/ot_listing.pl?aid=118396&sid=sfpg&tid=seesaa_hotspot&k=%E6%BC%94%E6%8A%80%20%E6%97%A9%E7%A8%B2%E7%94%B0%E7%A5%AD&hid=35">演技 早稲田祭</a>
]]></description>
<dc:date>2009-11-07T08:06:57+09:00</dc:date>
<dc:creator>ads by Seesaa</dc:creator>
</item>
<item rdf:about="http://sfpg.seesaa.net/article/132199206.html">
<link>http://sfpg.seesaa.net/article/132199206.html</link>
<title>Direct2Dスケルトンコード</title>
<description>Direct2DのスケルトンコードをSimpleDirect2DApplicationサンプルのコードをベースに作成してみた。殆どパクリだけど、COMスマートポインタを使っているのが違うところ。例外処理はいれていない。・ヘッダ(Direct2DBurn.h)#pragma once#include "resource.h"// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF// ANY KIN...</description>
<dc:subject>Library</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-06T21:12:50+09:00</dc:date>
<content:encoded><![CDATA[
Direct2DのスケルトンコードをSimpleDirect2DApplicationサンプルのコードをベースに作成してみた。<br/>
殆どパクリだけど、COMスマートポインタを使っているのが違うところ。例外処理はいれていない。<br/>
・ヘッダ(Direct2DBurn.h)
<pre class="brush: cpp;">
#pragma once

#include "resource.h"
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved
//

#pragma once

// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER              // Allow use of features specific to Windows 7 or later.
#define WINVER 0x0700       // Change this to the appropriate value to target other versions of Windows.
#endif

#ifndef _WIN32_WINNT        // Allow use of features specific to Windows 7 or later.
#define _WIN32_WINNT 0x0700 // Change this to the appropriate value to target other versions of Windows.
#endif

#ifndef UNICODE
#define UNICODE
#endif

#define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>

// C RunTime Header Files


/******************************************************************
*                                                                 *
*  Macros                                                         *
*                                                                 *
******************************************************************/


#ifndef Assert
#if defined( DEBUG ) || defined( _DEBUG )
#define Assert(b) do {if (!(b)) {OutputDebugStringA("Assert: " #b "\n");}} while(0)
#else
#define Assert(b)
#endif //DEBUG || _DEBUG
#endif


#ifndef HINST_THISCOMPONENT
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
#define HINST_THISCOMPONENT ((HINSTANCE)&__ImageBase)
#endif

_COM_SMARTPTR_TYPEDEF(ID2D1Factory,__uuidof(ID2D1Factory));

_COM_SMARTPTR_TYPEDEF(IWICImagingFactory, __uuidof(IWICImagingFactory));
_COM_SMARTPTR_TYPEDEF(IDWriteFactory , __uuidof(IDWriteFactory));
_COM_SMARTPTR_TYPEDEF(ID2D1HwndRenderTarget , __uuidof(ID2D1HwndRenderTarget));
_COM_SMARTPTR_TYPEDEF(IDWriteTextFormat, __uuidof(IDWriteTextFormat));
_COM_SMARTPTR_TYPEDEF(ID2D1PathGeometry , __uuidof(ID2D1PathGeometry));
_COM_SMARTPTR_TYPEDEF(ID2D1LinearGradientBrush , __uuidof(ID2D1LinearGradientBrush));
_COM_SMARTPTR_TYPEDEF(ID2D1SolidColorBrush , __uuidof(ID2D1SolidColorBrush));
_COM_SMARTPTR_TYPEDEF(ID2D1BitmapBrush , __uuidof(ID2D1BitmapBrush));
_COM_SMARTPTR_TYPEDEF(ID2D1Bitmap , __uuidof(ID2D1Bitmap));

/******************************************************************
*                                                                 *
*  Direct2dWindow                                                        *
*                                                                 *
******************************************************************/
namespace sf{

class Direct2dWindow
{
public:
    Direct2dWindow();
    ~Direct2dWindow();

    void Initialize();
    void RunMessageLoop();
private:

	HRESULT OnRender();
	void CreateDeviceResources();
	void DiscardDeviceResources();

	void OnResize(
        UINT width,
        UINT height
        );

    static LRESULT CALLBACK WndProc(
        HWND hWnd,
        UINT message,
        WPARAM wParam,
        LPARAM lParam
        );

private:
    HWND hwnd_;
    ID2D1FactoryPtr pD2DFactory_;
    ID2D1HwndRenderTargetPtr pRenderTarget_;
};
}
</pre>

・本体

<pre class="brush: cpp;">
#include &lt;stdlib.h>
#include &lt;malloc.h>
#include &lt;memory.h>
#include &lt;wchar.h>
#include &lt;math.h>

#include &lt;d2d1.h>
#include &lt;d2d1helper.h>
#include &lt;dwrite.h>
#include &lt;wincodec.h>
#include &lt;comdef.h>
#include "Direct2DBurn.h"
using namespace sf;
//
// Provides the entry point to the application.
//
int WINAPI WinMain(
    HINSTANCE /* hInstance */,
    HINSTANCE /* hPrevInstance */,
    LPSTR /* lpCmdLine */,
    int /* nCmdShow */
    )
{
    // Ignore the return value because we want to continue running even in the
    // unlikely event that HeapSetInformation fails.
    HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);

    if (SUCCEEDED(CoInitialize(NULL)))
    {
        {
            Direct2dWindow app;
			app.Initialize();
            app.RunMessageLoop();
        }
        CoUninitialize();
    }

    return 0;
}


//
// Initialize members.
//
Direct2dWindow::Direct2dWindow() :hwnd_(NULL)
{
}

//
// Release resources.
//
Direct2dWindow::~Direct2dWindow()
{
    pD2DFactory_.Release();
    pRenderTarget_.Release();
}

//
// Creates the application window and initializes
// device-independent resources.
//
void Direct2dWindow::Initialize()
{
    HRESULT hr;

    // Create a Direct2D factory.
    hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &pD2DFactory_);


	
	if (SUCCEEDED(hr))
    {
        // Register the window class.
        WNDCLASSEX wcex = { sizeof(WNDCLASSEX) };
        wcex.style         = CS_HREDRAW | CS_VREDRAW;
        wcex.lpfnWndProc   = Direct2dWindow::WndProc;
        wcex.cbClsExtra    = 0;
        wcex.cbWndExtra    = sizeof(LONG_PTR);
        wcex.hInstance     = HINST_THISCOMPONENT;
        wcex.hbrBackground = NULL;
        wcex.lpszMenuName  = NULL;
        wcex.hCursor       = LoadCursor(NULL, IDC_ARROW);
        wcex.lpszClassName = L"D2DDirect2dWindow";

        RegisterClassEx(&wcex);

        // Create the application window.
        //
        // Because the CreateWindow function takes its size in pixels, we
        // obtain the system DPI and use it to scale the window size.
        FLOAT dpiX, dpiY;
        pD2DFactory_->GetDesktopDpi(&dpiX, &dpiY);

        // Create the application window.
        hwnd_ = CreateWindow(
            L"D2DDirect2dWindow",
            L"Direct2D Demo Application",
            WS_OVERLAPPEDWINDOW,
            CW_USEDEFAULT,
            CW_USEDEFAULT,
            static_cast<UINT>(ceil(640.f * dpiX / 96.f)),
            static_cast<UINT>(ceil(480.f * dpiY / 96.f)),
            NULL,
            NULL,
            HINST_THISCOMPONENT,
            this
            );
        hr = hwnd_ ? S_OK : E_FAIL;
        if (SUCCEEDED(hr))
        {
            ShowWindow(hwnd_, SW_SHOWNORMAL);
            UpdateWindow(hwnd_);
        }
    }
}


//
//  This method creates resources which are bound to a particular
//  Direct3D device. It's all centralized here, in case the resources
//  need to be recreated in case of Direct3D device loss (eg. display
//  change, remoting, removal of video card, etc).
//
void Direct2dWindow::CreateDeviceResources()
{

	HRESULT hr = S_OK;

    if (!pRenderTarget_)
    {
        RECT rc;
        GetClientRect(hwnd_, &rc);

        D2D1_SIZE_U size = D2D1::SizeU(
            rc.right - rc.left,
            rc.bottom - rc.top
            );

        // Create a Direct2D render target.
        hr = pD2DFactory_->CreateHwndRenderTarget(
            D2D1::RenderTargetProperties(),
            D2D1::HwndRenderTargetProperties(hwnd_, size),
            &pRenderTarget_
            );

    }
}


//
// The main window message loop.
//
void Direct2dWindow::RunMessageLoop()
{
    MSG msg;

    while (GetMessage(&msg, NULL, 0, 0))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
}


//
//  Called whenever the application needs to display the client
//  window. This method draws a bitmap a couple times, draws some
//  geometries, and writes "Hello, World"
//
//  Note that this function will not render anything if the window
//  is occluded (e.g. when the screen is locked).
//  Also, this function will automatically discard device-specific
//  resources if the Direct3D device disappears during function
//  invocation, and will recreate the resources the next time it's
//  invoked.
//

HRESULT Direct2dWindow::OnRender()
{
    HRESULT hr;

    CreateDeviceResources();

    if (!(pRenderTarget_->CheckWindowState() & D2D1_WINDOW_STATE_OCCLUDED))
    {
        static const WCHAR sc_helloWorld[] = L"Hello, World!";
        // Retrieve the size of the render target.
        D2D1_SIZE_F renderTargetSize = pRenderTarget_->GetSize();

        pRenderTarget_->BeginDraw();
        pRenderTarget_->SetTransform(D2D1::Matrix3x2F::Identity());
        pRenderTarget_->Clear(D2D1::ColorF(D2D1::ColorF::White));

	    hr = pRenderTarget_->EndDraw();

        if (hr == D2DERR_RECREATE_TARGET)
        {
            //hr = S_OK;
            DiscardDeviceResources();
        }
    }

    return hr;
}

void Direct2dWindow::DiscardDeviceResources()
{
}

//
//  If the application receives a WM_SIZE message, this method
//  resize the render target appropriately.
//
void Direct2dWindow::OnResize(UINT width, UINT height)
{
    if (pRenderTarget_)
    {
        D2D1_SIZE_U size;
        size.width = width;
        size.height = height;

        // Note: This method can fail, but it's okay to ignore the
        // error here -- it will be repeated on the next call to
        // EndDraw.
        pRenderTarget_->Resize(size);
    }
}


//
// The window message handler.
//
LRESULT CALLBACK Direct2dWindow::WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    LRESULT result = 0;

    if (message == WM_CREATE)
    {
        LPCREATESTRUCT pcs = (LPCREATESTRUCT)lParam;
        Direct2dWindow *pDirect2dWindow = (Direct2dWindow *)pcs->lpCreateParams;

        ::SetWindowLongPtrW(
            hwnd,
            GWLP_USERDATA,
            PtrToUlong(pDirect2dWindow)
            );

        result = 1;
    }
    else
    {
        Direct2dWindow *pDirect2dWindow = reinterpret_cast<Direct2dWindow *>(static_cast<LONG_PTR>(
            ::GetWindowLongPtrW(
                hwnd,
                GWLP_USERDATA
                )));

        bool wasHandled = false;

        if (pDirect2dWindow)
        {
            switch (message)
            {
            case WM_SIZE:
                {
                    UINT width = LOWORD(lParam);
                    UINT height = HIWORD(lParam);
                    pDirect2dWindow->OnResize(width, height);
                }
                result = 0;
                wasHandled = true;
                break;

            case WM_PAINT:
            case WM_DISPLAYCHANGE:
                {
                    PAINTSTRUCT ps;
                    BeginPaint(hwnd, &ps);
                    pDirect2dWindow->OnRender();
                    EndPaint(hwnd, &ps);
                }
                result = 0;
                wasHandled = true;
                break;

            case WM_DESTROY:
                {
                    PostQuitMessage(0);
                }
                result = 1;
                wasHandled = true;
                break;
            }
        }

        if (!wasHandled)
        {
            result = DefWindowProc(hwnd, message, wParam, lParam);
        }
    }

    return result;
}
</pre><a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
<item rdf:about="http://sfpg.seesaa.net/article/132198236.html">
<link>http://sfpg.seesaa.net/article/132198236.html</link>
<title>Native Client</title>
<description>Native Clientのサンプルを少し見てみた。http://nativeclient.googlecode.com/svn/data/docs_tarball/nacl/googleclient/native_client/tests/npapi_hw/npapi_hw.c見た感じは、COMのdispatch interfaceっぽい。variantとか、invokeとかPropertyとか。。。http://msdn.microsoft.com/en-us/libra...</description>
<dc:subject>Library</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-06T21:01:05+09:00</dc:date>
<content:encoded><![CDATA[
Native Clientのサンプルを少し見てみた。<br /><a href="http://nativeclient.googlecode.com/svn/data/docs_tarball/nacl/googleclient/native_client/tests/npapi_hw/npapi_hw.c" target="_blank">http://nativeclient.googlecode.com/svn/data/docs_tarball/nacl/googleclient/native_client/tests/npapi_hw/npapi_hw.c</a><br />見た感じは、COMのdispatch interfaceっぽい。<br />variantとか、invokeとかPropertyとか。。。<br /><a href="http://msdn.microsoft.com/en-us/library/ms221608.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms221608.aspx</a><br />なので、ソースコードレベルで見るとあまり新しく感じないのが意外であった。スクリプトとネイティブとのインターフェース部分という限定された世界の中のことなので、みな似たようなものになってくるということなのだろうか。<br /><br />ただ、Naclの場合コンパイラが特殊なバイナリを吐き、セキュリティが保たれるという部分が違うので、アセンブラレベルで見たほうが目新しく感じるのかもしれない。そこまでする気はないが。<br /><br /><br /><a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
<item rdf:about="http://match.seesaa.jp/ot_listing.pl?aid=118396&amp;sid=sfpg&amp;tid=seesaa_hotspot&amp;k=%E3%82%B5%E3%83%A0%E3%83%A9%E3%82%A4%E3%83%8F%E3%82%A4%E3%82%B9%E3%82%AF%E3%83%BC%E3%83%AB&amp;hid=35">
<link>http://match.seesaa.jp/ot_listing.pl?aid=118396&amp;sid=sfpg&amp;tid=seesaa_hotspot&amp;k=%E3%82%B5%E3%83%A0%E3%83%A9%E3%82%A4%E3%83%8F%E3%82%A4%E3%82%B9%E3%82%AF%E3%83%BC%E3%83%AB&amp;hid=35</link>
<title>[PR]注目のキーワード「サムライハイスクール」</title>
<description><![CDATA[
<a href="http://match.seesaa.jp/ot_listing.pl?aid=118396&sid=sfpg&tid=seesaa_hotspot&k=%E5%B0%8F%E5%85%AC%E5%A5%B3%E3%82%BB%E3%82%A4%E3%83%A9%20%E3%82%B5%E3%83%A0%E3%83%A9%E3%82%A4%E3%83%8F%E3%82%A4%E3%82%B9%E3%82%AF%E3%83%BC%E3%83%AB&hid=35">小公女セイラ サムライハイスクール</a>&nbsp;|&nbsp;<a href="http://match.seesaa.jp/ot_listing.pl?aid=118396&sid=sfpg&tid=seesaa_hotspot&k=%E3%83%89%E3%83%A9%E3%83%9E%20%E3%82%B5%E3%83%A0%E3%83%A9%E3%82%A4%E3%83%8F%E3%82%A4%E3%82%B9%E3%82%AF%E3%83%BC%E3%83%AB&hid=35">ドラマ サムライハイスクール</a>&nbsp;|&nbsp;<a href="http://match.seesaa.jp/ot_listing.pl?aid=118396&sid=sfpg&tid=seesaa_hotspot&k=%E8%AA%AD%E3%82%80%20%E3%82%B5%E3%83%A0%E3%83%A9%E3%82%A4%E3%83%8F%E3%82%A4%E3%82%B9%E3%82%AF%E3%83%BC%E3%83%AB&hid=35">読む サムライハイスクール</a>&nbsp;|&nbsp;<a href="http://match.seesaa.jp/ot_listing.pl?aid=118396&sid=sfpg&tid=seesaa_hotspot&k=%E7%B6%9A%E3%81%8D%20%E3%82%B5%E3%83%A0%E3%83%A9%E3%82%A4%E3%83%8F%E3%82%A4%E3%82%B9%E3%82%AF%E3%83%BC%E3%83%AB&hid=35">続き サムライハイスクール</a>&nbsp;|&nbsp;<a href="http://match.seesaa.jp/ot_listing.pl?aid=118396&sid=sfpg&tid=seesaa_hotspot&k=%E4%B8%89%E6%B5%A6%E6%98%A5%E9%A6%AC%20%E3%82%B5%E3%83%A0%E3%83%A9%E3%82%A4%E3%83%8F%E3%82%A4%E3%82%B9%E3%82%AF%E3%83%BC%E3%83%AB&hid=35">三浦春馬 サムライハイスクール</a>
]]></description>
<dc:date>2009-11-06T21:01:05+09:00</dc:date>
<dc:creator>ads by Seesaa</dc:creator>
</item>
<item rdf:about="http://sfpg.seesaa.net/article/132039269.html">
<link>http://sfpg.seesaa.net/article/132039269.html</link>
<title>Blender</title>
<description>Blenderも息が長いね。。http://blender.jp/</description>
<dc:subject>日記</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-04T21:31:40+09:00</dc:date>
<content:encoded><![CDATA[
Blenderも息が長いね。。<br /><a href="http://blender.jp/" target="_blank">http://blender.jp/</a><a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
<item rdf:about="http://sfpg.seesaa.net/article/131982675.html">
<link>http://sfpg.seesaa.net/article/131982675.html</link>
<title>鉄人28号</title>
<description>神戸に鉄人28号が設置されるのか。。なんか作者とゆかりがあるのだろうか。</description>
<dc:subject>etc</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-04T06:42:37+09:00</dc:date>
<content:encoded><![CDATA[
神戸に鉄人28号が設置されるのか。。<br />なんか作者とゆかりがあるのだろうか。<br /><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/KRhPnHjNSM4&hl=ja&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/KRhPnHjNSM4&hl=ja&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object><a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
<item rdf:about="http://sfpg.seesaa.net/article/131947541.html">
<link>http://sfpg.seesaa.net/article/131947541.html</link>
<title>R.S. vol.1 [ HD ] 3DCG 自主制作アニメ 第1話 : 牛山雅博</title>
<description>こういうのが自主制作できる世の中なのか。。。しかも製作年が2004年とは。。。</description>
<dc:subject>etc</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-03T19:29:35+09:00</dc:date>
<content:encoded><![CDATA[
こういうのが自主制作できる世の中なのか。。。<br />しかも製作年が2004年とは。。。<br /><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/XgGtNxOfxjA&hl=ja&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/XgGtNxOfxjA&hl=ja&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object><br /><a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
<item rdf:about="http://sfpg.seesaa.net/article/131939541.html">
<link>http://sfpg.seesaa.net/article/131939541.html</link>
<title>組織は合理的に失敗する</title>
<description>「組織は合理的に失敗する」をななめ読了。組織は合理的に失敗する(日経ビジネス人文庫)作者: 菊澤 研宗出版社/メーカー: 日本経済新聞出版社発売日: 2009/09/02メディア: 文庫</description>
<dc:subject>日記</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-03T17:48:17+09:00</dc:date>
<content:encoded><![CDATA[
「組織は合理的に失敗する」をななめ読了。<br /><!-- amazon --><br /><div class="seesaa-asin-area"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/453219511X/sfprogrpage-22/ref=nosim" target="_blank"><img src="http://ecx.images-amazon.com/images/I/41WCcfGb%2BqL._SL160_.jpg" class="seesaa-asin-image" alt="組織は合理的に失敗する(日経ビジネス人文庫)" title="組織は合理的に失敗する(日経ビジネス人文庫)" border="0" align="left" hspace="20" /></a><div class="seesaa-asin-info"><p class="seesaa-asin-title"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/453219511X/sfprogrpage-22/ref=nosim" target="_blank">組織は合理的に失敗する(日経ビジネス人文庫)</a></p><ul><li class="seesaa-asin-label">作者: 菊澤 研宗</li><li class="seesaa-asin-label">出版社/メーカー: 日本経済新聞出版社</li><li class="seesaa-asin-label">発売日: 2009/09/02</li><li class="seesaa-asin-label">メディア: 文庫</li></ul></div></div><div class="seesaa-asin-break"></div><br clear="all" /><br /><!--/ amazon --><br /><a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
<item rdf:about="http://sfpg.seesaa.net/article/131925927.html">
<link>http://sfpg.seesaa.net/article/131925927.html</link>
<title>_com_ptr_t</title>
<description>Windows7のDirect2Dハンズオン･ラボ（http://msdn.microsoft.com/ja-jp/windows/ee427969.aspx）を見ていて気づいたのだけれど、COMインターフェースのスマートポインタの定義に下記マクロを使っていた。_COM_SMARTPTR_TYPEDEF(IMyInterface , __uuidof(IMyInterface))VC 2008 Expressで検索すると、上記マクロ定義するとIMyInterfacePtrとい...</description>
<dc:subject>Library</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-03T15:28:21+09:00</dc:date>
<content:encoded><![CDATA[
<p>Windows7のDirect2Dハンズオン･ラボ（<a href="http://msdn.microsoft.com/ja-jp/windows/ee427969.aspx" target="_blank">http://msdn.microsoft.com/ja-jp/windows/ee427969.aspx</a>）を見ていて気づいたのだけれど、COMインターフェースのスマートポインタの定義に下記マクロを使っていた。</p>
<blockquote>_COM_SMARTPTR_TYPEDEF(IMyInterface , __uuidof(IMyInterface))</blockquote>
<p>VC 2008 Expressで検索すると、上記マクロ定義するとIMyInterfacePtrというcom_ptr_tのtypedefが生成されると書いてあった。<br/>
<a href="http://msdn.microsoft.com/ja-jp/library/417w8b3b(VS.100).aspx" target="_blank">http://msdn.microsoft.com/ja-jp/library/417w8b3b(VS.100).aspx</a><br/>
なのでVC限定だが、COMスマートポインタを自作したり、boost::instrusive_ptrを使わなくてもよかったのだった。
</p>



<a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
<item rdf:about="http://sfpg.seesaa.net/article/131909466.html">
<link>http://sfpg.seesaa.net/article/131909466.html</link>
<title>HTML5 canvas - Burn DEMO</title>
<description>またしても古いでもコードより引っ張ってきてcanvasに移植。&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Sample0005(Burn Demo)&amp;lt;/title&amp;gt;&amp;lt;script type="text/javascript" &amp;gt;/*--------------------------------------------------------------------  Fire Effect デモ by SFPGMR.  ...</description>
<dc:subject>HTML</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-03T11:38:24+09:00</dc:date>
<content:encoded><![CDATA[
またしても古いでもコードより引っ張ってきてcanvasに移植。<br/>
<iframe src="http://sfpgmr.web.fc2.com/sample0005.html" width="480" height="300" border="0" frameborder="0"></iframe>
<pre class="brush: js" >
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Sample0005(Burn Demo)&lt;/title&gt;
&lt;script type="text/javascript" &gt;

/*--------------------------------------------------------------------
  Fire Effect デモ by SFPGMR.
  元ネタ:Frank Jan Sorensenさんのパスカルコード
	元ソースコードのヘッダコメント 
	Hi guys, try this, use it in your code, but please credit
	Frank Jan Sorensen Alias:Frank Patxi (fjs@lab.jt.dk) for the
	fireroutine.
  --------------------------------------------------------------------*/



var ctx;
var bufimg;
var w,h;
var dt;
var WIDTH = 320;
var HEIGHT = 200;
var buffer = new Array(WIDTH * HEIGHT);
var maxColor     = 256;  // Constant for the MakePal procedure 
var palette = new Array(maxColor);
var rootRand     =  20;//  Max/Min decrease of the root of the flames 
var decay        =  5;//  How far should the flames go up on the screen?
var minY         = 10;//  Startingline of the flame routine.
                       //  (should be adjusted along with MinY above) 
var smooth       =   2;//  How descrete can the flames be?
var minFire      =  50;//  limit between the "starting to burn" and
                       //  the "is burning" routines 
var xStart       =  50;//  Startingpos on the screen}
var xEnd         = 270;//  Guess! 
var flameWidth        = xEnd - xStart;// Well- 
var fireIncrease  =   100;// 	3 = Wood, 90 = Gazolin 
var flameArray = new Array(flameWidth);// frame Array
var keyBuffer = new Array(0);
var moreFire = 1;

function rgb(hue, saturation, intensity)
{
  var T = 256.9999 * intensity / 2.0;
  this.r = Math.floor((1.0 + saturation * Math.sin(hue - 2.0 * Math.PI / 3.0)) * T);
  this.g = Math.floor((1.0 + saturation * Math.sin(hue)) * T);
  this.b = Math.floor((1.0 + saturation * Math.sin(hue + 2.0 * Math.PI / 3.0)) * T);
  
}

/*
function rgb(r,g,b)
{
	this.r = r;
	this.g = g;
	this.b = b;
}
*/
function pset(x,y,r,g,b,a)
{
	var st = (x + w * y) * 4;
	dt[st++] = r;
	dt[st++] = g;
	dt[st++] = b;
	dt[st++] = a;
}

function init()
{
	var log = "";
	for(var i = 0; i &lt; 256; ++i)
	{
		palette[i] = new rgb(4.6 - 1.5 * i / 64,i / 64.0,i / 64.0);
	}

	for(var i = 0; i &lt; WIDTH*HEIGHT;++i)
	{
		buffer[i] = 0;
	}

	for(var i = 0; i &lt; flameWidth;++i)
	{
		flameArray[i] = 0;
	}

}

function draw()
{	
	// get keycode
	var keyCode = ""
	if(keyBuffer.length &gt; 0)
	{	keyCode = keyBuffer.shift();
	}
	
	// Put the values from FlameArray on the bottom line of the screen
	for(var i = 0;i &lt; flameWidth;++i)
	{
		buffer[i + xStart + 199 * WIDTH] = flameArray[i];
	}
	
	//This loop makes the actual flames
	for(var i = xStart ; i &lt; xEnd; ++i)
	{
		for(var j = minY; j &lt; 200;++j)
		{
			var v = buffer[i + j * WIDTH];
			if(v == 0 || v &lt; decay || i &lt;= xStart || i &gt;= xEnd) 
			{
				buffer[i + (j - 1) * WIDTH] = 0;
			} else {
				buffer[i - (Math.floor((Math.random() * 3)) - 1) + (j - 1) * WIDTH] = v - Math.floor(Math.random() * decay);
			}
		}
	}
	
	if(Math.floor(Math.random() * 150) == 0 || keyCode == "F")
	{
		var r = Math.floor(Math.random() * (flameWidth - 5));
		for(var i = r;i &lt; (r + 5); ++i)
		{
			flameArray[i] = 255;
		}
	}
	
	if((keyCode == "A") && (moreFire &gt;-2))
	{
		--moreFire;
	}
	
	if((keyCode == "S") && (moreFire &lt; 4))
	{
		moreFire++;
	}
	
	if(keyCode &gt;= "1" && keyCode &lt;= "9")
	{
		fireIncrease = 3 + parseInt(keyCode) * 20;
	}
	
	for(var i = 0; i &lt; flameWidth;++i)
	{
		var x = flameArray[i];
		if(x &lt; minFire) {
			if(x &gt; 10) { x += Math.floor(Math.random() * fireIncrease); }
		} else {
			x += Math.floor(Math.random(rootRand * 2 + 1) - rootRand + moreFire);
		}
		if(x &gt; 255) x = 255;
		flameArray[i] = x;
	}
	
	for(var i = 1; i &lt; (flameWidth / 8);++i)
	{
		var X = Math.floor(Math.sqrt(Math.random()) * flameWidth / 8);
		flameArray[X] = 0;
		flameArray[flameWidth - 1 - X] = 0;
	}
	
	for( var i = smooth ; i &lt;  (flameWidth - smooth) ; ++i)
	{
		var X = 0;
		for(var j = -smooth ; j &lt; smooth;++j)
		{
			X += flameArray[i+j];
		}
		flameArray[i] = Math.round(X / (2 * smooth  + 1));
	}
	var b = bufimg.data;
	for(var i = 0; i &lt; WIDTH * HEIGHT; ++i)
	{
		b[i * 4 ] = palette[buffer[i]].r;
		b[i * 4 + 1] = palette[buffer[i]].g;
		b[i * 4 + 2] = palette[buffer[i]].b;
		b[i * 4 + 3] = 255;
	}
	ctx.putImageData(bufimg,0,0);
}

document.onkeydown = function()
{
	keyBuffer.push(String.fromCharCode(event.keyCode).toUpperCase());
}

window.onload = function()
{
	ctx = document.getElementById("ctx").getContext("2d");
	w = document.getElementById("ctx").flameWidth;
	h = document.getElementById("ctx").height;
	bufimg = ctx.createImageData(WIDTH,HEIGHT);
	init();
}


&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;Burn Demo&lt;/div&gt;
&lt;div&gt;キー操作：フルキー1～9 火勢調節 &lt;/div&gt;
&lt;input type="button" onclick="timerID = window.setInterval(draw,10);" value="Start"/ &gt;
&lt;input type="button" onclick="window.clearInterval(timerID);" value="Stop"/ &gt;
&lt;div&gt;
&lt;canvas id="ctx" width="320" height="200" style="border:1px solid gray;"&gt;&lt;/canvas&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;

</pre>
<a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
<item rdf:about="http://sfpg.seesaa.net/article/131870538.html">
<link>http://sfpg.seesaa.net/article/131870538.html</link>
<title>オオカミとブタ。Stop motion with wolf and pig.</title>
<description>すごいな。デジカメだからこそできるんだろうけど、、、。作品も凄いが、それにしてもこれに費やした労力にもっと凄さを感じる。</description>
<dc:subject>日記</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-02T22:10:06+09:00</dc:date>
<content:encoded><![CDATA[
すごいな。デジカメだからこそできるんだろうけど、、、。<br />作品も凄いが、それにしてもこれに費やした労力にもっと凄さを感じる。<br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/rmkLlVzUBn4&hl=ja&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/rmkLlVzUBn4&hl=ja&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
<item rdf:about="http://sfpg.seesaa.net/article/131869828.html">
<link>http://sfpg.seesaa.net/article/131869828.html</link>
<title>Direct2D入門</title>
<description>Direct2D入門。よくまとまっている。こういうページを見ると尊敬する。http://www.tkzdev.net/Direct2DとGDIの描画速度の違い。http://zoome.jp/pcuser/diary/14</description>
<dc:subject>Library</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-02T21:59:17+09:00</dc:date>
<content:encoded><![CDATA[
Direct2D入門。よくまとまっている。こういうページを見ると尊敬する。<br /><a href="http://www.tkzdev.net/" target="_blank">http://www.tkzdev.net/</a><br /><br />Direct2DとGDIの描画速度の違い。<br /><a href="http://zoome.jp/pcuser/diary/14" target="_blank">http://zoome.jp/pcuser/diary/14</a><a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
<item rdf:about="http://sfpg.seesaa.net/article/131748343.html">
<link>http://sfpg.seesaa.net/article/131748343.html</link>
<title>Fireエフェクト</title>
<description>どこかでゲットしたすごい古いコードをVistaで動かしてみた。もともとはWin3.1用であったが、WinGの部分をDIBに置き換えたらあっさり動いた。（たぶん作者はhttp://www.terra.es/personal3/jare70/）// ------------------------ WINFIRE.CPP ------------------------------// Win32 port By S.F. 2009.11.1.// もとネタは下記コメントを参照。...</description>
<dc:subject>etc</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-01T14:40:48+09:00</dc:date>
<content:encoded><![CDATA[
どこかでゲットしたすごい古いコードをVistaで動かしてみた。<br/>
もともとはWin3.1用であったが、WinGの部分をDIBに置き換えたらあっさり動いた。<br/>
（たぶん作者は<a href="http://www.terra.es/personal3/jare70/" target="_blank">http://www.terra.es/personal3/jare70/</a>）<br/>
<a href="http://sfpg.up.seesaa.net/image/20091031Fire.png" target="_blank"><img src="http://sfpg.up.seesaa.net/image/20091031Fire-thumbnail2.png" width="480" height="360" border="0" align="" alt="20091031Fire.png" onclick="location.href = 'http://sfpg.seesaa.net/upload/detail/image/20091031Fire-thumbnail2.png.html'; return false;" style="cursor:pointer;" /></a>
<br/>
<pre class="brush: js;" >
// ------------------------ WINFIRE.CPP ------------------------------
// Win32 port By S.F. 2009.11.1.
// もとネタは下記コメントを参照。WinGで組まれていたのをDIBに置き換えた。
// ---------------
// Coded bye Jare of Iguana near Xmas of 1994
// Comments to a880104@zipi.fi.upm.es
// My original ASM routine was 200 lines of plain ASM, this Windows
// version goes up to near 500 lines!!
// You can use this for anything you like, but you must credit me.

#include &lt;windows.h>
#include &lt;windowsx.h>
#include &lt;stdlib.h>
#include &lt;string.h>

    // Fire array size.
#define FIREW 128
#define FIREH  96
    // Nice size for the window. Frame will take some bits apart, however.
#define WINDOWW FIREW*4
#define WINDOWH FIREH*4

    // Handy msg structure.
typedef struct {
    HWND    hwnd;
    UINT    msg;
    WPARAM  wParam;
    LPARAM  lParam;
} tMSG, *pMSG;

    // Low Level data types.
typedef unsigned char  byte;
typedef unsigned short word;
typedef unsigned long  dword;

typedef byte  * Pbyte;
typedef word  * Pword;
typedef dword * Pdword;

typedef byte  FAR * LPbyte;
typedef word  FAR * LPword;
typedef dword FAR * LPdword;

// ===============================================================
// WinG DC handling functions.

struct dc {
	dc(HWND h): h_(h) {dc_ = GetDC(h);}
	~dc(){ReleaseDC(h_,dc_);}
	operator HDC() {return dc_;}

private:
	HDC dc_;
	HWND h_;
};

    // The stock default bitmap of a WinGDC.
static HBITMAP hBitmapMonochrome = 0;

    // Creates a top-down WinGDC with the specified rgb palette.
    // Returns the HDC and stores the bitmap pointer in ppSurfaceBits,
    // if not passed a NULL parameter.

HDC MakeWinGDC(HWND hwnd,RGBQUAD rgb[256], LPbyte *ppSurfaceBits) {
    HBITMAP hBitmapNew;
    int     i;
	static BITMAPINFO info;
	

        // Force top-down 8-bit bitmap of size FIREW*FIREH.
    info.bmiHeader.biSize         = sizeof(info.bmiHeader);
    info.bmiHeader.biPlanes       = 1;
    info.bmiHeader.biBitCount     = 8;
    info.bmiHeader.biCompression  = BI_RGB;
    info.bmiHeader.biSizeImage    = 0;
    info.bmiHeader.biClrUsed      = 0;
    info.bmiHeader.biClrImportant = 0;
    info.bmiHeader.biWidth        = FIREW;
    info.bmiHeader.biHeight       = -FIREH;    // Minus for top-down.

    for (i = 0; i &lt; 256; i++)
        info.bmiColors[i] = rgb[i];

    // Create a WinGDC and Bitmap, then select away DC's default
    // monochrome bitmap.
	dc hdc(hwnd);
	hBitmapNew = ::CreateDIBSection(hdc,&info,DIB_RGB_COLORS,(void**)ppSurfaceBits,NULL,NULL);
	HDC dcBitmap = ::CreateCompatibleDC(hdc);
	hBitmapMonochrome = (HBITMAP)SelectObject(dcBitmap,hBitmapNew);
	return dcBitmap;
}

    // Finishes the WinGDC. Pretty straightforward.

static void EndWinGDC(HDC hWinGDC) {
    HBITMAP hBitmapOld;
    if (hWinGDC && hBitmapMonochrome) {
            // Select the stock 1x1 monochrome bitmap back in
        hBitmapOld = (HBITMAP)SelectObject(hWinGDC,
                                           hBitmapMonochrome);
        hBitmapMonochrome = 0;
        DeleteObject(hBitmapOld);
        DeleteDC(hWinGDC);
    }
}

    // Creates a palette from the specified colors, but requires
    // using the system colors. Updates 'rgb' to enable the use of an
    // identity palette i.e. on exit, rgb contains the effective
    // palette, that can in turn be used for creating the WinGDC.

static HPALETTE CreateIdentityPalette(RGBQUAD aRGB[256], int nColors) 
{
    int i;
    static struct {
        WORD         Version;
        WORD         NumberOfEntries;
        PALETTEENTRY aEntries[256];
    } pal = {
        0x300,
        256
    };
        // For SYSPAL_STATIC, get the twenty static colors into
        // the array, then fill in the empty spaces with the
        // given color table
 
	{
		dc sysdc(NULL);
        // Get the static colors
		GetSystemPaletteEntries(sysdc, 0,   10, pal.aEntries);
		GetSystemPaletteEntries(sysdc, 246, 10, pal.aEntries + 246);

			// Set the peFlags of the lower static colors to zero.
			// And copy the static colors to the user palette so
			// the caller knows exactly which palette we created.
		for (i = 0; i &lt; 10; i++) {
			aRGB[i].rgbRed   = pal.aEntries[i].peRed;
			aRGB[i].rgbGreen = pal.aEntries[i].peGreen;
			aRGB[i].rgbBlue  = pal.aEntries[i].peBlue;
			pal.aEntries[i].peFlags = 0;
		}

			// Fill in the entries from the given color table
		for (; i &lt; nColors+10; i++) {
			pal.aEntries[i].peRed   = aRGB[i].rgbRed;
			pal.aEntries[i].peGreen = aRGB[i].rgbGreen;
			pal.aEntries[i].peBlue  = aRGB[i].rgbBlue;
			pal.aEntries[i].peFlags = PC_RESERVED;
		}

			// Mark any empty entries as PC_RESERVED
		for (; i &lt; 246; i++) {
			aRGB[i].rgbRed   = pal.aEntries[i].peRed;
			aRGB[i].rgbGreen = pal.aEntries[i].peGreen;
			aRGB[i].rgbBlue  = pal.aEntries[i].peBlue;
			pal.aEntries[i].peFlags = PC_RESERVED;
		}

			// Set the peFlags of the upper static colors to zero, and
			// copy static colors.
		for (; i &lt; 256; i++) {
			aRGB[i].rgbRed   = pal.aEntries[i].peRed;
			aRGB[i].rgbGreen = pal.aEntries[i].peGreen;
			aRGB[i].rgbBlue  = pal.aEntries[i].peBlue;
			pal.aEntries[i].peFlags = 0;
		}

	}

        // Create the palette
    return CreatePalette((LOGPALETTE *)&pal);
}

// ===============================================================
// Fire algorithm. Pure C, ASM will do it much faster.

static void DoFire(Pbyte to, Pbyte from) {
    int i, j;

    from += FIREW;
    to   += 0;

        // All lines but the first and last. The first will disappear,
        // and the last must be taken with care for the limits of the
        // array.
    for (i = 1; i &lt; FIREH-1; i++) {
            // Leftmost pixel.
        *to++ = (byte)((  (word)from[-1]          + (word)from[1]
                        + (word)from[-(int)FIREW] + (word)from[FIREW]) >> 2);
        from++;
            // Middle pixels.
        for (j = 1; j &lt; FIREW-1; j++) {
            *to++ = (byte)((  (word)from[-1]            + (word)from[1]
                            + (word)from[-(int)FIREW-1] + (word)from[-(int)FIREW+1]
                            + (word)from[+(int)FIREW-1] + (word)from[+(int)FIREW+1]
                            + (word)from[-(int)FIREW]   + (word)from[FIREW]
                           ) >> 3);
            from++;
        }
            // Rightmost pixel.
        *to++ = (byte)((  (word)from[-1]          + (word)from[1]
                        + (word)from[-(int)FIREW] + (word)from[FIREW]) >> 2);
        from++;
    }
        // Bottom line.
    for (j = 0; j &lt; FIREW-1; j++) {
        *to++ = (byte)((  (word)from[-1]          + (word)from[1]
                        + (word)from[-(int)FIREW] + (word)from[0]) >> 2);
        from++;
    }
        // Rightmost pixel of bottom line.
    *to = (byte)(((word)from[-1] + (word)from[-(int)FIREW]) >> 1);
}

// ===============================================================
// Fire Window message handlers.

    // Global vars.
static HINSTANCE AppInstance;       // ditto.

static HDC      ScreenHDC;          // WinGDC created.
static LPbyte   Screen;             // Pointer to the surface bitmap.
static UINT     Timer;              // Timer identifier.
static RGBQUAD  rgb[256];           // Palette used.
static HPALETTE Palette;            // Handle to it.
static int      WindowState;        // Minimized, maximized or normal?
static HICON    FireIcon;           // Handle to icon for QueryDragIcon.

    // Fire buffers. FAR so the are in their own data segment.
static byte FireBuf1[FIREW*FIREH], FireBuf2[FIREW*FIREH];
static Pbyte Buf1 = FireBuf1, Buf2 = FireBuf2;

// ---------- Message handlers.

static LRESULT wmCreate(pMSG msg) {
    int     i;

    FireIcon = LoadIcon(AppInstance, "FIREICON");

        // Create a smooth palette.
    memset(rgb, 0, sizeof(rgb));
    for (i = 10; i &lt; 10+16; i++)
        rgb[i].rgbRed   = (BYTE)((i-10)*16);
    for (; i &lt; 10+48; i++) {
        rgb[i].rgbRed   = 255;
        rgb[i].rgbGreen = (BYTE)((i-10-16)*8);
    }
    for (; i &lt; 10+80; i++) {
        rgb[i].rgbRed   = 255;
        rgb[i].rgbGreen = 255;
        rgb[i].rgbBlue  = (BYTE)((i-10-48)*8);
    }
    for (; i &lt; 10+236; i++) {
        rgb[i].rgbRed   = 255;
        rgb[i].rgbGreen = 255;
        rgb[i].rgbBlue  = 255;
    }

        // Clean up buffers.
    memset(FireBuf1, 0, sizeof(FireBuf1));
    memset(FireBuf2, 0, sizeof(FireBuf2));

        // Create stuff.
    Palette   = CreateIdentityPalette(rgb, 236);
	ScreenHDC = MakeWinGDC(msg->hwnd,rgb, &Screen);
    WindowState = SC_RESTORE;
    Timer     = SetTimer(msg->hwnd, 1, 1, NULL);
    return DefWindowProc(msg->hwnd, msg->msg, msg->wParam, msg->lParam);
}

static LRESULT wmDestroy(pMSG msg) {
    KillTimer(msg->hwnd, Timer);
    EndWinGDC(ScreenHDC);
    if (Palette != 0)
        DeleteObject(Palette);
    DestroyIcon(FireIcon);
    return DefWindowProc(msg->hwnd, msg->msg, msg->wParam, msg->lParam);
}

static LRESULT wmTimer(pMSG msg) {
    HDC     hdc;
    int     i;
    LPdword p;
    Pdword  q;
    Pbyte   s;
    RECT    r;

        // Clean bottom line.
    memset(Buf2 + FIREW*(FIREH-1), 0, FIREW);
        // Set random hot spots and animate.
    for (i = 0; i &lt; 20; i++) {
        int k = rand() % (FIREW-2);
        Buf2[FIREW*FIREH - k] = 235;
    }
    DoFire(Buf1, Buf2);

        // Copy buffer to the WinGDC bitmap, adding 10 for the colors.
    p = (LPdword)Screen;
    q = (Pdword)Buf1;
    for (i = 0; i &lt; FIREH*FIREW/4; i++)
        *p++ = *q++ + 0x0a0a0a0a;

        // Swap buffers.
    s = Buf1;
    Buf1 = Buf2;
    Buf2 = s;

        // Dump bitmap.
    GetClientRect(msg->hwnd, &r);
    hdc = GetDC(msg->hwnd);
    SelectPalette(hdc, Palette, FALSE);
    RealizePalette(hdc);

        // If window is not minimized or maximized, do optimal stretch
        // by multiplying by 2^2, else stretch to whatever the size.
        // Vertical stretch can be anything, as it doesn't slow down
        // if it's not stretched by a power of two.
    if (WindowState == SC_MINIMIZE || WindowState == SC_MAXIMIZE)
	{
		
        StretchBlt(hdc, 0, 0, r.right-r.left, r.bottom-r.top,
                       ScreenHDC, 0, 0, FIREW, FIREH,SRCCOPY);
	} else {
        StretchBlt(hdc, 0, 0, WINDOWW, r.bottom-r.top,
                       ScreenHDC, 0, 0, FIREW, FIREH,SRCCOPY);
	}

    ReleaseDC(msg->hwnd, hdc);

    return DefWindowProc(msg->hwnd, msg->msg, msg->wParam, msg->lParam);
}

static LRESULT wmQueryNewPalette(pMSG msg) {
    HDC hdc;
    LRESULT f;

    hdc = GetDC(msg->hwnd);
    if (Palette)
        SelectPalette(hdc, Palette, FALSE);
    f = RealizePalette(hdc);
    ReleaseDC(msg->hwnd, hdc);
    return f;
}

static LRESULT wmSysCommand(pMSG msg) {
    if (msg->wParam == SC_MINIMIZE ||
        msg->wParam == SC_MAXIMIZE ||
        msg->wParam == SC_RESTORE)
        WindowState = msg->wParam;
    return DefWindowProc(msg->hwnd, msg->msg, msg->wParam, msg->lParam);
}

static LRESULT wmWindowPosChanging(pMSG msg) {
    LPWINDOWPOS lpwp;
    RECT rw, rc;
    int  x, w;

        // If window is not maximized or minimized, align its client
        // area to a four-pixel boundary for optimal performance.
    if (WindowState == SC_RESTORE) {
        lpwp = (LPWINDOWPOS)msg->lParam;
        GetWindowRect(msg->hwnd, &rw);
        GetClientRect(msg->hwnd, &rc);
        w = rw.right - rw.left - (rc.right - rc.left); // Width of frame.
        x = lpwp->x + w;
        lpwp->x = (x & ~3) - w;   // Align it.
        if (lpwp->cx - w > WINDOWW)
            lpwp->cx = w + WINDOWW;
    }
    return DefWindowProc(msg->hwnd, msg->msg, msg->wParam, msg->lParam);
}


    // Window procedure.
LRESULT CALLBACK FireWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
    tMSG m;

    m.hwnd   = hwnd;
    m.msg    = msg;
    m.wParam = wParam;
    m.lParam = lParam;

    switch (msg) {
        case WM_CREATE:        return wmCreate(&m);
        case WM_DESTROY:       return wmDestroy(&m);
        case WM_QUERYDRAGICON:
            if (FireIcon != (HICON)NULL)
                return (LRESULT)FireIcon;
            break;

        case WM_TIMER: return wmTimer(&m);

        case WM_PALETTECHANGED:
            if ((HWND)wParam != hwnd)   // If we changed the palette.
                return wmQueryNewPalette(&m);
            break;
        case WM_QUERYNEWPALETTE: return wmQueryNewPalette(&m);

        case WM_WINDOWPOSCHANGING: return wmWindowPosChanging(&m);
        case WM_SYSCOMMAND:        return wmSysCommand(&m);

        case WM_CLOSE:
            PostQuitMessage(0);
            break;
    }

    return DefWindowProc(hwnd, msg, wParam, lParam);
}

// ===============================================================
// Main entry point.

int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) {
    static char ClassName[] = "WinFire";
    static char AppName[]   = "WinFire";
            int w, h;
            MSG msg;
           HWND hwnd;

    if (hPrev == 0) {
        WNDCLASS c;

        c.hCursor       = LoadCursor(NULL, IDC_WAIT);
        c.hIcon         = NULL;
        c.lpszMenuName  = NULL;
        c.lpszClassName = "WinFire";
        c.hbrBackground = NULL;
        c.hInstance     = hInst;
        c.style         = CS_BYTEALIGNCLIENT | CS_VREDRAW | CS_HREDRAW;
        c.lpfnWndProc   = (WNDPROC)FireWndProc;
        c.cbWndExtra    = 0;
        c.cbClsExtra    = 0;
        if (!RegisterClass(&c))
            return 1;
    }

    AppInstance = hInst;
    w = GetSystemMetrics(SM_CXSCREEN);
    h = GetSystemMetrics(SM_CYSCREEN);

    hwnd = CreateWindow (ClassName,                // Class name
                         AppName,                  // Caption
                         WS_OVERLAPPEDWINDOW,      // Style bits
                         (w-WINDOWW)/2, (h-WINDOWH)/2, // Position
                         WINDOWW, WINDOWH,             // Size
                         (HWND)NULL,               // Parent window (no parent)
                         (HMENU)NULL,              // no menu
                         hInst,                    // handle to window instance
                         (LPSTR)NULL               // no params to pass on
                        );
    if (hwnd == (HWND)NULL)
        return 1;
    ShowWindow(hwnd, sw);

    while (GetMessage(&msg, (HWND)NULL, 0, 0)) {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    return 0;
}

// ------------------------ WINFIRE.CPP ------------------------------


</pre><a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
<item rdf:about="http://sfpg.seesaa.net/article/131733013.html">
<link>http://sfpg.seesaa.net/article/131733013.html</link>
<title>WASAPI(21)</title>
<description>JUCEにはAudioIODeviceという基本クラスがあり、DirectSoundやASIOはこれを継承し、具象クラスとして実装されている。以前にも書いたが、JUCEの作者はすでにWASPIの共有モードでのAudioIODevice具象クラスWASAPIIODeviceを作成している。掲示板で見る限り良好に動いているようだ。http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=4404しかし、やはりWASA...</description>
<dc:subject>WASAPI</dc:subject>
<dc:creator>S.F.</dc:creator>
<dc:date>2009-11-01T11:18:02+09:00</dc:date>
<content:encoded><![CDATA[
<a href="http://www.rawmaterialsoftware.com/juce/" target="_blank">JUCE</a>には<a href="http://www.rawmaterialsoftware.com/juce/api/classAudioIODevice.html" target="_blank">AudioIODevice</a>という基本クラスがあり、DirectSoundやASIOはこれを継承し、具象クラスとして実装されている。<br /><br />以前にも書いたが、JUCEの作者はすでにWASPIの共有モードでのAudioIODevice具象クラス<a href="http://juce.git.sourceforge.net/git/gitweb.cgi?p=juce/juce;a=blob_plain;f=src/native/windows/juce_win32_WASAPI.cpp;hb=HEAD" target="_blank">WASAPIIODevice</a>を作成している。掲示板で見る限り良好に動いているようだ。<br /><a href="http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=4404" target="_blank">http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=4404</a><br /><br />しかし、やはりWASAPIは排他モードで行ったほうが、よりレイテンシの低いサウンド再生ができるので、私は排他モードで動かすIODeviceに拘り実装を続けている。<br /><br />もう少しで音を鳴らせるのだけれど、とにかく音だけを出したいっていう方針で進めてきたので、多少強引なコードになってしまっている。<br />デバッグしていて気づいたのだけれど、今の自分の実装だと「エンドポイントはステレオで、In・Outはサンプリングレートが同じで周波数も同じが前提！」というコードになってしまっているので融通が利かない。この部分をいろいろなデバイスに可能な限り柔軟にサポートできるようにしようかなと思っている。<br /><br />もうすぐまとまった休みが取れる（9日間）ので、そのときに一気に実装してしまいたいなと考えている。<br /><a name="more"></a>

]]><![CDATA[
]]></content:encoded>
</item>
</rdf:RDF>
