<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wesley&#039;s Techblog &#187; C++</title>
	<atom:link href="http://wesley.vidiqatch.org/category/programming/cpp/feed/" rel="self" type="application/rss+xml" />
	<link>http://wesley.vidiqatch.org</link>
	<description>This blog does not need a smart-ass tagline</description>
	<lastBuildDate>Wed, 09 Sep 2009 21:36:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>QPasm 1.1 RC1</title>
		<link>http://wesley.vidiqatch.org/09-09-2009/qpasm-1-1-rc1/</link>
		<comments>http://wesley.vidiqatch.org/09-09-2009/qpasm-1-1-rc1/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 21:11:27 +0000</pubDate>
		<dc:creator>Wesley</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[School]]></category>

		<guid isPermaLink="false">http://wesley.vidiqatch.org/?p=537</guid>
		<description><![CDATA[The last few days I&#8217;ve been improving the small pseudo-assembler interpreter/IDE that I had created. I am quite happy with the result.

The new version of QPasm has the following new features:

Code editor with intelligent syntax highlighting, line numbering, visual breakpoints and undo/redo functionality
Debugging features: breakpoints, manual step, timed step, pausing
On-the-fly editing of data in the [...]]]></description>
			<content:encoded><![CDATA[<p>The last few days I&#8217;ve been improving the small pseudo-assembler interpreter/IDE that I had created. I am quite happy with the result.</p>
<p><a href="http://wesley.vidiqatch.org/images/qpasm_1.1_rc1.png"><img class="alignnone" title="QPasm 1.1 RC1" src="http://wesley.vidiqatch.org/images/qpasm_1.1_rc1.png" alt="" width="625" height="394" /></a></p>
<p>The new version of QPasm has the following <strong>new</strong> features:</p>
<ul>
<li>Code editor with intelligent syntax highlighting, line numbering, visual breakpoints and undo/redo functionality</li>
<li>Debugging features: breakpoints, manual step, timed step, pausing</li>
<li>On-the-fly editing of data in the register or the memory</li>
<li>On-the-fly symbol resolving: labels can be used in assembler apps, and when modifying memory when the program is running the labels are resolved automatically</li>
<li>Integrates well with light and dark system themes. Highlighter chooses its color theme based on the darkness of the theme automatically, but colors and fonts can be configured manually as well</li>
<li>Layout, font and color settings are stored locally in a portable config.ini file</li>
<li>Input format is very flexible: white space may occur before, after and between instructions, instructions are case insensitive, comments are supported anywhere</li>
<li>Pseudo-assembler apps which are run using the run-function run in a separate thread which has a system preventing the GUI from freezing by limiting the amount of simultaneous signals to the GUI. Assembler apps which cause an endless loop cannot freeze the GUI</li>
</ul>
<p>More information, binaries and source code are available at <a href="http://code.google.com/p/qpasm/">http://code.google.com/p/qpasm/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://wesley.vidiqatch.org/09-09-2009/qpasm-1-1-rc1/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Small pseudo-assembler interpreter</title>
		<link>http://wesley.vidiqatch.org/30-08-2009/small-pseudo-assembler-interpreter/</link>
		<comments>http://wesley.vidiqatch.org/30-08-2009/small-pseudo-assembler-interpreter/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 14:02:56 +0000</pubDate>
		<dc:creator>Wesley</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[School]]></category>

		<guid isPermaLink="false">http://wesley.vidiqatch.org/?p=527</guid>
		<description><![CDATA[I had to develop a pseudo-assembler interpreter for the course Microprocessing.
Since it was just lying around on my hard drive I figured I could just as well put it on-line. It contains a few things that might be interesting to developers:

Using a C library in C++/Qt applications and translating C function callbacks into Qt signals
Implementation [...]]]></description>
			<content:encoded><![CDATA[<p>I had to develop a <strong>pseudo-assembler interpreter</strong> for the course <em><strong>Microprocessing</strong></em>.</p>
<p>Since it was just lying around on my hard drive I figured I could just as well put it on-line. It contains a few things that might be interesting to developers:</p>
<ul>
<li>Using a C library in C++/Qt applications and translating C function callbacks into Qt signals</li>
<li>Implementation of virtual static and virtual dynamic memory</li>
<li>Converting between virtual signed and unsigned values (system independent)</li>
<li>Saving data and instructions in same virtual memory (Von Neumann architecture)</li>
</ul>
<p style="text-align: center;"><a href="http://wesley.vidiqatch.org/files/qpasm/qpasm_1.0_screen.png"><img class="aligncenter" title="QPasm 1.0" src="http://wesley.vidiqatch.org/files/qpasm/qpasm_1.0_screen.png" alt="" width="614" height="340" /></a></p>
<p>More information (and source code) is available here: <a href="http://wesley.vidiqatch.org/files/qpasm/">http://wesley.vidiqatch.org/files/qpasm/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://wesley.vidiqatch.org/30-08-2009/small-pseudo-assembler-interpreter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>NeHe OpenGL lessons in Qt &#8211; Chapter 4</title>
		<link>http://wesley.vidiqatch.org/08-08-2009/nehe-opengl-lessons-in-qt-chapter-4/</link>
		<comments>http://wesley.vidiqatch.org/08-08-2009/nehe-opengl-lessons-in-qt-chapter-4/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 23:43:25 +0000</pubDate>
		<dc:creator>Wesley</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://wesley.vidiqatch.org/?p=414</guid>
		<description><![CDATA[As promised, the fourth chapter of the NeHe OpenGL lessons ported to make use of the Qt toolkit.
 
Fourth chapter: fog, fonts revisited, quadrics, particle engine, triangle strips, masking
In the fourth chapter you will learn a few cooler tricks. You will learn how to create good-looking fog effects and how certain objects can easily be [...]]]></description>
			<content:encoded><![CDATA[<p>As promised, the fourth chapter of the <a href="http://nehe.gamedev.net/">NeHe OpenGL lessons</a> ported to make use of the <a href="http://www.qtsoftware.com/">Qt toolkit</a>.</p>
<p style="text-align: center;"><img title="OpenGL" src="http://www.fabioruini.eu/blog/wp-content/uploads/2008/07/opengl_logo.png" alt="" width="137" height="72" /> <img title="Qt 4" src="http://www.qtsoftware.com/logo.png" alt="" width="174" height="71" /></p>
<h4>Fourth chapter: fog, fonts revisited, quadrics, particle engine, triangle strips, masking</h4>
<p>In the <a href="http://nehe.gamedev.net/lesson.asp?index=04">fourth chapter</a> you will learn a few cooler tricks. You will learn how to create good-looking fog effects and how certain objects can easily be constructed using quadrics. But the coolest thing that you will learn is how to create a simple <strong>particle engine</strong> (during lesson 19). To end off the chapter, you will learn how you can use masking to create partial transparency using bitmap textures.</p>
<p><em>Some minor modifications were made to improve the visual appearance of some of the lessons.</em></p>
<p><img class="aligncenter" title="Particle engine" src="http://wesley.vidiqatch.org/images/particles_snapshot.png" alt="" width="386" height="269" /></p>
<h4>Videos and source code</h4>
<p><a href="http://www.youtube.com/watch?v=SksYPqFCj4M&amp;fmt=18">This video</a> shows the fog effect (lesson 16)<br />
<a href="http://www.youtube.com/watch?v=5TxEGk6W-YU&amp;fmt=18">This video</a> shows what you can achieve using quadrics (lesson 18)<br />
<a href="http://www.youtube.com/watch?v=0FfH9fx_hJo&amp;fmt=18">This video</a> shows the very cool particle engine that you will create! (lesson 19)<br />
<a href="http://www.youtube.com/watch?v=gfBfRVgi5FU&amp;fmt=18">This video</a> shows which effect masking has (lesson 20)<br />
You can download the Qt 4 source code for this chapter <a href="http://wesley.vidiqatch.org/files/chapter4.zip"><strong>here</strong></a>.</p>
<p><em>PS: The port of chapter 5 will take a while&#8230; I will be a bit busy the coming weeks, and the first lesson of chapter 5 is HUGE, so will require a lot of time to port.<br />
Oh, and apparently I forgot to upload the source code for the third chapter. I have uploaded it now <img src='http://wesley.vidiqatch.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></p>
]]></content:encoded>
			<wfw:commentRss>http://wesley.vidiqatch.org/08-08-2009/nehe-opengl-lessons-in-qt-chapter-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NeHe OpenGL lessons in Qt – Chapter 3</title>
		<link>http://wesley.vidiqatch.org/04-08-2009/nehe-opengl-lessons-in-qt-chapter-3/</link>
		<comments>http://wesley.vidiqatch.org/04-08-2009/nehe-opengl-lessons-in-qt-chapter-3/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 19:57:01 +0000</pubDate>
		<dc:creator>Wesley</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://wesley.vidiqatch.org/?p=409</guid>
		<description><![CDATA[Here is the third chapter of the NeHe OpenGL lessons ported to make use of the Qt toolkit.
 
Third chapter: waving texture, display lists and a lot of fonts
The third chapter starts off with a cool looking waving flag effect. After that you will learn about display lists. The last three lessons focus on different [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the third chapter of the <a href="http://nehe.gamedev.net/">NeHe OpenGL lessons</a> ported to make use of the <a href="http://www.qtsoftware.com/">Qt toolkit</a>.</p>
<p style="text-align: center;"><img title="OpenGL" src="http://www.fabioruini.eu/blog/wp-content/uploads/2008/07/opengl_logo.png" alt="" width="137" height="72" /> <img title="Qt 4" src="http://www.qtsoftware.com/logo.png" alt="" width="174" height="71" /></p>
<h4>Third chapter: waving texture, display lists and a lot of fonts</h4>
<p>The <a href="http://nehe.gamedev.net/lesson.asp?index=03">third chapter</a> starts off with a cool looking <strong>waving flag effect</strong>. After that you will learn about <strong>display lists</strong>. The last three lessons focus on different ways of <strong>displaying fonts</strong>. It is worth noting that rendering basic text at a chosen location, or translated into the OpenGL scene is extremely easy in Qt/OpenGL thanks to <a href="http://doc.qtsoftware.com/4.5/qglwidget.html#renderText">QGLWidget::renderText()</a>. For other basic text effects (such as rotated, skewed or otherwise transformed text) you could also use <a href="http://doc.qtsoftware.com/4.5/qpainter.html">QPainter</a> directly on a <a href="http://doc.qtsoftware.com/4.5/qglwidget.html">QGLWidget</a>. We won&#8217;t be doing this in our examples, but I just wanted to point out that it is possible.</p>
<p>I should also note that I have used an extra library in lesson 14 to display the 3D text. Qt itself is not able to display 3D text and doing this in a cross-platform way yourself would be rather hard. That&#8217;s why I have used the <a href="http://sourceforge.net/projects/ftgl/develop"><strong>FTGL</strong></a> library for this. FTGL is a very easy to use cross-platform library with the sole purpose of rendering (3D) text in OpenGL.</p>
<h4>Videos and source code</h4>
<p><a href="http://www.youtube.com/watch?v=jy3g5TV0WRg&amp;fmt=18">This video</a> shows the waving flag effect (lesson 11)<br />
<a href="http://www.youtube.com/watch?v=-uaRypjMJuo&amp;fmt=18">This video</a> shows the effect of using display lists (lesson 12)<br />
<a href="http://www.youtube.com/watch?v=MZlRzwxqw3c&amp;fmt=18">This video</a> shows rotated 3D text (lesson 14)<br />
You can download the Qt 4 source code for this chapter <a href="http://wesley.vidiqatch.org/files/chapter3.zip"><strong>here</strong></a>.</p>
<p><em>PS: You can expect chapter 4 in a few days <img src='http://wesley.vidiqatch.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></p>
]]></content:encoded>
			<wfw:commentRss>http://wesley.vidiqatch.org/04-08-2009/nehe-opengl-lessons-in-qt-chapter-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Resizable photo frames in Qt</title>
		<link>http://wesley.vidiqatch.org/04-08-2009/resizable-photo-frames-in-qt/</link>
		<comments>http://wesley.vidiqatch.org/04-08-2009/resizable-photo-frames-in-qt/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 23:03:09 +0000</pubDate>
		<dc:creator>Wesley</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://wesley.vidiqatch.org/?p=388</guid>
		<description><![CDATA[Today someone asked how to copy one image into another image in Qt. I thought it was a nice idea to write an example about how to do that, plus a few extra things. We will create a resizable photo frame from just one simple image of a photo frame! It works like this:

Reimplement QWidget::paintEvent() [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Today someone asked how to copy one image into another image in Qt. I thought it was a nice idea to write an example about how to do that, plus a few extra things. We will create a resizable photo frame from just one simple image of a photo frame!</strong> It works like this:</p>
<ul>
<li>Reimplement <a href="http://doc.qtsoftware.com/latest/qwidget.html#paintEvent">QWidget::paintEvent()</a> and construct a <a href="http://doc.qtsoftware.com/latest/qpainter.html">QPainter</a>(this) in the reimplementation so we can draw on the widget</li>
<li>Load the image of the photo frame and define 4 <a href="http://doc.qtsoftware.com/latest/qrect.html">QRect</a> objects to define the position of the frame borders &#8211; these borders are not allowed to scale</li>
<li>Draw something which will be contained inside of the frame &#8211; for example another image using <a href="http://doc.qtsoftware.com/latest/qpainter.html#drawPixmap">QPainter::drawPixmap()</a> or <a href="http://doc.qtsoftware.com/latest/qpainter.html#drawImage">QPainter::drawImage()</a></li>
<li>Generate and draw the frame bars (the pieces between the borders)
<ul>
<li>Make use of the <a href="http://doc.qtsoftware.com/latest/qimage.html#mirrored">QImage::mirrored()</a> function and another QPainter to create a new pixmap which contains the frame bar plus the mirrored frame bar.</li>
<li>This will make the bar look great when the frame bar is enlarged by tiling. This method is actually a very popular one in basic photo manipulation.</li>
</ul>
</li>
<li>Draw the four borders</li>
</ul>
<p><strong>The result looks like this:</strong></p>
<p><a href="http://wesley.vidiqatch.org/images/photowidget1.png">Photo frame in native size</a> &#8211; versus &#8211; <a href="http://wesley.vidiqatch.org/images/photowidget2.png">Enlarged photo frame</a></p>
<p><strong>The code looks like this:</strong></p>
<p style="text-align: center;">photowidget.h</p>
<div class="codecolorer-container cpp-qt default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td><div class="cpp-qt codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006E28;">#ifndef PHOTOWIDGET_H</span><br />
<span style="color: #006E28;">#define PHOTOWIDGET_H</span><br />
<br />
<span style="color: #006E28;">#include &lt;QtGui/QWidget&gt;</span><br />
<br />
<span style="color: #0057AE;">class</span> PhotoWidget <span style="color: #006E28;">:</span> <span style="color: #0057AE;">public</span> <a href="http://doc.trolltech.com/latest/qwidget.html"><span style="color: #22aadd;">QWidget</span></a> <span style="color: #006E28;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0057AE;">Q_OBJECT</span><br />
<br />
<span style="color: #0057AE;">public</span><span style="color: #006E28;">:</span><br />
&nbsp; &nbsp; PhotoWidget<span style="color: #006E28;">&#40;</span><a href="http://doc.trolltech.com/latest/qwidget.html"><span style="color: #22aadd;">QWidget</span></a> <span style="color: #006E28;">*</span>parent <span style="color: #006E28;">=</span> 0<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
<br />
<span style="color: #0057AE;">protected</span><span style="color: #006E28;">:</span><br />
&nbsp; &nbsp; <span style="color: #0057AE;">void</span> paintEvent<span style="color: #006E28;">&#40;</span><a href="http://doc.trolltech.com/latest/qpaintevent.html"><span style="color: #22aadd;">QPaintEvent</span></a> <span style="color: #006E28;">*</span>event<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
<br />
<span style="color: #0057AE;">private</span><span style="color: #006E28;">:</span><br />
&nbsp; &nbsp; <a href="http://doc.trolltech.com/latest/qpixmap.html"><span style="color: #22aadd;">QPixmap</span></a> createBar<span style="color: #006E28;">&#40;</span>Qt<span style="color: #006E28;">::</span><span style="color: #2B74C7;">Orientation</span> orientation<span style="color: #006E28;">,</span> <span style="color: #0057AE;">const</span> <a href="http://doc.trolltech.com/latest/qpixmap.html"><span style="color: #22aadd;">QPixmap</span></a> <span style="color: #006E28;">&amp;</span>pixmap<span style="color: #006E28;">,</span> <span style="color: #0057AE;">const</span> <a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a> <span style="color: #006E28;">&amp;</span>rect<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
<span style="color: #006E28;">&#125;</span><span style="color: #006E28;">;</span><br />
<br />
<span style="color: #006E28;">#endif // PHOTOWIDGET_H</span></div></td></tr></tbody></table></div>
<p style="text-align: center;">photowidget.cpp</p>
<div class="codecolorer-container cpp-qt default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br /></div></td><td><div class="cpp-qt codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006E28;">#include &quot;photowidget.h&quot;</span><br />
<span style="color: #006E28;">#include &lt;QPainter&gt;</span><br />
<span style="color: #006E28;">#include &lt;QPaintEvent&gt;</span><br />
<br />
<span style="color: #006E28;">#define SIZE 108</span><br />
<br />
PhotoWidget<span style="color: #006E28;">::</span><span style="color: #2B74C7;">PhotoWidget</span><span style="color: #006E28;">&#40;</span><a href="http://doc.trolltech.com/latest/qwidget.html"><span style="color: #22aadd;">QWidget</span></a> <span style="color: #006E28;">*</span>parent<span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">:</span> <a href="http://doc.trolltech.com/latest/qwidget.html"><span style="color: #22aadd;">QWidget</span></a><span style="color: #006E28;">&#40;</span>parent<span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">&#123;</span><br />
&nbsp; &nbsp; resize<span style="color: #006E28;">&#40;</span>400<span style="color: #006E28;">,</span> 329<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; setWindowTitle<span style="color: #006E28;">&#40;</span><span style="color: #BF0303;">&quot;Photo Frame Example&quot;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
<span style="color: #006E28;">&#125;</span><br />
<br />
<span style="color: #888888;">// This function generates a pixmap that can be used as a tiled bar.</span><br />
<span style="color: #888888;">// Note: We use a QPainter and the mirrored() function to make sure that the bar looks good when tiled.</span><br />
<span style="color: #888888;">// &nbsp; &nbsp; &nbsp; This technique is often applied in basic photo manipulation.</span><br />
<a href="http://doc.trolltech.com/latest/qpixmap.html"><span style="color: #22aadd;">QPixmap</span></a> PhotoWidget<span style="color: #006E28;">::</span><span style="color: #2B74C7;">createBar</span><span style="color: #006E28;">&#40;</span>Qt<span style="color: #006E28;">::</span><span style="color: #2B74C7;">Orientation</span> orientation<span style="color: #006E28;">,</span> <span style="color: #0057AE;">const</span> <a href="http://doc.trolltech.com/latest/qpixmap.html"><span style="color: #22aadd;">QPixmap</span></a> <span style="color: #006E28;">&amp;</span>pixmap<span style="color: #006E28;">,</span> <span style="color: #0057AE;">const</span> <a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a> <span style="color: #006E28;">&amp;</span>rect<span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://doc.trolltech.com/latest/qimage.html"><span style="color: #22aadd;">QImage</span></a> barA <span style="color: #006E28;">=</span> pixmap.<span style="color: #2B74C7;">copy</span><span style="color: #006E28;">&#40;</span>rect<span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">toImage</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; <a href="http://doc.trolltech.com/latest/qimage.html"><span style="color: #22aadd;">QImage</span></a> barB <span style="color: #006E28;">=</span> barA.<span style="color: #2B74C7;">mirrored</span><span style="color: #006E28;">&#40;</span>orientation <span style="color: #006E28;">==</span> Qt<span style="color: #006E28;">::</span><span style="color: #2B74C7;">Horizontal</span> ? <span style="color: #0057AE;">true</span> <span style="color: #006E28;">:</span> <span style="color: #0057AE;">false</span><span style="color: #006E28;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; orientation <span style="color: #006E28;">==</span> Qt<span style="color: #006E28;">::</span><span style="color: #2B74C7;">Vertical</span> ? <span style="color: #0057AE;">true</span> <span style="color: #006E28;">:</span> <span style="color: #0057AE;">false</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
<br />
&nbsp; &nbsp; <a href="http://doc.trolltech.com/latest/qsize.html"><span style="color: #22aadd;">QSize</span></a> size<span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; size.<span style="color: #2B74C7;">setWidth</span><span style="color: #006E28;">&#40;</span>orientation <span style="color: #006E28;">==</span> Qt<span style="color: #006E28;">::</span><span style="color: #2B74C7;">Horizontal</span> ? barA.<span style="color: #2B74C7;">width</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">&lt;&lt;</span> 1 <span style="color: #006E28;">:</span> barA.<span style="color: #2B74C7;">width</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; size.<span style="color: #2B74C7;">setHeight</span><span style="color: #006E28;">&#40;</span>orientation <span style="color: #006E28;">==</span> Qt<span style="color: #006E28;">::</span><span style="color: #2B74C7;">Vertical</span> ? barA.<span style="color: #2B74C7;">height</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">&lt;&lt;</span> 1 <span style="color: #006E28;">:</span> barA.<span style="color: #2B74C7;">height</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
<br />
&nbsp; &nbsp; <a href="http://doc.trolltech.com/latest/qpixmap.html"><span style="color: #22aadd;">QPixmap</span></a> bar<span style="color: #006E28;">&#40;</span>size<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; bar.<span style="color: #2B74C7;">fill</span><span style="color: #006E28;">&#40;</span>Qt<span style="color: #006E28;">::</span><span style="color: #2B74C7;">transparent</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; <a href="http://doc.trolltech.com/latest/qpainter.html"><span style="color: #22aadd;">QPainter</span></a> merger<span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&amp;</span>bar<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
<br />
&nbsp; &nbsp; merger.<span style="color: #2B74C7;">drawImage</span><span style="color: #006E28;">&#40;</span>0<span style="color: #006E28;">,</span> 0<span style="color: #006E28;">,</span> barA<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight:bold;">if</span> <span style="color: #006E28;">&#40;</span>orientation <span style="color: #006E28;">==</span> Qt<span style="color: #006E28;">::</span><span style="color: #2B74C7;">Horizontal</span><span style="color: #006E28;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; merger.<span style="color: #2B74C7;">drawImage</span><span style="color: #006E28;">&#40;</span>barA.<span style="color: #2B74C7;">width</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> 0<span style="color: #006E28;">,</span> barB<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight:bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; merger.<span style="color: #2B74C7;">drawImage</span><span style="color: #006E28;">&#40;</span>0<span style="color: #006E28;">,</span> barA.<span style="color: #2B74C7;">height</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> barB<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight:bold;">return</span> bar<span style="color: #006E28;">;</span><br />
<span style="color: #006E28;">&#125;</span><br />
<br />
<span style="color: #0057AE;">void</span> PhotoWidget<span style="color: #006E28;">::</span><span style="color: #2B74C7;">paintEvent</span><span style="color: #006E28;">&#40;</span><a href="http://doc.trolltech.com/latest/qpaintevent.html"><span style="color: #22aadd;">QPaintEvent</span></a> <span style="color: #006E28;">*</span>event<span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://doc.trolltech.com/latest/qpainter.html"><span style="color: #22aadd;">QPainter</span></a> p<span style="color: #006E28;">&#40;</span><span style="color: #000000; font-weight:bold;">this</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #888888;">// Our frame as one full image, and an image to put in the frame</span><br />
&nbsp; &nbsp; <a href="http://doc.trolltech.com/latest/qpixmap.html"><span style="color: #22aadd;">QPixmap</span></a> frame<span style="color: #006E28;">&#40;</span><span style="color: #BF0303;">&quot;:/img/frame.png&quot;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; <a href="http://doc.trolltech.com/latest/qpixmap.html"><span style="color: #22aadd;">QPixmap</span></a> sky<span style="color: #006E28;">&#40;</span><span style="color: #BF0303;">&quot;:/img/palmtree.jpg&quot;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #888888;">// These four rectangles define the four borders of the frame</span><br />
&nbsp; &nbsp; <a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a> topLeft<span style="color: #006E28;">&#40;</span>0<span style="color: #006E28;">,</span> 0<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; <a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a> topRight<span style="color: #006E28;">&#40;</span>frame.<span style="color: #2B74C7;">width</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> SIZE<span style="color: #006E28;">,</span> 0<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; <a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a> bottomLeft<span style="color: #006E28;">&#40;</span>0<span style="color: #006E28;">,</span> frame.<span style="color: #2B74C7;">height</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> SIZE<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; <a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a> bottomRight<span style="color: #006E28;">&#40;</span>frame.<span style="color: #2B74C7;">width</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> SIZE<span style="color: #006E28;">,</span> frame.<span style="color: #2B74C7;">height</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> SIZE<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #888888;">// Draw the image first</span><br />
&nbsp; &nbsp; p.<span style="color: #2B74C7;">drawPixmap</span><span style="color: #006E28;">&#40;</span><a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a><span style="color: #006E28;">&#40;</span>40<span style="color: #006E28;">,</span> 40<span style="color: #006E28;">,</span> event<span style="color: #006E28;">-&gt;</span><span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">width</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> 80<span style="color: #006E28;">,</span> event<span style="color: #006E28;">-&gt;</span><span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">height</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> 80<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> sky<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #888888;">// Draw the bars</span><br />
&nbsp; &nbsp; p.<span style="color: #2B74C7;">drawTiledPixmap</span><span style="color: #006E28;">&#40;</span><a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a><span style="color: #006E28;">&#40;</span><a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>SIZE<span style="color: #006E28;">,</span> 0<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> event<span style="color: #006E28;">-&gt;</span><span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">topRight</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">+</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">-</span>SIZE<span style="color: #006E28;">,</span> SIZE <span style="color: #006E28;">-</span> 1<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; createBar<span style="color: #006E28;">&#40;</span>Qt<span style="color: #006E28;">::</span><span style="color: #2B74C7;">Horizontal</span><span style="color: #006E28;">,</span> frame<span style="color: #006E28;">,</span> <a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a><span style="color: #006E28;">&#40;</span><a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>SIZE<span style="color: #006E28;">,</span> 0<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> frame.<span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">topRight</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">+</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">-</span>SIZE<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; p.<span style="color: #2B74C7;">drawTiledPixmap</span><span style="color: #006E28;">&#40;</span><a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a><span style="color: #006E28;">&#40;</span>event<span style="color: #006E28;">-&gt;</span><span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">bottomLeft</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">+</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>SIZE<span style="color: #006E28;">,</span> <span style="color: #006E28;">-</span>SIZE <span style="color: #006E28;">-</span> 1<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> event<span style="color: #006E28;">-&gt;</span><span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">bottomRight</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>SIZE<span style="color: #006E28;">,</span> 0<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; createBar<span style="color: #006E28;">&#40;</span>Qt<span style="color: #006E28;">::</span><span style="color: #2B74C7;">Horizontal</span><span style="color: #006E28;">,</span> frame<span style="color: #006E28;">,</span> <a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a><span style="color: #006E28;">&#40;</span>frame.<span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">bottomLeft</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">+</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>SIZE<span style="color: #006E28;">,</span> <span style="color: #006E28;">-</span>SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> frame.<span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">bottomRight</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>SIZE<span style="color: #006E28;">,</span> 0<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; p.<span style="color: #2B74C7;">drawTiledPixmap</span><span style="color: #006E28;">&#40;</span><a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a><span style="color: #006E28;">&#40;</span><a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>0<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> event<span style="color: #006E28;">-&gt;</span><span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">bottomLeft</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">+</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>SIZE<span style="color: #006E28;">,</span> <span style="color: #006E28;">-</span>SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; createBar<span style="color: #006E28;">&#40;</span>Qt<span style="color: #006E28;">::</span><span style="color: #2B74C7;">Vertical</span><span style="color: #006E28;">,</span> frame<span style="color: #006E28;">,</span> <a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a><span style="color: #006E28;">&#40;</span><a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>0<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> frame.<span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">bottomLeft</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">+</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>SIZE<span style="color: #006E28;">,</span> <span style="color: #006E28;">-</span>SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; p.<span style="color: #2B74C7;">drawTiledPixmap</span><span style="color: #006E28;">&#40;</span><a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a><span style="color: #006E28;">&#40;</span>event<span style="color: #006E28;">-&gt;</span><span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">topRight</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>SIZE <span style="color: #006E28;">+</span> 1<span style="color: #006E28;">,</span> <span style="color: #006E28;">-</span>SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> event<span style="color: #006E28;">-&gt;</span><span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">bottomRight</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>0<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; createBar<span style="color: #006E28;">&#40;</span>Qt<span style="color: #006E28;">::</span><span style="color: #2B74C7;">Vertical</span><span style="color: #006E28;">,</span> frame<span style="color: #006E28;">,</span> <a href="http://doc.trolltech.com/latest/qrect.html"><span style="color: #22aadd;">QRect</span></a><span style="color: #006E28;">&#40;</span>frame.<span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">topRight</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>SIZE<span style="color: #006E28;">,</span> <span style="color: #006E28;">-</span>SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> frame.<span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">bottomRight</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>0<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #888888;">// Draw the borders</span><br />
&nbsp; &nbsp; p.<span style="color: #2B74C7;">drawPixmap</span><span style="color: #006E28;">&#40;</span><a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>0<span style="color: #006E28;">,</span> 0<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> frame<span style="color: #006E28;">,</span> topLeft<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; p.<span style="color: #2B74C7;">drawPixmap</span><span style="color: #006E28;">&#40;</span>event<span style="color: #006E28;">-&gt;</span><span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">topRight</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>SIZE<span style="color: #006E28;">,</span> 0<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> frame<span style="color: #006E28;">,</span> topRight<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; p.<span style="color: #2B74C7;">drawPixmap</span><span style="color: #006E28;">&#40;</span>event<span style="color: #006E28;">-&gt;</span><span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">bottomLeft</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>0<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> frame<span style="color: #006E28;">,</span> bottomLeft<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
&nbsp; &nbsp; p.<span style="color: #2B74C7;">drawPixmap</span><span style="color: #006E28;">&#40;</span>event<span style="color: #006E28;">-&gt;</span><span style="color: #2B74C7;">rect</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span>.<span style="color: #2B74C7;">bottomRight</span><span style="color: #006E28;">&#40;</span><span style="color: #006E28;">&#41;</span> <span style="color: #006E28;">-</span> <a href="http://doc.trolltech.com/latest/qpoint.html"><span style="color: #22aadd;">QPoint</span></a><span style="color: #006E28;">&#40;</span>SIZE<span style="color: #006E28;">,</span> SIZE<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">,</span> frame<span style="color: #006E28;">,</span> bottomRight<span style="color: #006E28;">&#41;</span><span style="color: #006E28;">;</span><br />
<span style="color: #006E28;">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://wesley.vidiqatch.org/04-08-2009/resizable-photo-frames-in-qt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NeHe OpenGL lessons in Qt &#8211; Chapter 1 and 2</title>
		<link>http://wesley.vidiqatch.org/03-08-2009/nehe-opengl-lessons-in-qt-chapter-1-and-2/</link>
		<comments>http://wesley.vidiqatch.org/03-08-2009/nehe-opengl-lessons-in-qt-chapter-1-and-2/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 17:16:38 +0000</pubDate>
		<dc:creator>Wesley</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://wesley.vidiqatch.org/?p=365</guid>
		<description><![CDATA[Last week I have ported two chapters (the first 10 lessons) of the NeHe OpenGL lessons to make use of the Qt toolkit. You will notice that the code in Qt is much cleaner and simpler than the code in the original NeHe lessons. There is no need to create a rendering or device context [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I have ported two chapters (the first 10 lessons) of the <a href="http://nehe.gamedev.net/">NeHe OpenGL lessons</a> to make use of the <a href="http://www.qtsoftware.com/">Qt toolkit</a>. You will notice that the code in Qt is much <strong>cleaner</strong> and <strong>simpler</strong> than the code in the original NeHe lessons. There is no need to create a rendering or device context yourself or anything like that, and input support like input from keyboard or mouse can simply be implemented by reimplementing one function. As an added bonus, your 3D applications will run on pretty much any platform.</p>
<p style="text-align: center;"><img title="OpenGL" src="http://www.fabioruini.eu/blog/wp-content/uploads/2008/07/opengl_logo.png" alt="" width="137" height="72" /> <img title="Qt 4" src="http://www.qtsoftware.com/logo.png" alt="" width="174" height="71" /></p>
<h4>First chapter: setting up an OpenGL window, polygons, colors, rotation, 3D shapes</h4>
<p>After completing the <a href="http://nehe.gamedev.net/lesson.asp?index=01">first chapter</a>, you will end up with a rotating pyramid and cube&#8230;<a href="http://www.youtube.com/watch?v=dE3_vgnm7Ck&amp;fmt=18"></a></p>
<p><a href="http://www.youtube.com/watch?v=dE3_vgnm7Ck&amp;fmt=18">This video</a> shows the end result (lesson 5).<br />
You can download the Qt 4 source code for this chapter <a href="http://wesley.vidiqatch.org/files/chapter1.zip"><strong>here</strong></a>.</p>
<h4>Second chapter: texture mapping, texture filters, lighting, keyboard control, blending, moving bitmaps in 3D space, loading and moving through a 3D world</h4>
<p>In the <a href="http://nehe.gamedev.net/lesson.asp?index=02">second chapter</a> you will learn a lot about textures, among some other things. Sometimes we make use of <a href="http://doc.qtsoftware.com/4.5/qglcontext.html#bindTexture">QGLContext::bindTexture()</a> to load an image, morph it into a texture and bind it to OpenGL all in one go. Other times we will do it manually because we want to specify the texture filter ourselves (but we do have <a href="http://doc.qtsoftware.com/4.5/qglwidget.html#convertToGLFormat">QGLWidget::convertToGLFormat()</a> which makes that easy as well). To handle keypresses we simply reimplement <a href="http://doc.qtsoftware.com/4.5/qwidget.html#keyPressEvent">keyPressEvent()</a>. To load in the 3D world from the file we make use of the excellent <a href="http://doc.qtsoftware.com/4.5/qfile.html">QFile</a> and <a href="http://doc.qtsoftware.com/4.5/qtextstream.html">QTextStream</a> classes. As an added <strong>bonus</strong>, we also make use of <a href="http://doc.qtsoftware.com/4.5/qglwidget.html#renderText">QGLWidget::renderText()</a> to show the user what has changed when a key is pressed inside the OpenGL window. Lesson 9 also features a <strong>bonus</strong> fade-in effect for the revived stars. This makes the effect look much cooler.</p>
<p><a href="http://www.youtube.com/watch?v=_apiJu9oF8A&amp;fmt=18">This video</a> shows the result of adding texture filters, lighting and keyboard control (lesson 7)<br />
<a href="http://www.youtube.com/watch?v=uoa8x4Vwxco&amp;fmt=18">This video</a> shows the result of all the above plus blending (lesson 8<em></em>)<br />
<a href="http://www.youtube.com/watch?v=MoFNngz7_qg&amp;fmt=18">This video</a> shows the result of moving bitmaps in 3D space (lesson 9)<br />
<a href="http://www.youtube.com/watch?v=JSybmJKGu1k&amp;fmt=18">This video</a> shows the result of moving through a very simple 3D world (lesson 10)<br />
You can download the Qt 4 source code for this chapter <a href="http://wesley.vidiqatch.org/files/chapter2.zip"><strong>here</strong></a>.</p>
<p>The <strong>third and fourth chapter</strong> are almost complete as well, but I will give you the Qt ports of those chapters another time. Perhaps tomorrow.</p>
]]></content:encoded>
			<wfw:commentRss>http://wesley.vidiqatch.org/03-08-2009/nehe-opengl-lessons-in-qt-chapter-1-and-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Open source DJ mixxx&#8217;ing</title>
		<link>http://wesley.vidiqatch.org/06-01-2008/open-source-dj-mixxxing/</link>
		<comments>http://wesley.vidiqatch.org/06-01-2008/open-source-dj-mixxxing/#comments</comments>
		<pubDate>Sun, 06 Jan 2008 15:33:16 +0000</pubDate>
		<dc:creator>Wesley</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mixxx]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://wesley.debianbox.be/2008/01/06/open-source-dj-mixxxing/</guid>
		<description><![CDATA[Sinds vorige week ben ik begonnen met mee te helpen aan de ontwikkeling van het open source DJ programma mixxx. Mixxx is een stabiel programma waarmee men live muziek kan mixen. Het heeft een aantal zeer interessante features, zoals bijvoorbeeld automatische ritmedetectie en ondersteuning voor een heleboel hardware.

Waar staan we vandaag? 1.6.0
Ik werk mee aan [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #000000;"><strong>Sinds vorige week ben ik begonnen met mee te helpen aan de ontwikkeling van het open source DJ programma mixxx. Mixxx is een stabiel programma waarmee men live muziek kan mixen. Het heeft een aantal zeer interessante features, zoals bijvoorbeeld automatische ritmedetectie en ondersteuning voor een heleboel hardware.</strong></span></p>
<p style="text-align: center;"><a href="http://wesley.vidiqatch.org/images/mixxx.png"><span style="color: #000080;"><img style="border: 0pt none;" src="http://wesley.vidiqatch.org/images/mixxx_thumb.png" border="1" alt="Mixxx 1.6.0 with Collusion/WS/Green skin" align="bottom" /></span></a></p>
<p style="margin-bottom: 0cm"><span style="color: #0066cc;"><span style="font-size: medium;"><strong>Waar staan we vandaag? 1.6.0</strong></span></span></p>
<p>Ik werk mee aan de nieuwe versie waarvan twee weken geleden een eerste bètaversie werd gelanceerd. Voor de nieuwe 1.6.0 versie zijn een heleboel nieuwe features gepland. Ik som even de belangrijkste veranderingen op:</p>
<ul>
<li>Scratchen via <strong>timecoded 	vinyl</strong>-platen <em>[ <a href="http://www.youtube.com/watch?v=U2ZPSSXlK60">link 	naar flash video 1</a>, <a href="http://www.youtube.com/watch?v=9dRLNT2yspg">video 2</a> ]</em></li>
<li><strong>Kleurenschema&#8217;s</strong> voor skins</li>
<li>Nieuwe <strong>muziekbibliotheek</strong> (muziekbrowser)</li>
<li>Verbeterde <strong>ritmedetectie</strong></li>
<li>Verbeterde ondersteuning voor <strong>MIDI-controllers</strong> (hardware)</li>
<li><strong>HQ-equalizer</strong> toegevoegd</li>
<li>Audio core herschreven/vernieuwd</li>
<li>Ondersteuning voor <strong>LADSPA geluidseffecten</strong></li>
<li><strong>Live broadcasten</strong> over internet (Icecast, Shoutcast)</li>
<li><strong>Rechtstreeks opnemen</strong> naar MP3, Ogg Vorbis, Wav, Flac</li>
</ul>
<p>Ik werk momenteel aan de laatste twee punten. Het is niet zeker of het helemaal af zal raken voor de <em>Hardy freeze</em> in februari (het moment waarop programma&#8217;s naar <em>Ubuntu 8.04 Hardy Heron</em> geupload worden en niet meer aangepast mogen worden) maar Ogg Vorbis Icecast/Shoutcast-ondersteuning is zo goed als af, dus dat zal er waarschijnlijk zeker inzitten.</p>
<p>Zelf kijk ik uit naar de ondersteuning voor LADSPA geluidseffecten, maar ik vermoed dat dat niet af zal raken voor de 1.6.0-versie. Dan maar wat langer wachten&#8230;</p>
<p style="margin-bottom: 0cm"><span style="font-size: medium;"><span style="color: #0066cc;"><strong>Evolutie van de broadcasting code</strong></span></span></p>
<p style="margin-bottom: 0cm; text-align: center;"><a href="http://wesley.vidiqatch.org/images/mixxx_broadcast_prefs.png"><img title="Mixxx Live Broadcasting Preferences" src="http://wesley.vidiqatch.org/images/mixxx_broadcast_prefs_thumb.png" alt="Mixxx Live Broadcasting Preferences" /></a></p>
<p>Zoals eerder gezegd ben ik momenteel bezig met het implementeren van Icecast/Shoutcast ondersteuning zodat we een mix rechtstreeks over internet kunnen broadcasten. Aanvankelijk dachten we dat het simpel zou zijn om dit systeem te implementeren (gewoon <em>libshout</em> gebruiken) maar al snel bleek dat we eerst nog een encoder moesten schrijven. Ik ben de laatste dagen dus vooral bezig geweest met het schrijven van een Ogg Vorbis-encoder met behulp van <em>libvorbis</em>, <em>libogg</em> en <em>libvorbisenc</em>.</p>
<p>Afgezien van het feit dat er voor libvorbis <strong>geen technische API-documentatie</strong> beschikbaar is, is het ons uiteindelijk toch gelukt om de encoder werkend te krijgen. Alles ging goed, maar de audio latency was nu wel verhoogd omdat de &#8216;audio callback thread&#8217; voor een korte periode geblokkeerd werd wanneer de encoder zijn werk deed. Toen we ook nog beseften dat we om metadata te updaten een nieuwe stream moesten initialiseren was het onvermijdelijk om een nieuw systeem te ontwerpen om de encoder parallel in een aparte thread te laten draaien <em>(</em><em><strong>multithreaded</strong></em><em>)</em> met een eigen buffer.</p>
<p>Albert ging hiermee aan de slag en na twee of drie dagen knoeien presenteerde hij een nieuwe &#8216;engine&#8217; <em>(de SideChain-engine)</em> aan ons die de audio buffert voor andere engines (zoals de broadcast engine) en deze engines in een aparte thread draait. <strong>Het resultaat is lage audio latency en geen enkel performanceprobleem meer.</strong> Ook werd het totale CPU-verbruik verlaagd omdat de encoder nu iets minder vaak aangeroepen wordt.</p>
<p>Om het schematisch voor te stellen:</p>
<p><strong>voor: </strong><em><strong>[</strong></em><em> afbeelding:</em><em><strong> <a href="http://wesley.vidiqatch.org/images/mixxx_broadcast_scheme.png">Oorspronkelijke Broadcast Implementatie</a> ]</strong></em><strong><br />
na: </strong><em><strong>[ </strong></em><em>afbeelding:</em><em><strong> <a href="http://wesley.vidiqatch.org/images/mixxx_broadcast_scheme_threaded.png">Threaded Broadcast Implementatie</a> ]</strong></em></p>
<p><strong>Wat moet er nog gedaan worden?</strong> De <em>SideChain-engine</em> moet nog een klein beetje aangepast worden, er moet nog een <em>MP3-encoder</em> worden geschreven, het instellingenvenster moet afgemaakt worden, en tenslotte moet de code wat opgeschoond worden, en moet alles grondig getest worden!</p>
]]></content:encoded>
			<wfw:commentRss>http://wesley.vidiqatch.org/06-01-2008/open-source-dj-mixxxing/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SMPlayer Overlay Patches</title>
		<link>http://wesley.vidiqatch.org/09-12-2007/smplayer-overlay-patches/</link>
		<comments>http://wesley.vidiqatch.org/09-12-2007/smplayer-overlay-patches/#comments</comments>
		<pubDate>Sun, 09 Dec 2007 21:04:13 +0000</pubDate>
		<dc:creator>Wesley</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://wesley.debianbox.be/2007/12/09/smplayer-overlay-patches/</guid>
		<description><![CDATA[
Ik ben bezig aan een patch voor SMPlayer voor mezelf:

ik wil de huidige tijd kunnen zien zonder full-screen te verlaten (en zonder een klok te kopen) &#8211; zoals je kan zien op de bovenstaande screenshot heb ik dat reeds voor elkaar gekregen.
ik wil de afspeeltijd van de film als een klein balkje op het scherm [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wesley.vidiqatch.org/images/smplayerTimeOverlayPatch.png"><img title="SMPlayer Time Overlay Patch" src="http://wesley.vidiqatch.org/images/smplayerTimeOverlayPatch.png" alt="SMPlayer Time Overlay Patch" /></a></p>
<p><strong>Ik ben bezig aan een patch voor SMPlayer voor mezelf:</strong></p>
<ol>
<li><strong>ik wil de huidige tijd kunnen zien zonder full-screen te verlaten</strong> (en zonder een klok te kopen) &#8211; zoals je kan zien op de bovenstaande screenshot heb ik dat reeds voor elkaar gekregen.</li>
<li><strong>ik wil de afspeeltijd van de film als een klein balkje op het scherm zien</strong>, niet via het tekstuele OSD, en ik wil eveneens de film kunnen <strong>doorspoelen</strong> door op een willekeurige plaats op mijn mooie alpha-transparante balk te klikken&#8230; want dat is veel mooier dan zo&#8217;n uitschuivend balkje dat je video naar boven duwt <img src='http://wesley.vidiqatch.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<p><strong>Technische details:</strong></p>
<ul>
<li>mplayer gepatched en gecompileerd met <em>vf_overlay</em> patch</li>
<li><em>QPainter</em> (van <em>Qt 4.3</em>) tekent de klok en tekst</li>
<li>getekende bitmap wordt vertaald naar het benodigde formaat en naar een gedeelde geheugenplek geschreven</li>
<li>mplayer (vf_overlay) leest de bitmap uit en legt hem over de video heen</li>
<li>mediaspeler waar de patch in wordt ontwikkeld is SMPlayer (mplayer frontend)</li>
</ul>
<p><em>Ik denk niet dat ik deze patch upstream zal opsturen, tenzij er veel vraag naar is. De reden daarvoor is simpelweg dat je een onofficiële mplayer patch nodig hebt (vf_overlay patch) om van deze patch gebruik te maken, en (ik maak een gok) 95% van de smplayer-gebruikers zijn dus sowieso niets met deze patch.</em></p>
<p>Ik ben wel van plan om de patch op het forum van SMPlayer te plaatsen voor degenen die het eens willen bekijken of zelf willen proberen, maar de patch is momenteel nog niet in een &#8220;releasebare&#8221; status.</p>
]]></content:encoded>
			<wfw:commentRss>http://wesley.vidiqatch.org/09-12-2007/smplayer-overlay-patches/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Slideflow: Qt4 Slideshow Application (alpha preview)</title>
		<link>http://wesley.vidiqatch.org/01-08-2007/slideflow-qt4-slideshow-application-alpha-preview/</link>
		<comments>http://wesley.vidiqatch.org/01-08-2007/slideflow-qt4-slideshow-application-alpha-preview/#comments</comments>
		<pubDate>Wed, 01 Aug 2007 17:33:55 +0000</pubDate>
		<dc:creator>Wesley</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://wesley.debianbox.be/2007/08/01/slideflow-qt4-slideshow-application-alpha-preview/</guid>
		<description><![CDATA[Slideflow wordt een nieuw open source cross-platform slideshow programma.
Ondersteunde besturingssystemen: Windows XP/Vista, Linux, Mac OS XMogelijk ondersteund, maar niet getest: andere Windows versies, alle BSD varianten, Solaris, andere X11-based systemen
update: drag and drop support toegevoegd en screenshot + screencast vernieuwd 

Klik hier voor een meer uitgebreide Slideflow demonstratie op YouTube
Ik ben bezig geweest met nieuwe [...]]]></description>
			<content:encoded><![CDATA[<p style="font-weight: bold">Slideflow wordt een nieuw open source cross-platform slideshow programma.</p>
<p><span style="font-style: italic">Ondersteunde besturingssystemen: Windows XP/Vista, Linux, Mac OS X</span><br style="font-style: italic" /><span style="font-style: italic">Mogelijk ondersteund, maar niet getest: andere Windows versies, alle BSD varianten, Solaris, andere X11-based systemen</span></p>
<p><em><strong>update: drag and drop support toegevoegd en screenshot + screencast vernieuwd </strong></em></p>
<p><img title="Slideflow" src="http://wesley.vidiqatch.org/images/slideflow_dnd.png" alt="Slideflow" width="529" height="561" /></p>
<p><a href="http://www.youtube.com/watch?v=fkfYuY_EcpE&amp;fmt=18">Klik hier voor een meer uitgebreide Slideflow demonstratie op YouTube</a></p>
<p>Ik ben bezig geweest met nieuwe mogelijkheden in Qt 4 waarmee mooie effecten te programmeren zijn zonder lowlevel kennis. Qt regelt zelf <em>XRender</em> (en indien gewenst <em>OpenGL</em>) acceleratie en met behulp van het nieuwe <strong>Animation Framework</strong> in Qt 4 is het niet moeilijk om mooie effecten te bereiken.</p>
<p>Slideflow is een (open source, cross-platform) slideshow programma dat door een winkel gebruikt zal worden om producten met uitleg op een moderne grafische manier weer te geven op een apart VGA scherm.</p>
<p>Ik ben gisteravond en deze namiddag/avond bezig geweest met de eerste stappen van het programma.</p>
]]></content:encoded>
			<wfw:commentRss>http://wesley.vidiqatch.org/01-08-2007/slideflow-qt4-slideshow-application-alpha-preview/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>GBA programming in Linux</title>
		<link>http://wesley.vidiqatch.org/12-07-2007/gba-programming-in-linux/</link>
		<comments>http://wesley.vidiqatch.org/12-07-2007/gba-programming-in-linux/#comments</comments>
		<pubDate>Thu, 12 Jul 2007 20:37:18 +0000</pubDate>
		<dc:creator>Wesley</dc:creator>
				<category><![CDATA[Assembler]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[GBA]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://wesley.debianbox.be/2007/07/12/gba-programming-in-linux/</guid>
		<description><![CDATA[
Mijn eerste GBA rom aan de linkerkant   Nouja, afgekeken van een voorbeeldbestand&#8230; 
Gisterenavond wou ik eens proberen om iets te programmeren voor mijn oude Game Boy Advance. Na wat rondgezocht te hebben bleek het niet eens zo moeilijk te zijn. Er is slechts weinig kennis nodig van ARM assembler. Programma&#8217;s kunnen gewoon in [...]]]></description>
			<content:encoded><![CDATA[<p><img title="GBA Rom" src="http://wesley.vidiqatch.org/images/gba1.png" alt="GBA Rom" align="left" /></p>
<p><strong><em>Mijn eerste GBA rom aan de linkerkant <img src='http://wesley.vidiqatch.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Nouja, afgekeken van een voorbeeldbestand&#8230; </em></strong></p>
<p>Gisterenavond wou ik eens proberen om iets te programmeren voor mijn oude <em>Game Boy Advance</em>. Na wat rondgezocht te hebben bleek het niet eens zo moeilijk te zijn. Er is slechts <em>weinig kennis nodig van ARM assembler</em>. Programma&#8217;s kunnen gewoon in <em>C/C++</em> worden geschreven en trage stukken nadien <em>eventueel geoptimaliseerd met assembler</em>.</p>
<p>Wel ga ik me moeten inwerken in het <em>registersysteem</em> van de Game Boy Advance.</p>
<p>Het was niet moeilijk om een <em>cross compiler</em> (compiler die uitvoerbare code genereert voor een ander platform dan hetgeen waarop de compiler draait) te compileren en gebruiken.</p>
<p>Mijn gecompileerd testproject werkte op emulators (zoals mednafen of visualboyadvance) maar het niet kon worden ingelezen door mijn <em>EZF Advance client</em> software! (software die ik gebruik om roms te uploaden naar een Flashkaart zodat ik de roms ook op mijn echte Game Boy Advance kan testen)<br />
<a href="http://wesley.vidiqatch.org/images/gba_rom_problem.png">Screenshot van het probleem</a></p>
<p>Vandaag ben ik dus even bezig geweest met het uitzoeken van het probleem. De <em>rom header</em> moest gefixt worden en nog allerlei zaken. Ik had een <em>perl script</em> gevonden die alles voor me zou gefixt hebben, en de headers leken daarna inderdaad in orde, maar het programma wou nog steeds niet importeren in <em>EZF Advance</em>.</p>
<p>Toen vond ik <strong>devkitPro/devkitARM</strong>. Een heel pakket met alles wat ik nodig had. Heel veel<em><strong> GBA libs, voorbeelden, een cross compiler, header-fix-tool</strong></em>, etc.! Dus dat maar eens geïnstalleerd en een nieuw project gecompileerd op basis van één van de voorbeelden. En zie daar. <strong>Het draait nu ook op mijn Game Boy Advance (hardware)!</strong> Ik zou er een foto van hebben genomen, maar ik heb geen digitale camera <img src='http://wesley.vidiqatch.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div>Handige links:<br />
<em><a href="http://www.devkitpro.org/">devkitPro/devkitARM</a> </em><em><a href="http://www.devrs.com/gba/files/gbadevfaqs.php">Handige FAQ</a> </em><em><a href="http://belogic.com/gba/">GBA sound system</a> </em><em><a href="http://www.coranac.com/tonc/text/toc.htm">Uitgebreide tutorial</a></em></div>
<p align="right">
]]></content:encoded>
			<wfw:commentRss>http://wesley.vidiqatch.org/12-07-2007/gba-programming-in-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

