<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4228817528509556574</id><updated>2012-01-03T02:19:53.409Z</updated><category term='wip'/><category term='xml'/><category term='pixel art'/><category term='tools'/><category term='Stealth-Platformer-Shooter Project'/><category term='gamedev'/><category term='Game Engine'/><category term='3d'/><category term='draw'/><category term='ActionScript'/><category term='apresentação'/><category term='BitmapData'/><category term='physics'/><category term='engine design'/><category term='flixel'/><title type='text'>PJMendes Has Fun</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-3516139635277794069</id><published>2011-11-04T22:30:00.002Z</published><updated>2011-11-04T22:37:22.333Z</updated><title type='text'>Vector Editor - Progress update</title><content type='html'>Uploaded a couple more videos:&lt;br /&gt;&lt;br /&gt;&lt;iframe width="480" height="360" src="http://www.youtube.com/embed/7oca8Ff8_Bc" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br /&gt;This one shows the grid of points created inside the shape to later do tesselation (decompose the inside of the shape into polygons), which will be shaded using vertex colors, smoothly interpolating the colors between each vertex.&lt;br /&gt;&lt;br /&gt;The shape is built using Java's GeneralPath, the control point coordinates are converted from Catmull-Rom to Bezier using a matrix.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe width="480" height="360" src="http://www.youtube.com/embed/eQvhffmqsMY" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br /&gt;This shows color interpolation for those inner points, using an algorithm that I created. Works nicely for any points in any position, even for points inside the shape (which in the literature I managed to find, presented a problem for most interpolation algorithms when dealing with polygons). I'm quite happy with the solution! :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-3516139635277794069?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/3516139635277794069/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=3516139635277794069' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/3516139635277794069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/3516139635277794069'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2011/11/vector-editor-progress-update.html' title='Vector Editor - Progress update'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/7oca8Ff8_Bc/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-4546459593412138774</id><published>2011-10-30T23:07:00.003Z</published><updated>2011-10-30T23:16:02.300Z</updated><title type='text'>Vector Editor (Video)</title><content type='html'>I've been working on a vector editor program that uses control points to define shapes and colors. Here's an initial video of it in action, in a very early state (I liked the color effects :))&lt;br /&gt;&lt;br /&gt;I'm doing the editor in Java using Netbeans as development environment, and using &lt;a href="http://www.processing.org/"&gt;Processing&lt;/a&gt; for many things (love it), and maths from all over the internet.&lt;br /&gt;&lt;br /&gt;I move, add and delete some points.&lt;br /&gt;&lt;iframe width="480" height="360" src="http://www.youtube.com/embed/_1zAsRm30q8" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Music is from "The Hybrid Front", Sega Genesis/Mega Drive game, 1994.&lt;br /&gt;Composed by Naofumi Hataya.&lt;br /&gt;&lt;br /&gt;Other than that, been working hard on some flash action games, but not quite ready to show them yet!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-4546459593412138774?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/4546459593412138774/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=4546459593412138774' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/4546459593412138774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/4546459593412138774'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2011/10/vector-editor-video.html' title='Vector Editor (Video)'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/_1zAsRm30q8/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-4545130923079653100</id><published>2011-05-24T17:11:00.011+01:00</published><updated>2011-05-24T17:59:13.756+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flixel'/><category scheme='http://www.blogger.com/atom/ns#' term='BitmapData'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='draw'/><title type='text'>An easier BitmapData.draw</title><content type='html'>After lots of struggling with ActionScript's BitmapData "draw" function, with trying to render a tileset using a zoom factor (by applying a scale, and selecting the area inside a larger tileset image to draw from), I decided to create a couple of helper functions, so that I never have to figure out again what the variables do in the "draw" call.&lt;br /&gt;&lt;br /&gt;Here, I present to you a couple of functions. The first, "DrawImageAreaScaled",  basically draws an upscaled rectangular sub-area of a picture wherever on another image (or on the screen). The second, "DrawImageScaledAndRotated", draws a rotated and scaled picture on the screen.&lt;br /&gt;Transparency is respected (if the image contains alpha information, transparent pixels are drawn correctly).&lt;br /&gt;&lt;br /&gt;This can easily be applied to, say, Flixel, by passing as the first parameter "FlxG.buffer" as the destination image, and "your_FlxSprite.pixels" as source (see example below).&lt;br /&gt;&lt;br /&gt;Below is the class, and under it, an example on how to use it using Flixel.&lt;br /&gt;&lt;br /&gt;P.S.: don't expect too great a performance, since BitmapData.draw is a somewhat slow function, specially when called several times a second to display, say, a tileset.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Class "Render.as" in folder "Utils":&lt;/span&gt;&lt;br /&gt;&lt;pre class="prettyprint lang-cpp"&gt;&lt;br /&gt;package Utils&lt;br /&gt;{&lt;br /&gt;    import flash.display.BitmapData;&lt;br /&gt;    import flash.geom.Matrix;&lt;br /&gt;    import flash.geom.Point;&lt;br /&gt;    import flash.geom.Rectangle;&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Contains helper Renderer functions.&lt;br /&gt;     * @author PJMendes aka TurboLento&lt;br /&gt;     */&lt;br /&gt;    public class Render&lt;br /&gt;    {&lt;br /&gt;        // helper variables - initialized once, reused at every function called&lt;br /&gt;        private static var DrawClipRect:Rectangle = new Rectangle(0, 0, 0, 0); // area on screen to draw (sort of a mask)&lt;br /&gt;        private static var DrawMatrix:Matrix = new Matrix();&lt;br /&gt;  &lt;br /&gt;        /**&lt;br /&gt;         * Helper for a simpler BitmapData.draw. Draws a rectangular area of an image on the screen, using syntax similar to copyPixels.&lt;br /&gt;         * Useful for drawing scaled tiles (performance isn't great though, due to "draw" being slow).&lt;br /&gt;         * @param imgSource The image to draw from.&lt;br /&gt;         * @param imgDestination The image to draw to&lt;br /&gt;         * @param areaSource The area in the source image to draw from.&lt;br /&gt;         * @param positionDestination The x,y position on the destination to draw to.&lt;br /&gt;         * @param scale The scaling to apply to the drawn image (areaSource will be multiplied by this dimension in the final drawing).&lt;br /&gt;        */&lt;br /&gt;        public static function DrawImageAreaScaled(imgSource:BitmapData, imgDestination:BitmapData, areaSource:Rectangle, positionDestination:Point, scale:Point = null, rotationRadians:Number = 0): void&lt;br /&gt;        {&lt;br /&gt;            DrawMatrix.identity();&lt;br /&gt;            DrawMatrix.rotate(rotationRadians);&lt;br /&gt;&lt;br /&gt;            if (scale != null)&lt;br /&gt;            {&lt;br /&gt;                DrawMatrix.scale(scale.x, scale.y);&lt;br /&gt;    &lt;br /&gt;                DrawClipRect.width = areaSource.width * scale.x; // i think this is it&lt;br /&gt;                DrawClipRect.height = areaSource.height * scale.y;&lt;br /&gt;    &lt;br /&gt;                DrawClipRect.x = positionDestination.x; // i think this is it - making clipRect sort of a "window" on the destination where source will appear&lt;br /&gt;                DrawClipRect.y = positionDestination.y;&lt;br /&gt;    &lt;br /&gt;                DrawMatrix.translate(positionDestination.x - areaSource.x * scale.x, positionDestination.y - areaSource.y * scale.y);&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                DrawClipRect.width = areaSource.width; // i think this is it&lt;br /&gt;                DrawClipRect.height = areaSource.height;&lt;br /&gt;    &lt;br /&gt;                DrawClipRect.x = positionDestination.x; // i think this is it - making clipRect sort of a "window" on the destination where source will appear&lt;br /&gt;                DrawClipRect.y = positionDestination.y;&lt;br /&gt;    &lt;br /&gt;                DrawMatrix.translate(positionDestination.x - areaSource.x, positionDestination.y - areaSource.y);&lt;br /&gt;            }&lt;br /&gt;   &lt;br /&gt;            imgDestination.draw(imgSource, DrawMatrix, null, null, DrawClipRect);&lt;br /&gt;        }&lt;br /&gt;  &lt;br /&gt;        /**&lt;br /&gt;          * Helper for a simpler BitmapData.draw. Draws an image on the screen, scaled and rotated, using syntax similar to copyPixels.&lt;br /&gt;          * Useful for drawing scaled tiles (performance isn't great though, due to "draw" being slow).&lt;br /&gt;          * @param imgSource The image to draw from.&lt;br /&gt;          * @param imgDestination The image to draw to&lt;br /&gt;          * @param positionDestination The x,y position on the destination to draw to.&lt;br /&gt;          * @param scale The scaling to apply to the drawn image (areaSource will be multiplied by this dimension in the final drawing).&lt;br /&gt;          * @param rotationRadians The rotation in radians to apply to the drawn image. Axis for rotation is the top left of the source image.&lt;br /&gt;         */&lt;br /&gt;        public static function DrawImageScaledAndRotated(imgSource:BitmapData, imgDestination:BitmapData, positionDestination:Point, scale:Point = null, rotationRadians:Number = 0): void&lt;br /&gt;        {&lt;br /&gt;            DrawMatrix.identity();&lt;br /&gt;   &lt;br /&gt;            DrawMatrix.rotate(rotationRadians);&lt;br /&gt;   &lt;br /&gt;            if (scale != null)&lt;br /&gt;            {&lt;br /&gt;                DrawMatrix.scale(scale.x, scale.y);&lt;br /&gt;    &lt;br /&gt;                DrawMatrix.translate(positionDestination.x, positionDestination.y);&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                DrawMatrix.translate(positionDestination.x, positionDestination.y);&lt;br /&gt;            }&lt;br /&gt;   &lt;br /&gt;            imgDestination.draw(imgSource, DrawMatrix, null, null, null);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example class:&lt;/span&gt;&lt;br /&gt;&lt;pre class="prettyprint lang-cpp"&gt;&lt;br /&gt;package  &lt;br /&gt;{&lt;br /&gt;    import flash.display.BitmapData;&lt;br /&gt;    import flash.geom.Matrix;&lt;br /&gt;    import flash.geom.Point;&lt;br /&gt;    import flash.geom.Rectangle;&lt;br /&gt;    import org.flixel.FlxSprite;&lt;br /&gt;    import org.flixel.FlxState;&lt;br /&gt;    import org.flixel.FlxG;&lt;br /&gt;    import Utils.Render;&lt;br /&gt; &lt;br /&gt;    /**&lt;br /&gt;     * ...&lt;br /&gt;     * @author &lt;br /&gt;     */&lt;br /&gt;    public class TestState extends FlxState&lt;br /&gt;    {&lt;br /&gt;        [Embed(source = "/../data/test.png")] protected var ImgTileset:Class;&lt;br /&gt;        [Embed(source = "/../data/player_sprite.png")] protected var ImgPlayer:Class;&lt;br /&gt;  &lt;br /&gt;        private var img:FlxSprite;&lt;br /&gt;        private var img2:FlxSprite;&lt;br /&gt;  &lt;br /&gt;        override public function create():void&lt;br /&gt;        {&lt;br /&gt;            super.create();&lt;br /&gt;            img = new FlxSprite(0, 0, ImgTileset);&lt;br /&gt;            img2 = new FlxSprite(0, 0, ImgPlayer);&lt;br /&gt;        }&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;        override public function update():void&lt;br /&gt;        {&lt;br /&gt;            //trace("update");&lt;br /&gt;            super.update();&lt;br /&gt;        }&lt;br /&gt;  &lt;br /&gt;        override public function render():void&lt;br /&gt;        {&lt;br /&gt;            //trace("render; DataManagerHasLoaded "+ DataManagerHasLoaded +" TilemapHasLoaded "+ TilemapHasLoaded);&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;            // render method 1&lt;br /&gt;            var srcRect:Rectangle = new Rectangle(0, 0, img.width, img.height);&lt;br /&gt;            var destPoint:Point = new Point(320, 0);&lt;br /&gt;            FlxG.buffer.copyPixels(img.pixels, srcRect, destPoint);&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;            // render method 2&lt;br /&gt;            var scale:Point = null;&lt;br /&gt;            var destPoint:Point = null;&lt;br /&gt;            var rectSource:Rectangle = null;&lt;br /&gt;   &lt;br /&gt;            //rectSource = new Rectangle(0, 0, img.width, img.height);&lt;br /&gt;            //rectSource = new Rectangle(0, 0, 32, 32);&lt;br /&gt;   &lt;br /&gt;           rectSource = new Rectangle(64, 32, 32, 32);&lt;br /&gt;           destPoint = new Point(FlxG.mouse.x, FlxG.mouse.y);&lt;br /&gt;   &lt;br /&gt;           scale = new Point(2, 2);&lt;br /&gt;   &lt;br /&gt;           Render.DrawImageAreaScaled(img.pixels, FlxG.buffer, rectSource, destPoint, scale);&lt;br /&gt;           //Render.DrawImageScaledAndRotated(img.pixels, FlxG.buffer, destPoint, scale, 0.2);&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;           // test with img with transparency&lt;br /&gt;           rectSource = new Rectangle(0, 0, img2.width, img2.height);&lt;br /&gt;           //Render.DrawImageAreaScaled(img2.pixels, FlxG.buffer, rectSource, destPoint, scale);&lt;br /&gt;           Render.DrawImageScaledAndRotated(img2.pixels, FlxG.buffer, destPoint, scale, 0.2);&lt;br /&gt;   &lt;br /&gt;           super.render();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Hope this is helpful!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-4545130923079653100?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/4545130923079653100/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=4545130923079653100' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/4545130923079653100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/4545130923079653100'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2011/05/easier-bitmapdatadraw.html' title='An easier BitmapData.draw'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-813830082682571775</id><published>2011-02-23T23:02:00.005Z</published><updated>2011-02-24T04:11:53.392Z</updated><title type='text'>Trying to Keep it Simpler, doing more with less (effort)</title><content type='html'>- Going through the continuous process of learning, doing, and learning from doing.&lt;br /&gt;- Reducing the scope for what I want to do, and go through the process of starting, developing and finishing my projects.&lt;br /&gt;- Dealing with demotivation and boredom, by cycling projects - start project A, reach a point where I'm bored/tired/demotivated, get interested in project B, reach that same point, and go back to project A, now with a fresh outlook on it, and breaking through the point where I got stuck previously.&lt;br /&gt;&lt;br /&gt;- having lots of fun with ActionScript, can't recommend it enough for simpler games (unfortunately current Flash performance is weak, allows the creation of games similar to the Super Nintendo, on a technology/performance level)&lt;br /&gt;&lt;br /&gt;- creating a few games for Flash, using ActionScript, Flixel and FlashDevelop as the Integrated Development Environment. Reading stuff about business, game business and flash game business, how to monetize the games I'm making.&lt;br /&gt;&lt;br /&gt;- swore off C/C++, due to annoyingly complicated and unnecessary stuff like includes, defining/using static classes (as enums), errors due to having to manually manage memory, compilation, using other libraries, and language complexity in general. I want to develop fun games, not become a C++ pro, and I feel I waste lots of time dealing with the "low level" part of the language.&lt;br /&gt;&lt;br /&gt;Trying out doing stuff in Java using the "Slick" library, for projects more advanced than Flash allows (hardware accelerated drawing, heavy processing, etc). Java pretty much skips/solves all of these problems, and if I need performance, I can always learn how to invoke dlls from Java and code heavier functions in C (although Java's bad reputation on performance is something that isn't always true, if some care is taken when coding).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-813830082682571775?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/813830082682571775/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=813830082682571775' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/813830082682571775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/813830082682571775'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2011/02/trying-to-keep-it-simpler-doing-more.html' title='Trying to Keep it Simpler, doing more with less (effort)'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-3288512723948236127</id><published>2010-09-30T03:45:00.004+01:00</published><updated>2010-09-30T04:12:57.112+01:00</updated><title type='text'>CSG operations in 2D</title><content type='html'>...or "Integrating a Polygon Boolean Operations Library"&lt;br /&gt;&lt;br /&gt;I've been developing a prototype for a platform game, using the Chipmunk Physics library to handle the physics. The control mechanics are to be very simple, similar to Super Mario (with almost no inertia, no floor sliding), aiming to allow for precise and responsive control.&lt;br /&gt;&lt;br /&gt;After designing the initial prototype, I started creating levels, using square blocks placed next to each other. This resulted in a (that I found later) known problem, where the object for the player will "bump" into the lines where the blocks meet and slow down or jump on them. Ok, so I'll just use continuous collision lines on top of a group of blocks instead of individual collision squares next to each other, so this doesn't happen.&lt;br /&gt;&lt;br /&gt;From here, I needed a solution to ease the level creation process. The options were:&lt;br /&gt;&lt;br /&gt;- place the blocks images by hand, and then create the collision lines also by hand (easiest to code, but would lead to boring level editing)&lt;br /&gt;&lt;br /&gt;- place the blocks, and code an algorithm to find where the blocks were, outlining it with collision lines (would take some thinking, and would basically be a &lt;a href="http://en.wikipedia.org/wiki/Constructive_solid_geometry"&gt;Constructive Solid Geometry&lt;/a&gt; problem)&lt;br /&gt;&lt;br /&gt;- place the blocks, integrate an existing CSG solution, and join the individual blocks into a single object (most flexible solution, and I was interested in the potential of integrating CSG functionalities into my engine)&lt;br /&gt;&lt;br /&gt;So I went to look for CSG algorithms, libraries, etc, and from what I gathered it's a pretty deep field, with several working solutions but with somewhat complicated implementations.&lt;br /&gt;I looked around for CSG specifically for 2D, and found 3 libraries. From those, &lt;a href="http://www.angusj.com/delphi/clipper.php"&gt;Clipper&lt;/a&gt; by Angus Johnson presented the best feature list and had a free license, so I looked at it.&lt;br /&gt;&lt;br /&gt;It's pretty straightforward and I had a test working in a short time, which was great! This allowed me to integrate it easily into my level editor, and the outcome was great. Editing levels is now a lot of fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-3288512723948236127?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/3288512723948236127/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=3288512723948236127' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/3288512723948236127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/3288512723948236127'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2010/09/csg-operations-in-2d.html' title='CSG operations in 2D'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-5841603157358512252</id><published>2010-09-29T16:15:00.002+01:00</published><updated>2010-09-29T20:14:57.918+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='gamedev'/><title type='text'>IDE Switch: From CodeBlocks to CodeLite</title><content type='html'>Recently, I've been wanting something out of my IDE that CodeBlocks doesn't have: refactoring.&lt;br /&gt;&lt;br /&gt;I've been following recent advice I got (from GoogleTalks, I believe) on code readability, on which the focus is on having short functions (short as in the total number of lines per function being small), which allows the coder to clearly and quickly understand what that function does just by glancing at it, without scrolling involved (I couple this with long function and variable names, which basically self-document my code).&lt;br /&gt;&lt;br /&gt;Refactoring tools help this process. &lt;br /&gt;&lt;br /&gt;In my opinion, coding is currently still much in it's infancy, it should be much clearer and easier to do, allowing any user to manipulate code in a "Lego" like fashion, assembling and moving blocks around with ease. &lt;br /&gt;&lt;br /&gt;Refactoring is a beginning for this. Just create a new part of the code, which amounts to a few lines, select these lines and refactor them into a new function, and that code becomes a simple function invocation (with a nice long name like "GetPhysicsCollisionSegmentsAndInitializeSegmentList").&lt;br /&gt;&lt;br /&gt;So, after looking into a few possibilities (including parsing my own code and creating a plugin for CodeBlocks, or switching to Netbeans/Eclipse), I went on a tip I saw on "Stack Overflow" that CodeLite had great refactoring tools. CodeLite, while being a relatively young one-man project, is looking great and is actually more advanced than other (by example). Also, something that always irked me a bit is a slightly negative tone on the CodeBlocks forums, treating newbies harshly and demeaning them with the "that doesn't belong here" and locking the threads (on questions that are actually related, at least partially, with CodeBlocks, which contributes to just demotivating them from further learning C++ or using CodeBlocks), while the guy at the CodeLite (also the creator and main programmer for the tool) is patient and helpful for new guys asking stuff at the forum (which I've been one of :))&lt;br /&gt;&lt;br /&gt;I've been migrating my game engine to CodeLite, migrating the libraries, etc. One thing that is missing is importing projects from CodeBlocks, which should be relatively easy to do, and is what is taking me more time. Also, the Shared / Dynamic Library compilation system doesn't create .def and lib*.a files, that I was used to using in CodeBlocks (but apparently they aren't mandatory for dynamic linking).&lt;br /&gt;&lt;br /&gt;I've also been working on different projects at the same time, working a bit on each for a while and jumping to other when I complete a sub-goal. Keeps it interesting. &lt;br /&gt;&lt;br /&gt;Also, focusing more on prototyping a game (the "puzzle platformer"): have a single room with the most amount of gameplay features, to play around with and tune the gameplay), which allows me to increasingly improve my engine by game requirements, instead of risking over-designing it by adding unnecessary or impractical stuff.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-5841603157358512252?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/5841603157358512252/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=5841603157358512252' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/5841603157358512252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/5841603157358512252'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2010/09/ide-switch-from-codeblocks-to-codelite.html' title='IDE Switch: From CodeBlocks to CodeLite'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-7430248722564726542</id><published>2010-09-12T21:37:00.010+01:00</published><updated>2010-09-14T02:32:55.637+01:00</updated><title type='text'>How to do masking in SFML (with OpenGL)</title><content type='html'>(if there's some problem with the code, you can find my original forum post &lt;a href="http://www.sfml-dev.org/forum/viewtopic.php?p=20729#20729"&gt;here&lt;/a&gt; or &lt;a href="http://www.sfml-dev.org/wiki/en/sources/masking_using_alpha_and_blending"&gt;my Wiki entry for masking in SFML&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;Something that I think is very helpful in games is the ability to do masking: define a region, based on an image, a polygon, or some text, and "cut" an image based on that.&lt;br /&gt;&lt;br /&gt;Also, I wanted to have non-rectangular masks, and allow masks to have variable alpha (transparency) information.&lt;br /&gt;&lt;br /&gt;Currently, the SFML library (at the time, I'm using 1.6) had no support for that, and it's something that I wanted in the long run, so I went in to try to find out how to do it and add it (in OpenGL, which SFML is based on).&lt;br /&gt;&lt;br /&gt;After doing some research, a few options surfaced on how to do masking in OpenGL:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Using multi-texturing&lt;/span&gt;: mapping several textures to a single polygon, blending them using distinct modes and then draw the polygon. Pros: supported by old hardware. Cons: complicated code :) (having to play around with texture coordinates to correctly translate/rotate/scale the images to overlap)&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Using the stencil-buffer&lt;/i&gt;: the stencil buffer works like a stencil: you cut a shape and then when you draw to it, only the cut area is shown, the other hidden. OpenGL has an extension which allows you to write pixels to a buffer, and then only draw where that buffer has valid pixels. Pros: close to what I wanted, allowing masks based on pixel information, polygons or text. Cons: required graphic card extensions, which may limit the usage in older hardware or portable devices (if I ever decide to port my games to them), and it didn't allow to write alpha information to the buffer (it either takes full opaque or full transparent, not translucent pixels - at least to the extent of my research and tests).&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Writing to the color buffer's alpha channel and then using blending&lt;/i&gt;: the image which OpenGL shows on the screen is composed of 4 channels: Red+Green+Blue+Alpha. By writing directly to the alpha channel (and not to the RGB channels), setting correct blending modes, and then drawing overlapping images on the masked area, images will blend with the alpha channel, using that channel's transparency information.&lt;br /&gt;&lt;br /&gt;Having these options, I chose to implement the last one into SFML. I contacted the library's creator to request a change in the original source code, that would easily allow the integration of my code into SFML, but he did not agree to that change. Here I reveal the steps to adding this feature, but it involves altering one (1) word in SFML's original source code and recompiling it. Also, it will probably not be supported for SFML 2.0, which will change some inner workings. But for the near future, all good.&lt;br /&gt;&lt;br /&gt;This change allows the use of Sprites, Shapes and Strings as/with masks.&lt;br /&gt;NOTE: it hasn't been extensively tested so there may be the occasional bug.&lt;br /&gt;&lt;br /&gt;Below i'll post the code for several new classes i've added, and then a few example programs on how to use each class.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ok, to start, you'll have to change a line in the original SFML 1.6 code, and recompile sfml or the "sfml-graphics" lib.&lt;br /&gt;&lt;br /&gt;Go to the SFML source root folder, and open "include/SFML/Graphics/Drawable.hpp".&lt;br /&gt;Then find the function definition&lt;br /&gt;&lt;pre class="prettyprint lang-cpp"&gt;void Draw(RenderTarget&amp;amp; Target) const;&lt;/pre&gt;(around line 335)&lt;br /&gt;and replace it with&lt;br /&gt;&lt;pre class="prettyprint lang-cpp"&gt;virtual void Draw(RenderTarget&amp;amp; Target) const;&lt;/pre&gt; (add "virtual" at the start).&lt;br /&gt;And recompile sfml-graphics.&lt;br /&gt;&lt;br /&gt;New files:&lt;br /&gt;&lt;b&gt;MaskTypes.h&lt;/b&gt; - has the several masking types that you can use. Define a MaskType by using "MaskTypes::Type" and set them using "MaskTypes::BlendWithPreviousMask". The mask types are the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;MaskType::None &lt;/i&gt;- use the normal sf::BlendMode.&lt;/li&gt;&lt;li&gt;&lt;i&gt;MaskType::Mask&lt;/i&gt; - use this Drawable's Alpha mask as a Mask (only drawing the Drawable's Alpha info, not any color). Will blend the mask with previous existing masks.&lt;/li&gt;&lt;li&gt;&lt;i&gt;MaskType::MaskOverWritePreviousMask&lt;/i&gt; - similar to the previous, but will overwrite the previous mask instead of blending into it (allows to "cut" into an existing mask, and is used by example with "StringMask" - check the example)&lt;/li&gt;&lt;li&gt;&lt;i&gt;MaskType::BlendWithPreviousMask&lt;/i&gt; - set this mask to have a Drawable blend with the mask previously drawn on its area (only draw where alpha &gt; 0)&lt;/li&gt;&lt;li&gt;&lt;i&gt;MaskType::BlendWithPreviousMaskReversed&lt;/i&gt; - set this mask to have a Drawable blend with the NEGATIVE of the mask previously drawn on its area (transparent areas become opaque and vice-versa).&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;MaskUtils.h&lt;/i&gt;&lt;/b&gt; - Internal class, no need to call this from your code.&lt;br /&gt;Basically where all the magic happens, OpenGL calls are made, states are saved and restored, etc. Some code that was in "sf::Drawable" related to blend modes was pasted here.&lt;br /&gt;&lt;b&gt;RenderWindowMask.h&lt;/b&gt; - must be used instead of a regular sf::RenderWindow, inherits from it. Adds the "ClearMask()" function, which clears just the color buffer's alpha channel.&lt;br /&gt;&lt;b&gt;SpriteMasked.h&lt;/b&gt; - use this to draw a Sprite using masking, or to use a Sprite AS a mask. Inherits from sf::Sprite. Adds the "maskSetType/maskGetType" functions necessary to define the masking type.&lt;br /&gt;&lt;b&gt;ShapeMasked.h&lt;/b&gt; - use this to use a Shape as a mask or to mask a Shape. Inherits from sf::Shape. Adds the "maskSetType/maskGetType" functions necessary to define the masking type.&lt;br /&gt;&lt;b&gt;StringMasked.h&lt;/b&gt; - use this to use a String as a mask or to mask a String. Inherits from sf::String. Adds the "maskSetType/maskGetType" functions necessary to define the masking type.&lt;br /&gt;&lt;br /&gt;P.S. no need to preserve states (use "App.PreserveOpenGLStates(true)"), it's all done internally.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;MaskTypes.h&lt;/b&gt;&lt;br /&gt;&lt;pre class="prettyprint lang-cpp"&gt;&lt;br /&gt;#ifndef MASKTYPES_H_INCLUDED&lt;br /&gt;#define MASKTYPES_H_INCLUDED&lt;br /&gt;&lt;br /&gt;class MaskTypes&lt;br /&gt;{&lt;br /&gt;   public:&lt;br /&gt;   enum Type&lt;br /&gt;   {&lt;br /&gt;       None = 0,&lt;br /&gt;       Mask,&lt;br /&gt;       MaskOverWritePreviousMask,&lt;br /&gt;       BlendWithPreviousMask,&lt;br /&gt;       BlendWithPreviousMaskReversed&lt;br /&gt;   };&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;MaskUtils.h&lt;/b&gt;&lt;br /&gt;&lt;pre class="prettyprint lang-cpp"&gt;&lt;br /&gt;#ifndef MASKUTILS_H_INCLUDED&lt;br /&gt;#define MASKUTILS_H_INCLUDED&lt;br /&gt;&lt;br /&gt;#include &amp;lt;sfml/graphics/drawable.hpp&gt;&lt;br /&gt;&lt;br /&gt;using namespace sf;&lt;br /&gt;&lt;br /&gt;class MaskUtils&lt;br /&gt;{&lt;br /&gt;   public:&lt;br /&gt;       MaskUtils()&lt;br /&gt;       {&lt;br /&gt;           reset();&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       void reset()&lt;br /&gt;       {&lt;br /&gt;           restoreColorBuffer = false;&lt;br /&gt;           restoreBlendMode = false;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       void setBlendModesBasedOnMaskType(MaskTypes::Type maskType, Blend::Mode blendMode)&lt;br /&gt;       {&lt;br /&gt;           switch(maskType)&lt;br /&gt;           {&lt;br /&gt;               case MaskTypes::None:&lt;br /&gt;               {&lt;br /&gt;                   restoreBlendMode = true;&lt;br /&gt;                   blendModePreviouslyEnabled = glIsEnabled(GL_BLEND);&lt;br /&gt;&lt;br /&gt;                   // Setup alpha-blending&lt;br /&gt;                   Blend::Mode myBlendMode = blendMode;&lt;br /&gt;                   if (myBlendMode == Blend::None)&lt;br /&gt;                   {&lt;br /&gt;                       glDisable(GL_BLEND);&lt;br /&gt;                   }&lt;br /&gt;                   else&lt;br /&gt;                   {&lt;br /&gt;                       glEnable(GL_BLEND);&lt;br /&gt;&lt;br /&gt;                       switch (myBlendMode)&lt;br /&gt;                       {&lt;br /&gt;                           case Blend::Alpha :&lt;br /&gt;                               glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);&lt;br /&gt;                           break;&lt;br /&gt;                           case Blend::Add :&lt;br /&gt;                               glBlendFunc(GL_SRC_ALPHA, GL_ONE);              &lt;br /&gt;                           break;&lt;br /&gt;                           case Blend::Multiply :&lt;br /&gt;                               glBlendFunc(GL_DST_COLOR, GL_ZERO);               &lt;br /&gt;                           break;&lt;br /&gt;                           default :                                                                        &lt;br /&gt;                           break;&lt;br /&gt;                       }&lt;br /&gt;                   }&lt;br /&gt;               }&lt;br /&gt;               break;&lt;br /&gt;&lt;br /&gt;               case MaskTypes::Mask:&lt;br /&gt;               {&lt;br /&gt;                   blendModePreviouslyEnabled = glIsEnabled(GL_BLEND);&lt;br /&gt;                   glEnable(GL_BLEND);&lt;br /&gt;                   glColorMask(false, false, false, true);// we can just write the alpha info&lt;br /&gt;                   glBlendFunc(GL_DST_ALPHA, GL_SRC_ALPHA); // include the source (picture we are drawing) alpha, ignore the destination (info already in color buffer) alpha&lt;br /&gt;                   restoreColorBuffer = true;&lt;br /&gt;                   restoreBlendMode = true;&lt;br /&gt;               }&lt;br /&gt;               break;&lt;br /&gt;               case MaskTypes::MaskOverWritePreviousMask:&lt;br /&gt;               {&lt;br /&gt;                   blendModePreviouslyEnabled = glIsEnabled(GL_BLEND);&lt;br /&gt;                   glEnable(GL_BLEND);&lt;br /&gt;                   glColorMask(false, false, false, true);// we can just write the alpha info&lt;br /&gt;                   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // include the source (picture we are drawing) alpha, ignore the destination (info already in color buffer) alpha&lt;br /&gt;                   restoreColorBuffer = true;&lt;br /&gt;                   restoreBlendMode = true;&lt;br /&gt;               }&lt;br /&gt;               break;&lt;br /&gt;               case MaskTypes::BlendWithPreviousMask:&lt;br /&gt;               {&lt;br /&gt;                   blendModePreviouslyEnabled = glIsEnabled(GL_BLEND);&lt;br /&gt;&lt;br /&gt;                   // draw stuff inside window&lt;br /&gt;                   glEnable(GL_BLEND);&lt;br /&gt;                   glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_DST_ALPHA); // blend with alpha info in color buffer, which was written by previous image&lt;br /&gt;                   restoreBlendMode = true;&lt;br /&gt;               }&lt;br /&gt;               break;&lt;br /&gt;               case MaskTypes::BlendWithPreviousMaskReversed:&lt;br /&gt;               {&lt;br /&gt;                   blendModePreviouslyEnabled = glIsEnabled(GL_BLEND);&lt;br /&gt;&lt;br /&gt;                   // draw stuff inside window&lt;br /&gt;                   glEnable(GL_BLEND);&lt;br /&gt;                   glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA); // blend with alpha info in color buffer, which was written by previous image&lt;br /&gt;                   restoreBlendMode = true;&lt;br /&gt;               }&lt;br /&gt;               break;&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       void restoreStates()&lt;br /&gt;       {&lt;br /&gt;           if(restoreColorBuffer)&lt;br /&gt;               glColorMask(true, true, true, true);  // make sure that for further images that we are writing all colors&lt;br /&gt;&lt;br /&gt;           if(restoreBlendMode)&lt;br /&gt;           {&lt;br /&gt;               if(blendModePreviouslyEnabled)&lt;br /&gt;                   glEnable(GL_BLEND);&lt;br /&gt;               else&lt;br /&gt;                   glDisable(GL_BLEND);&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;   private:&lt;br /&gt;       bool restoreColorBuffer;&lt;br /&gt;       bool restoreBlendMode;&lt;br /&gt;       bool blendModePreviouslyEnabled;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;#endif // MASKUTILS_H_INCLUDED&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;RenderWindowMask.h&lt;/b&gt;&lt;pre class="prettyprint lang-cpp"&gt;&lt;br /&gt;#ifndef RENDERWINDOWMASK_H_INCLUDED&lt;br /&gt;#define RENDERWINDOWMASK_H_INCLUDED&lt;br /&gt;&lt;br /&gt;#include &amp;lt;SFML/Graphics.hpp&gt;&lt;br /&gt;#include "MaskTypes.h"&lt;br /&gt;&lt;br /&gt;using namespace sf;&lt;br /&gt;&lt;br /&gt;class RenderWindowMask : public RenderWindow&lt;br /&gt;{&lt;br /&gt;    public:&lt;br /&gt;        RenderWindowMask(&lt;br /&gt;                            VideoMode Mode,&lt;br /&gt;                            const std::string&amp; Title,&lt;br /&gt;                            unsigned long WindowStyle = Style::Resize | Style::Close,&lt;br /&gt;                            const WindowSettings&amp; Params = WindowSettings())&lt;br /&gt;        {&lt;br /&gt;            Create(Mode, Title, WindowStyle, Params);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        RenderWindowMask(   WindowHandle Handle,&lt;br /&gt;                            const WindowSettings&amp; Params = WindowSettings())&lt;br /&gt;        {&lt;br /&gt;            Create(Handle, Params);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        // clears the alpha channel&lt;br /&gt;        void ClearMask()&lt;br /&gt;        {&lt;br /&gt;            glColorMask(false, false, false, true); // disable messing with the rgb channels, just change the alpha&lt;br /&gt;            glClear(GL_COLOR_BUFFER_BIT);    // clear the color buffer (just the alpha channel)&lt;br /&gt;            //glClearColor(FillColor.r / 255.f, FillColor.g / 255.f, FillColor.b / 255.f, FillColor.a / 255.f));&lt;br /&gt;            glColorMask(true, true, true, true); // enable messing with the rgb channels, just change the alpha&lt;br /&gt;        }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;#endif // RENDERWINDOWMASK_H_INCLUDED&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SpriteMasked.h&lt;/b&gt;&lt;br /&gt;&lt;pre class="prettyprint lang-cpp"&gt;&lt;br /&gt;#ifndef SPRITEMASKED_H_INCLUDED&lt;br /&gt;#define SPRITEMASKED_H_INCLUDED&lt;br /&gt;&lt;br /&gt;#include &amp;lt;SFML/Graphics/Sprite.hpp&gt;&lt;br /&gt;#include "MaskTypes.h"&lt;br /&gt;#include "MaskUtils.h"&lt;br /&gt;&lt;br /&gt;using namespace sf;&lt;br /&gt;&lt;br /&gt;class SpriteMasked : public Sprite&lt;br /&gt;{&lt;br /&gt;    public:&lt;br /&gt;        SpriteMasked() :&lt;br /&gt;        Sprite(),&lt;br /&gt;        maskType(MaskTypes::None)&lt;br /&gt;        {&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        void Draw(RenderTarget&amp; Target) const&lt;br /&gt;        {&lt;br /&gt;            // Save the current modelview matrix and set the new one&lt;br /&gt;            glMatrixMode(GL_MODELVIEW);&lt;br /&gt;            glPushMatrix();&lt;br /&gt;            glMultMatrixf(GetMatrix().Get4x4Elements());&lt;br /&gt;&lt;br /&gt;            MaskUtils maskUtils;&lt;br /&gt;            maskUtils.setBlendModesBasedOnMaskType(this-&gt;maskType, GetBlendMode());&lt;br /&gt;&lt;br /&gt;            // Set color&lt;br /&gt;            Color myColor = GetColor();&lt;br /&gt;            glColor4f(myColor.r / 255.f, myColor.g / 255.f, myColor.b / 255.f, myColor.a / 255.f);&lt;br /&gt;&lt;br /&gt;            // Let the derived class render the object geometry&lt;br /&gt;            Render(Target);&lt;br /&gt;&lt;br /&gt;            maskUtils.restoreStates();&lt;br /&gt;&lt;br /&gt;            // Restore the previous modelview matrix&lt;br /&gt;            glMatrixMode(GL_MODELVIEW);&lt;br /&gt;            glPopMatrix();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        void maskSetType(MaskTypes::Type maskType)&lt;br /&gt;        {&lt;br /&gt;            this-&gt;maskType = maskType;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        MaskTypes::Type maskGetType()&lt;br /&gt;        {&lt;br /&gt;            return this-&gt;maskType;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    private:&lt;br /&gt;        MaskTypes::Type maskType;&lt;br /&gt;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;#endif // SPRITEMASKED_H_INCLUDED&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;ShapeMasked.h&lt;/b&gt;&lt;br /&gt;&lt;pre class="prettyprint lang-cpp"&gt;&lt;br /&gt;#ifndef SHAPEMASKED_H_INCLUDED&lt;br /&gt;#define SHAPEMASKED_H_INCLUDED&lt;br /&gt;&lt;br /&gt;#include &amp;lt;SFML/Graphics/Shape.hpp&gt;&lt;br /&gt;#include "MaskTypes.h"&lt;br /&gt;#include "MaskUtils.h"&lt;br /&gt;&lt;br /&gt;using namespace sf;&lt;br /&gt;&lt;br /&gt;class ShapeMasked : public Shape&lt;br /&gt;{&lt;br /&gt;    public:&lt;br /&gt;        ShapeMasked() :&lt;br /&gt;        Shape(),&lt;br /&gt;        maskType(MaskTypes::None)&lt;br /&gt;        {}&lt;br /&gt;&lt;br /&gt;        ShapeMasked(sf::Shape&amp; shape) :&lt;br /&gt;        Shape(),&lt;br /&gt;        maskType(MaskTypes::None)&lt;br /&gt;        {&lt;br /&gt;            // copy points&lt;br /&gt;            for(unsigned int idxPoint = 0; idxPoint &amp;lt; shape.GetNbPoints(); ++idxPoint)&lt;br /&gt;            {&lt;br /&gt;                this-&gt;AddPoint(shape.GetPointPosition(idxPoint), shape.GetPointColor(idxPoint), shape.GetPointOutlineColor(idxPoint));&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            this-&gt;SetOutlineWidth(shape.GetOutlineWidth());&lt;br /&gt;            this-&gt;SetColor(shape.GetColor());&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        void Draw(RenderTarget&amp; Target) const&lt;br /&gt;        {&lt;br /&gt;            // Save the current modelview matrix and set the new one&lt;br /&gt;            glMatrixMode(GL_MODELVIEW);&lt;br /&gt;            glPushMatrix();&lt;br /&gt;            glMultMatrixf(GetMatrix().Get4x4Elements());&lt;br /&gt;&lt;br /&gt;            MaskUtils maskUtils;&lt;br /&gt;            maskUtils.setBlendModesBasedOnMaskType(this-&gt;maskType, GetBlendMode());&lt;br /&gt;&lt;br /&gt;            // Set color&lt;br /&gt;            Color myColor = GetColor();&lt;br /&gt;            glColor4f(myColor.r / 255.f, myColor.g / 255.f, myColor.b / 255.f, myColor.a / 255.f);&lt;br /&gt;&lt;br /&gt;            // Let the derived class render the object geometry&lt;br /&gt;            Render(Target);&lt;br /&gt;&lt;br /&gt;            maskUtils.restoreStates();&lt;br /&gt;&lt;br /&gt;            // Restore the previous modelview matrix&lt;br /&gt;            glMatrixMode(GL_MODELVIEW);&lt;br /&gt;            glPopMatrix();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        void maskSetType(MaskTypes::Type maskType)&lt;br /&gt;        {&lt;br /&gt;            this-&gt;maskType = maskType;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    private:&lt;br /&gt;        MaskTypes::Type maskType;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;#endif // SHAPEMASKED_H_INCLUDED&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;StringMasked.h&lt;/b&gt;&lt;br /&gt;&lt;pre class="prettyprint lang-cpp"&gt;&lt;br /&gt;#ifndef TEXTMASKED_H_INCLUDED&lt;br /&gt;#define TEXTMASKED_H_INCLUDED&lt;br /&gt;&lt;br /&gt;#include &amp;lt;SFML/Graphics.hpp&gt;&lt;br /&gt;#include "MaskTypes.h"&lt;br /&gt;#include "MaskUtils.h"&lt;br /&gt;&lt;br /&gt;using namespace sf;&lt;br /&gt;&lt;br /&gt;class StringMasked : public sf::String&lt;br /&gt;{&lt;br /&gt;    public:&lt;br /&gt;        StringMasked() :&lt;br /&gt;        String(),&lt;br /&gt;        maskType(MaskTypes::None)&lt;br /&gt;        {}&lt;br /&gt;&lt;br /&gt;        StringMasked(sf::Shape&amp; shape) :&lt;br /&gt;        String(),&lt;br /&gt;        maskType(MaskTypes::None)&lt;br /&gt;        {&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        void Draw(RenderTarget&amp; Target) const&lt;br /&gt;        {&lt;br /&gt;            // Save the current modelview matrix and set the new one&lt;br /&gt;            glMatrixMode(GL_MODELVIEW);&lt;br /&gt;            glPushMatrix();&lt;br /&gt;            glMultMatrixf(GetMatrix().Get4x4Elements());&lt;br /&gt;&lt;br /&gt;            bool restoreColorBuffer = false;&lt;br /&gt;            bool restoreBlendMode = false;&lt;br /&gt;            bool blendModePreviouslyEnabled;&lt;br /&gt;&lt;br /&gt;            MaskUtils maskUtils;&lt;br /&gt;            maskUtils.setBlendModesBasedOnMaskType(this-&gt;maskType, GetBlendMode());&lt;br /&gt;&lt;br /&gt;            // Set color&lt;br /&gt;            Color myColor = GetColor();&lt;br /&gt;            glColor4f(myColor.r / 255.f, myColor.g / 255.f, myColor.b / 255.f, myColor.a / 255.f);&lt;br /&gt;&lt;br /&gt;            // Let the derived class render the object geometry&lt;br /&gt;            Render(Target);&lt;br /&gt;&lt;br /&gt;            maskUtils.restoreStates();&lt;br /&gt;&lt;br /&gt;            // Restore the previous modelview matrix&lt;br /&gt;            glMatrixMode(GL_MODELVIEW);&lt;br /&gt;            glPopMatrix();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        void maskSetType(MaskTypes::Type maskType)&lt;br /&gt;        {&lt;br /&gt;            this-&gt;maskType = maskType;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        MaskTypes::Type maskGetType()&lt;br /&gt;        {&lt;br /&gt;            return this-&gt;maskType;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    private:&lt;br /&gt;        MaskTypes::Type maskType;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;#endif // TEXTMASKED_H_INCLUDED&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example programs:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;SpriteMask example:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://img841.imageshack.us/img841/6908/examplespritemask.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 301px;" src="http://img841.imageshack.us/img841/6908/examplespritemask.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;(actually, shows two examples: on the left, we can see a simple masking example. On the right, a way to do sub-windowing, by combining overlapping masked elements).&lt;br /&gt;&lt;pre class="prettyprint lang-cpp"&gt;&lt;br /&gt;#include &amp;lt;SFML/System.hpp&gt;&lt;br /&gt;#include &amp;lt;SFML/Graphics.hpp&gt;&lt;br /&gt;#include &amp;lt;iostream&gt;&lt;br /&gt;#include &amp;lt;fstream&gt;&lt;br /&gt;&lt;br /&gt;#include "SpriteMasked.h"&lt;br /&gt;#include "RenderWindowMask.h"&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    //sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");&lt;br /&gt;    RenderWindowMask App(sf::VideoMode(800, 600, 32), "SFML Graphics");&lt;br /&gt;    //App.PreserveOpenGLStates(true);&lt;br /&gt;&lt;br /&gt;    sf::Clock Clock;&lt;br /&gt;&lt;br /&gt;    sf::Image Image;&lt;br /&gt;    Image.LoadFromFile("northeast.jpg");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    sf::Image ImageMask;&lt;br /&gt;    ImageMask.LoadFromFile("images/window.tga");&lt;br /&gt;&lt;br /&gt;    SpriteMasked spriteMask;&lt;br /&gt;    spriteMask.SetImage(ImageMask);&lt;br /&gt;    spriteMask.SetPosition(200, 200);&lt;br /&gt;    spriteMask.maskSetType(MaskTypes::Mask);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    sf::Image ImageInsideWindow;&lt;br /&gt;    ImageInsideWindow.LoadFromFile("images/image.tga");&lt;br /&gt;    SpriteMasked spriteInsideWindow;&lt;br /&gt;    spriteInsideWindow.SetImage(ImageInsideWindow);&lt;br /&gt;    spriteInsideWindow.SetPosition(200, 200);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    const sf::Input&amp; Input = App.GetInput();&lt;br /&gt;    int             mouseXPrev = Input.GetMouseX(),&lt;br /&gt;                    mouseYPrev = Input.GetMouseY(),&lt;br /&gt;                    mouseX, mouseY;&lt;br /&gt;&lt;br /&gt;    float timeSinceLastUpdate;&lt;br /&gt;&lt;br /&gt;    int a = 0;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    // Start game loop&lt;br /&gt;    while (App.IsOpened())&lt;br /&gt;    {&lt;br /&gt;        // Process events&lt;br /&gt;        sf::Event Event;&lt;br /&gt;        while (App.GetEvent(Event))&lt;br /&gt;        {&lt;br /&gt;            // Close window : exit&lt;br /&gt;            if (Event.Type == sf::Event::Closed)&lt;br /&gt;                App.Close();&lt;br /&gt;            if ((Event.Type == sf::Event::KeyPressed) &amp;&amp; (Event.Key.Code == sf::Key::Escape))&lt;br /&gt;                App.Close();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        timeSinceLastUpdate = Clock.GetElapsedTime();&lt;br /&gt;        Clock.Reset();&lt;br /&gt;&lt;br /&gt;        mouseX = Input.GetMouseX();&lt;br /&gt;        mouseY = Input.GetMouseY();&lt;br /&gt;        float mouseMoveX = (float)(mouseXPrev - mouseX) * timeSinceLastUpdate * 6.0f;&lt;br /&gt;        float mouseMoveY = (float)(mouseYPrev - mouseY) * timeSinceLastUpdate * 6.0f;&lt;br /&gt;        mouseXPrev = mouseX;&lt;br /&gt;        mouseYPrev = mouseY;&lt;br /&gt;&lt;br /&gt;        App.Clear(sf::Color(200,0,0,255));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        /////&lt;br /&gt;        ///// Example 1: simple mask&lt;br /&gt;        /////&lt;br /&gt;        // draw sprite to use as mask&lt;br /&gt;        spriteMask.SetScale(1, 1);&lt;br /&gt;        spriteMask.SetPosition(100, 250);&lt;br /&gt;        spriteMask.maskSetType(MaskTypes::Mask);&lt;br /&gt;        App.Draw(spriteMask);&lt;br /&gt;&lt;br /&gt;        // draw normal sprite&lt;br /&gt;        spriteInsideWindow.maskSetType(MaskTypes::BlendWithPreviousMask);&lt;br /&gt;        spriteInsideWindow.SetScale(1, 1);&lt;br /&gt;        spriteInsideWindow.SetPosition(100, 250);&lt;br /&gt;        App.Draw(spriteInsideWindow);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        /////&lt;br /&gt;        ///// Example 2: use masking to do sub-windowing&lt;br /&gt;        /////&lt;br /&gt;&lt;br /&gt;        // how to draw sub-windows:&lt;br /&gt;        // 1) draw window contents first&lt;br /&gt;        // 2) draw stuff outside afterwards&lt;br /&gt;        // details:&lt;br /&gt;        // 1) draw window contents - background to foreground&lt;br /&gt;        //   a) draw window bg (don't care about mask)&lt;br /&gt;        //   b) draw mask&lt;br /&gt;        //   c) draw "negative" image (BlendWithPreviousMaskReversed)&lt;br /&gt;        //   d) draw other stuff on top of it&lt;br /&gt;        //   e) draw parent mask on top of it&lt;br /&gt;        // 2) draw stuff outside&lt;br /&gt;        //   a) draw "positive" other stuff over it (BlendWithPreviousMask)&lt;br /&gt;        //   ( b) draw mask again if necessary for every new image to draw? dunno)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        // 1) draw window contents - background to foreground&lt;br /&gt;        //   a) draw window bg (don't care about mask)&lt;br /&gt;        //   b) draw mask for next element&lt;br /&gt;        //   c) draw "negative" image (BlendWithPreviousMaskReversed)&lt;br /&gt;        //   d) draw other stuff on top of it&lt;br /&gt;        //   e) draw parent mask on top of it&lt;br /&gt;&lt;br /&gt;        //   a) draw window bg (don't care about mask)&lt;br /&gt;        spriteInsideWindow.SetScale(1,1);&lt;br /&gt;        spriteInsideWindow.maskSetType(MaskTypes::None);&lt;br /&gt;        spriteInsideWindow.SetPosition(500, 250);&lt;br /&gt;        App.Draw(spriteInsideWindow);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        //   b) draw mask for next element (1)&lt;br /&gt;        spriteMask.SetScale(0.4, 0.4);&lt;br /&gt;        spriteMask.SetPosition(550, 250);&lt;br /&gt;        spriteMask.maskSetType(MaskTypes::Mask);&lt;br /&gt;        App.Draw(spriteMask);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        //   c) draw "negative" image (BlendWithPreviousMaskReversed) (1)&lt;br /&gt;        spriteInsideWindow.maskSetType(MaskTypes::BlendWithPreviousMask);&lt;br /&gt;        spriteInsideWindow.SetScale(0.4, 0.4);&lt;br /&gt;        spriteInsideWindow.SetPosition(550, 250);&lt;br /&gt;        App.Draw(spriteInsideWindow);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        //   b) draw mask for next element (2)&lt;br /&gt;        spriteMask.SetScale(0.4, 0.4);&lt;br /&gt;        spriteMask.SetPosition(590, 250);&lt;br /&gt;        spriteMask.maskSetType(MaskTypes::Mask);&lt;br /&gt;        App.Draw(spriteMask);&lt;br /&gt;&lt;br /&gt;        //   c) draw "negative" image (BlendWithPreviousMaskReversed) (2)&lt;br /&gt;        spriteInsideWindow.maskSetType(MaskTypes::BlendWithPreviousMask);&lt;br /&gt;        spriteInsideWindow.SetScale(0.4, 0.4);&lt;br /&gt;        spriteInsideWindow.SetPosition(590, 250);&lt;br /&gt;        App.Draw(spriteInsideWindow);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        //   e) draw parent mask on top of it&lt;br /&gt;        spriteMask.SetScale(1.0, 1.0);&lt;br /&gt;        spriteMask.SetPosition(500, 200);&lt;br /&gt;        spriteMask.maskSetType(MaskTypes::Mask);&lt;br /&gt;        App.Draw(spriteMask);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        // 2) draw stuff outside&lt;br /&gt;        //   a) draw "positive" other stuff over it (BlendWithPreviousMask)&lt;br /&gt;        spriteInsideWindow.maskSetType(MaskTypes::BlendWithPreviousMaskReversed);&lt;br /&gt;        spriteInsideWindow.SetPosition(350,150);&lt;br /&gt;        spriteInsideWindow.SetScale(2,2);&lt;br /&gt;        App.Draw(spriteInsideWindow);&lt;br /&gt;&lt;br /&gt;        // Display window contents on screen&lt;br /&gt;        App.Display();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;ShapeMask example:&lt;br /&gt;(masking using a sf::Circle)&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://img824.imageshack.us/img824/8628/exampleshapemask.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 301px;" src="http://img824.imageshack.us/img824/8628/exampleshapemask.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;pre class="prettyprint lang-cpp"&gt;&lt;br /&gt;#include &amp;lt;SFML/System.hpp&gt;&lt;br /&gt;#include &amp;lt;SFML/Graphics.hpp&gt;&lt;br /&gt;#include &amp;lt;iostream&gt;&lt;br /&gt;#include &amp;lt;fstream&gt;&lt;br /&gt;&lt;br /&gt;#include "SpriteMasked.h"&lt;br /&gt;#include "ShapeMasked.h"&lt;br /&gt;#include "RenderWindowMask.h"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    //sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");&lt;br /&gt;    RenderWindowMask App(sf::VideoMode(800, 600, 32), "SFML Graphics");&lt;br /&gt;&lt;br /&gt;    sf::Clock Clock;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    sf::Image ImageInsideWindow;&lt;br /&gt;    ImageInsideWindow.LoadFromFile("images/image.tga");&lt;br /&gt;    SpriteMasked spriteInsideWindow;&lt;br /&gt;    spriteInsideWindow.SetImage(ImageInsideWindow);&lt;br /&gt;    spriteInsideWindow.SetPosition(200, 200);&lt;br /&gt;    spriteInsideWindow.maskSetType(MaskTypes::BlendWithPreviousMask);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    const sf::Input&amp; Input = App.GetInput();&lt;br /&gt;    int             mouseXPrev = Input.GetMouseX(),&lt;br /&gt;                    mouseYPrev = Input.GetMouseY(),&lt;br /&gt;                    mouseX, mouseY;&lt;br /&gt;&lt;br /&gt;    float timeSinceLastUpdate;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    // masking for shapes&lt;br /&gt;    sf::Shape circle = sf::Shape::Circle(0, 0, 100, sf::Color(255,255,255,0)); // note: zero alpha&lt;br /&gt;    ShapeMasked shapeMask(circle);&lt;br /&gt;    shapeMask.maskSetType(MaskTypes::Mask);&lt;br /&gt;&lt;br /&gt;    // Start game loop&lt;br /&gt;    while (App.IsOpened())&lt;br /&gt;    {&lt;br /&gt;        // Process events&lt;br /&gt;        sf::Event Event;&lt;br /&gt;        while (App.GetEvent(Event))&lt;br /&gt;        {&lt;br /&gt;            // Close window : exit&lt;br /&gt;            if (Event.Type == sf::Event::Closed)&lt;br /&gt;                App.Close();&lt;br /&gt;            if ((Event.Type == sf::Event::KeyPressed) &amp;&amp; (Event.Key.Code == sf::Key::Escape))&lt;br /&gt;                App.Close();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        timeSinceLastUpdate = Clock.GetElapsedTime();&lt;br /&gt;        Clock.Reset();&lt;br /&gt;&lt;br /&gt;        App.Clear(sf::Color(200,0,0,255));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        // draw shape mask&lt;br /&gt;        shapeMask.SetPosition(500,300);&lt;br /&gt;        App.Draw(shapeMask);&lt;br /&gt;&lt;br /&gt;        // draw masked image&lt;br /&gt;        spriteInsideWindow.SetPosition(450, 200);&lt;br /&gt;        App.Draw(spriteInsideWindow);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        // Display window contents on screen&lt;br /&gt;        App.Display();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;StringMask example:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://img214.imageshack.us/img214/9830/examplestringmask.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 301px;" src="http://img214.imageshack.us/img214/9830/examplestringmask.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;pre class="prettyprint lang-cpp"&gt;&lt;br /&gt;#include &amp;lt;SFML/System.hpp&gt;&lt;br /&gt;#include &amp;lt;SFML/Graphics.hpp&gt;&lt;br /&gt;#include &amp;lt;iostream&gt;&lt;br /&gt;#include &amp;lt;fstream&gt;&lt;br /&gt;&lt;br /&gt;#include "StringMasked.h"&lt;br /&gt;#include "SpriteMasked.h"&lt;br /&gt;#include "RenderWindowMask.h"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    //sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");&lt;br /&gt;    RenderWindowMask App(sf::VideoMode(800, 600, 32), "SFML Graphics"); // we'll need to use our RenderWindow to have access to "ClearMask" function&lt;br /&gt;    //App.PreserveOpenGLStates(true);&lt;br /&gt;&lt;br /&gt;    //std::ofstream myfile;&lt;br /&gt;    //myfile.open ("pixels.txt");&lt;br /&gt;&lt;br /&gt;    sf::Clock Clock;&lt;br /&gt;&lt;br /&gt;    sf::Image Image;&lt;br /&gt;    Image.LoadFromFile("northeast.jpg");&lt;br /&gt;&lt;br /&gt;    sf::Image ImageInsideText;&lt;br /&gt;    ImageInsideText.LoadFromFile("images/image.tga");&lt;br /&gt;&lt;br /&gt;    SpriteMasked spriteInsideText;&lt;br /&gt;    spriteInsideText.SetImage(ImageInsideText);&lt;br /&gt;&lt;br /&gt;    float timeSinceLastUpdate;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    // masking for text&lt;br /&gt;    // Create a graphical string&lt;br /&gt;    StringMasked stringMask;&lt;br /&gt;    stringMask.SetText("Hello !\nHow are you ?");&lt;br /&gt;    stringMask.SetFont(sf::Font::GetDefaultFont());&lt;br /&gt;    stringMask.SetPosition(100,50);&lt;br /&gt;&lt;br /&gt;    stringMask.maskSetType(MaskTypes::Mask);&lt;br /&gt;    stringMask.SetColor(sf::Color(0,0,0,255));&lt;br /&gt;&lt;br /&gt;    // Start game loop&lt;br /&gt;    while (App.IsOpened())&lt;br /&gt;    {&lt;br /&gt;        // Process events&lt;br /&gt;        sf::Event Event;&lt;br /&gt;        while (App.GetEvent(Event))&lt;br /&gt;        {&lt;br /&gt;            // Close window : exit&lt;br /&gt;            if (Event.Type == sf::Event::Closed)&lt;br /&gt;                App.Close();&lt;br /&gt;            if ((Event.Type == sf::Event::KeyPressed) &amp;&amp; (Event.Key.Code == sf::Key::Escape))&lt;br /&gt;                App.Close();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        timeSinceLastUpdate = Clock.GetElapsedTime();&lt;br /&gt;        Clock.Reset();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        App.Clear(sf::Color(200,0,0,255)); // clear the background to red&lt;br /&gt;&lt;br /&gt;        //// How to correctly draw a String to Mask/MaskReverse a sprite:&lt;br /&gt;        //// 1. clear the Window Alpha Mask before drawing the text (or the sprite may appear where you drew previous masks)&lt;br /&gt;        //// 2. draw the SPRITE as the mask (masking everywhere where the sprite would be)&lt;br /&gt;        //// 3. draw the STRING using the mask type "MaskOverWritePreviousMask" (thus "cutting" into the mask the previous sprite left)&lt;br /&gt;        //// 4. draw the Sprite again, normally, using the mask type "BlendWithPreviousMask"&lt;br /&gt;&lt;br /&gt;        App.ClearMask(); // 1. clears just the Window's alpha channel&lt;br /&gt;&lt;br /&gt;        // 2. use sprite to draw as mask&lt;br /&gt;        spriteInsideText.SetPosition(100,10);&lt;br /&gt;&lt;br /&gt;        // save the sprite mask and color state (may be necessary if you reuse this sprite elsewhere)&lt;br /&gt;        MaskTypes::Type prevMaskType = spriteInsideText.maskGetType();&lt;br /&gt;        sf::Color prevSpriteColor = spriteInsideText.GetColor();&lt;br /&gt;&lt;br /&gt;        spriteInsideText.SetColor(sf::Color(0,0,0,0));    // set the sprite's alpha to 0&lt;br /&gt;        spriteInsideText.maskSetType(MaskTypes::Mask);    // set the sprite to act as a mask&lt;br /&gt;        App.Draw(spriteInsideText);&lt;br /&gt;&lt;br /&gt;        // restore sprite mask+color state&lt;br /&gt;        spriteInsideText.maskSetType(prevMaskType);&lt;br /&gt;        spriteInsideText.SetColor(prevSpriteColor);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        // 3. draw text mask&lt;br /&gt;        stringMask.SetPosition(100,50);&lt;br /&gt;        stringMask.maskSetType(MaskTypes::MaskOverWritePreviousMask);&lt;br /&gt;        App.Draw(stringMask);&lt;br /&gt;&lt;br /&gt;        // 4. draw the masked sprite&lt;br /&gt;        spriteInsideText.SetPosition(100,10);&lt;br /&gt;        // using this blending mode, the sprite will be drawn normally and the text area will be "cut" from the sprite&lt;br /&gt;        spriteInsideText.maskSetType(MaskTypes::BlendWithPreviousMask);&lt;br /&gt;&lt;br /&gt;        App.Draw(spriteInsideText);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        // Example 2:&lt;br /&gt;        App.ClearMask(); // 1. clears just the Window's alpha channel&lt;br /&gt;&lt;br /&gt;        // 2. use sprite to draw as mask&lt;br /&gt;        spriteInsideText.SetPosition(500,10);&lt;br /&gt;&lt;br /&gt;        // save the sprite mask and color state (may be necessary if you reuse this sprite elsewhere)&lt;br /&gt;        prevMaskType = spriteInsideText.maskGetType();&lt;br /&gt;        prevSpriteColor = spriteInsideText.GetColor();&lt;br /&gt;&lt;br /&gt;        spriteInsideText.SetColor(sf::Color(0,0,0,0));    // set the sprite's alpha to 0&lt;br /&gt;        spriteInsideText.maskSetType(MaskTypes::Mask);    // set the sprite to act as a mask&lt;br /&gt;        App.Draw(spriteInsideText);&lt;br /&gt;&lt;br /&gt;        // restore sprite mask+color state&lt;br /&gt;        spriteInsideText.maskSetType(prevMaskType);&lt;br /&gt;        spriteInsideText.SetColor(prevSpriteColor);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        // 3. draw text mask&lt;br /&gt;        stringMask.SetPosition(500,50);&lt;br /&gt;        stringMask.maskSetType(MaskTypes::MaskOverWritePreviousMask);&lt;br /&gt;        App.Draw(stringMask);&lt;br /&gt;&lt;br /&gt;        // 4. draw the masked sprite&lt;br /&gt;        spriteInsideText.SetPosition(500,10);&lt;br /&gt;&lt;br /&gt;        // using this blending mode, the sprite will be drawn "inside" the text's characters&lt;br /&gt;        spriteInsideText.maskSetType(MaskTypes::BlendWithPreviousMaskReversed);&lt;br /&gt;&lt;br /&gt;        App.Draw(spriteInsideText);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        App.Display(); // Display window contents on screen&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    //myfile.close();&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This method has a few inconveniences, such as having the overhead of redrawing polygons, and Strings have some boring extra work needed and work the other way around than sprites and shapes, but I think it's altogether a good and flexible solution, and all-encompassing, technology-wise (supporting older hardware).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Plus, here's a little function for debugging, that saves the current alpha buffer to a file named "imageAlpha.png" (upside down, OpenGL stuff). May help you debug if you run into problems.&lt;br /&gt;&lt;pre class="prettyprint lang-cpp"&gt;&lt;br /&gt;void GetGLPixels()&lt;br /&gt;{&lt;br /&gt;    unsigned int startX = 0, startY = 0;&lt;br /&gt;    unsigned int width = 800, height = 600;&lt;br /&gt;&lt;br /&gt;    GLubyte* pixels = new GLubyte[width * height * 4];&lt;br /&gt;&lt;br /&gt;    glReadPixels(startX, startY, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    for(unsigned int idxPixelRow = 0; idxPixelRow &amp;lt; height; idxPixelRow++)&lt;br /&gt;    {&lt;br /&gt;        for(unsigned int idxPixelColumn = 0; idxPixelColumn &amp;lt; width; idxPixelColumn++)&lt;br /&gt;        {&lt;br /&gt;            unsigned int index = ((idxPixelRow * width) + idxPixelColumn) * 4;&lt;br /&gt;            unsigned int indexAlpha = ((idxPixelRow * width) + idxPixelColumn);&lt;br /&gt;&lt;br /&gt;            float valueRed = pixels[index + 0];&lt;br /&gt;            float valueGreen = pixels[index + 1];&lt;br /&gt;            float valueBlue = pixels[index + 2];&lt;br /&gt;            float valueAlpha = pixels[index + 3];&lt;br /&gt;&lt;br /&gt;            pixels[index] = pixels[index + 1] = pixels[index + 2] = 0;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    // create and save image&lt;br /&gt;    sf::Image imageAlpha;&lt;br /&gt;    imageAlpha.LoadFromPixels(width, height, pixels);&lt;br /&gt;    imageAlpha.SaveToFile("imageAlpha.png");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    delete pixels;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I hope this is helpful to others. I spent too much time looking for how to do this, longer than I thought should be for something as useful and old (masking is used on old arcade games to great effect, remember those big scrolling letters which masked the game going on behind it?)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-7430248722564726542?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/7430248722564726542/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=7430248722564726542' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/7430248722564726542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/7430248722564726542'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2010/09/how-to-do-masking-in-sfml-with-opengl.html' title='How to do masking in SFML (with OpenGL)'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-884633795928309118</id><published>2010-03-28T02:24:00.006+01:00</published><updated>2010-03-28T04:03:28.234+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Game Engine'/><category scheme='http://www.blogger.com/atom/ns#' term='gamedev'/><title type='text'>Engine growing pains</title><content type='html'>Where did I left off? Oh, that's right:&lt;br /&gt;&lt;br /&gt;After playing around with Chipmunk for a while, and implementing a few of the features that I want for one of my projects, I can do little but recommend it as a great physics library, very easy to code with, with great performance, and flexible! Allowed me to prototype some more complex features I want to add (destructible objects) with ease, and its structured in a way to allow to adapt it to many game mechanic scenarios. Some tests I did on an older computer showed it performed better than Box2D, but it was a superficial test, so I won't back up that claim :)&lt;br /&gt;&lt;br /&gt;Having a fine physics engine at my disposal, I decided I needed to create a level editor to easily start laying down levels; so, I needed a GUI. I looked around for a barebones lightweight GUI that would integrate well into Allegro, and went with the recommendations for GUIChan. It was indeed easy to integrate and use, and allowed me to design a GUI that let me add floors, walls and connect them with joints. This gave me an incredible sense of achievement, motivation, and the project started feeling more like a game and less like tech development, which was great. And doing levels in it was fun :)&lt;br /&gt;&lt;br /&gt;From this point, the code to connect the several engine parts was becoming a bit muddled, so I took a break to refactor it, and from there decided I needed to integrate scripting into the Engine, to allow for easier prototyping (I frequently realize that doing something that will apparently take a long time pays off in the long run, as it simplifies greatly the work and speeds it up after it is integrated and working).&lt;br /&gt;&lt;br /&gt;I looked around for available scripting engines, considering Lua, GameMonkey, Angelscript, Squirrel (I rejected Javascript as I don't quite like its syntax). I had some experience working with Lua, and it's generally the, but &lt;a href="http://blog.wolfire.com/2010/01/Choosing-a-scripting-language"&gt;Wolfire's reasons to their choice for scripting engine&lt;/a&gt; sounded quite reasonable (most importantly to me, C++ native integration and syntax), and the Internet showed me that AngelScript was showing a lot of promise, so in I went.&lt;br /&gt;&lt;br /&gt;I can say from my experience, integrating a new and unknown library into a project always involves some degree of time needed just to become acquainted with it's workings and quirks, and for integrating a scripting library, it takes quite a lot of time. After this initial period of figuring AngelScript's binding format and details, it was very rewarding to see my "main" function reduced to a few lines and the main code running from a script file, from there having access to all of my engine, being it graphics, gui or physics :)&lt;br /&gt;&lt;br /&gt;The next step was to integrate Hardware Graphic Acceleration into Allegro's drawing routines.&lt;br /&gt;I have been an Allegro fan for quite a few years, since I was exposed to Johan Peitz's excellent games "Alex the Allegator", "Operation Spacehog" and "Icy Tower", which I played extensively and all used Allegro). &lt;br /&gt;&lt;br /&gt;It presents lots of great features for quickly prototyping games, but being a library with a long legacy (from early DOS days), nowadays it requires a few add-ons to have important features, such as Jpeg and Png loading, and hardware acceleration for graphic rendering (and subsequent benefits from hardware rendering, such as fast transparency and lighting effects).&lt;br /&gt;&lt;br /&gt;With these being features I need for my projects, I looked into integrating hardware acceleration into Allegro, based on available libraries. The most obvious options were AllegroGL, which allows making OpenGL calls directly from Allegro (but requires knowledge of OpenGL, of which I possess but am quite rusty on:) ), or OpenLayer, which nicely covers all of OpenGL's technical stuff under a simple API. So, OpenLayer it was.&lt;br /&gt;&lt;br /&gt;...happily I went to integrate OpenLayer. Everything was going well, until... I wanted to load a Jpeg. OpenLayer natively allows png loading, but provides no support for Jpeg. "Ok", I think "I'll just the jpeg loader which I had previously included, it let's me load jpegs into Allegro fine".&lt;br /&gt;&lt;br /&gt;Turns out it wasn't so easy. OpenLayer was not doing well with me making non-Openlayer Allegro calls, which were necessary to load jpegs, and was not being capable of obtaining the data I passed onto it after loading from the image file. Looking around the web for some help or a solution made the problem obvious: OpenLayer once had a forum/mailing list, but is now discontinued; all the help I could get would be from Allegro's forums, but I could not find any information related to the problem I was facing, and to add the fact that OpenLayer had not been updated since 2007, I figured it was better to try another approach: move on.&lt;br /&gt;&lt;br /&gt;I went for a walk on the cold night air, to think it through, ponder my choices and come to a sound decision. Removing Allegro would involve refactoring most of the engine (and possibly losing the chance to use GUIChan), which would take extra time. However, with what I knew at the time, it was something I needed to do.&lt;br /&gt;&lt;br /&gt;So I looked for alternatives, from "game libraries", to "graphic libraries" to "game engines" (the difference between a library and an engine being that a library is code that integrates into other code, generally in C or C++, and an engine provides a more or less "complete" set of game necessary features such as graphics, sound, input, and collision/physics and is interacted with trough a scripting language, which allows for faster prototype/game development but is less flexible to adapt to your needs and probably slower than a game engine customized by yourself).&lt;br /&gt;&lt;br /&gt;So, for the switch from Allegro to another library, I went with &lt;a href="http://www.sfml-dev.org/index.php"&gt;Simple and Fast Multimedia Library (SFML)&lt;/a&gt;, an excellently documented (tutorials are the best documentation ever!), with a live community, great and simple API and feature complete for what I needed.&lt;br /&gt;I also considered using a 3D engine (Irrlicht, which I have some experience with and found very fast, unlike Ogre3D, and is used by &lt;a href="http://mm.soldat.pl/"&gt;Soldat's Michał Marcinkowski&lt;/a&gt; to a similar end that I would use), or an already available "game engine", such as "cocos2d", "angel-engine", "indielib", "love2d", or 2dboy's "rapid-prototyping-framework".&lt;br /&gt;&lt;br /&gt;Fortunately, SFML's great design and easy to follow documentation, and the fact that I already had the design for my engine decided and thought out made the reimplementation quick and painless. I strongly recommend SFML as a 2D game development library :)&lt;br /&gt;&lt;br /&gt;So now the Engine is composed of:&lt;br /&gt;&lt;br /&gt;SFML - Windowing, Graphics (Hardware accelerated), Input, Image/Font/Sound loading (and much more :))&lt;br /&gt;GUI - still to determine (possibilities: CEGUI, cpGUI, GUIChan with SFML wrapper)&lt;br /&gt;AngelScript - for Scripting&lt;br /&gt;Chipmunk - Physics library&lt;br /&gt;&lt;br /&gt;P.S: at the time I was thinking/looking for alternatives, I totally forgot that Allegro's recent branch (which will become Allegro 5) has included hardware acceleration and png/jpeg loading, which were the main features I needed to add. However, it's always refered to as "work in progress" and "unstable" and there weren't many Internet references to it, so it's probably best to avoid it for a while, and keep SFML as my current engine.&lt;br /&gt;&lt;br /&gt;So currently, I'm working on an animation system and resource management. Next, re-exposing the new engine to AngelScript, and finding a GUI. Then, defining and adding game objects including both visual and physical representations :) And from there, a game level with most/all game features in it (and naturally, starting work on graphics).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-884633795928309118?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/884633795928309118/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=884633795928309118' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/884633795928309118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/884633795928309118'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2010/03/engine-growing-pains.html' title='Engine growing pains'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-6087848777706810463</id><published>2010-02-28T22:05:00.003Z</published><updated>2010-02-28T22:10:08.874Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Stealth-Platformer-Shooter Project'/><title type='text'>Change of Pace</title><content type='html'>So I started thinking about how complex the whole Game Engine was becoming, and specifically the collision response module, and decided to switch gears for a while. In order to take a more frugal approach to the development of an engine I might use to create games, I decided to start from the other end, developing games without an underlying game engine, and learn from what I actually use to create the game, and then go from there.&lt;br /&gt;Started a new project which uses the excellent Chipmunk 2d Physics engine, hopefully I'll post more about it soon (the "Stealth-Platformer-Shooter Project" I mention in the top right box).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-6087848777706810463?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/6087848777706810463/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=6087848777706810463' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/6087848777706810463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/6087848777706810463'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2010/02/change-of-pace.html' title='Change of Pace'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-1301944576907843114</id><published>2010-01-28T17:42:00.005Z</published><updated>2010-01-28T18:02:33.630Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Game Engine'/><category scheme='http://www.blogger.com/atom/ns#' term='gamedev'/><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><title type='text'>Breaking news - Working on Game Engine</title><content type='html'>So hay!&lt;br /&gt;&lt;br /&gt;These past few months I have been experimenting and designing a collision detection and response method that would allow me to configure the objects collision parameters and don't have to implement how it would be handled, and make it reasonably flexible so it would cover most of the kinds of collision response seen in platforming games like Sonic, Megaman, or simpler ones like puzzlers. &lt;br /&gt;&lt;br /&gt;This has taken quite a lot of thinking, research, trial and error, and mostly TIME, and will take even more of these, so stuff got delayed (all this when I realised I wanted to not have to bother much with how collision response would behave in Pong! Then i started thinking how to build a unified and configurable collision response method so it would work for the kind of games I want to do, and would save me the trouble of rewriting code or worse, having to redesign my Game Engine). &lt;br /&gt;&lt;br /&gt;I'm designing it so it will not suffer from the problem of "tunelling", a frequent problem in game collision detection/response in which fast moving objects will go through other ones, ignoring the collison. This is something that i don't see correctly handled in many games, even to this day, and since I don't want to have to worry with bugs occurring from things that I can avoid by designing against them, I will design with that in mind. &lt;br /&gt;Also, it will feature basic dynamics, so that one can configure object's mass or bounciness, add some speed to them and they'll bounce around like nuts (no rotation though, yet).&lt;br /&gt;&lt;br /&gt;I see recent game creation frameworks such as Unity also do this, and i see it as a quite useful feature for an engine of this kind.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;On the other hand, I added a list on the side with the projects I plan on doing, which will be updated as I get into them, linking to posts about them, and will ultimately link to the game download.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To break the monotony of not actually making games, I started work on a side project about a game played by writing mathematical equations. I'll post it when it reaches "really fun" status (right now it's only "marginally interesting").&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-1301944576907843114?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/1301944576907843114/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=1301944576907843114' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/1301944576907843114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/1301944576907843114'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2010/01/news-update.html' title='Breaking news - Working on Game Engine'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-5362693719955124658</id><published>2009-12-29T13:32:00.007Z</published><updated>2009-12-29T14:36:07.876Z</updated><title type='text'>Playing around with cyberclay (a mimetic polyalloy)!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://i49.photobucket.com/albums/f291/TurboLento/Blog/pjmendes%20blogspot/sculptrix1st1.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 149px; height: 107px;" src="http://i49.photobucket.com/albums/f291/TurboLento/Blog/pjmendes%20blogspot/sculptrix1st1.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://i49.photobucket.com/albums/f291/TurboLento/Blog/pjmendes%20blogspot/sculptrix1st2.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 151px; height: 107px;" src="http://i49.photobucket.com/albums/f291/TurboLento/Blog/pjmendes%20blogspot/sculptrix1st2.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So I got the word (from &lt;a href="http://tigsource.com/articles/2009/12/20/sculptris-alpha"&gt;TIGSource&lt;/a&gt;) that a cool freeware sculpting tool came out, &lt;a href="http://drpetter.se/project_sculpt.html"&gt;Sculptris&lt;/a&gt;, by the same guy who made the coolest sound generator tool  &lt;a href="http://drpetter.se/project_sfxr.html"&gt;sfxr&lt;/a&gt;, and took some time off working in the "physics response" coding lab for the game engine, to give it a go. It's pretty cool, reminds me a bit of ZBrush's sculpting mode but has a few more interesting features (such as adding geometry where details is being added), is much easier to get into and do cool stuff, and all this for free!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-5362693719955124658?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/5362693719955124658/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=5362693719955124658' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/5362693719955124658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/5362693719955124658'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2009/12/playing-around-with-cyberclay-mimetic.html' title='Playing around with cyberclay (a mimetic polyalloy)!'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-2569977695026800376</id><published>2009-09-25T22:29:00.004+01:00</published><updated>2009-09-25T22:40:38.518+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='engine design'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><title type='text'>Xml-style game loading</title><content type='html'>How are you gentlemen&lt;br /&gt;&lt;br /&gt;After continuing the process of adding features to the Engine in order to allow the building and playing of a basic Pong game, i came to the point where i wanted to have the whole thing loaded from an external xml file.&lt;br /&gt;So i've spent the past 2-3 weeks designing a way to parse xml files and load the appropriate objects into the game, which has been quite a challenge because&lt;br /&gt;&lt;br /&gt;1. writing xml file parsers is kinda boring&lt;br /&gt;2. took a bit of code refactoring (to allow incremental construction of an Object - define an empty game entity and add modules to it as they are read from the file)&lt;br /&gt;3. adding the feature to inherit properties from an object (kinda like inheritance in object oriented design)&lt;br /&gt;&lt;br /&gt;So after testing loading a few basic entities from the xml format and playing with configuring them in different ways from the xml file, i'm now beginning to add all the available tags to fully allow the definition of the game in xml format. More uncreative and repetitive code, but necessary to have great big fun with it later :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-2569977695026800376?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/2569977695026800376/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=2569977695026800376' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/2569977695026800376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/2569977695026800376'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2009/09/xml-style-game-loading.html' title='Xml-style game loading'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-2732310520867216102</id><published>2009-05-22T17:00:00.000+01:00</published><updated>2009-05-22T22:47:58.824+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gamedev'/><category scheme='http://www.blogger.com/atom/ns#' term='wip'/><title type='text'>May News Update</title><content type='html'>So here's the current state of affairs: the game engine has reached a point where there still is a lot missing from it, but some basic gameplay can be designed. So i've started to do some old-school basic games, and keep building the engine as the games require, and generalize from that (i think it's good practice to design around the necessary game requirements instead of over generalizing the engine, which tends to make it in a state of never being complete).&lt;br /&gt;&lt;br /&gt;I've started with Pong, which interestingly has a few somewhat advanced features that some modern games don't even use, such as collision detection and dynamics (ball/paddle speed), and causes me to add stuff to the engine that i may have missed in design or underdesigned.&lt;br /&gt;&lt;br /&gt;I hope to post these first efforts soon :)&lt;br /&gt;&lt;br /&gt;It's rewarding to finally see (after some months of working on it) how easy the game engine allows to quickly come up with a game prototype, edit and change stuff, instead of always having to rewrite the game scratch. Also, as the engine design was broken into modules, it's fairly easy to pick up where i left off the past week (since i work on it mostly at nights, sometimes a week or so will go by without having time or energy to do coding)&lt;br /&gt;&lt;br /&gt;Next up will be Tetris! Yay :)&lt;br /&gt;&lt;br /&gt;First sketch of the title screen:&lt;br /&gt;&lt;a href="http://s49.photobucket.com/albums/f291/TurboLento/Blog/pjmendes%20blogspot/?action=view&amp;current=StartMenuBackground.png" target="_blank"&gt;&lt;img src="http://i49.photobucket.com/albums/f291/TurboLento/Blog/pjmendes%20blogspot/th_StartMenuBackground.png" border="0" alt="Pong prototype menu screen" &gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Screen cap of the current game main screen state of the game:&lt;br /&gt;&lt;a href="http://s49.photobucket.com/albums/f291/TurboLento/Blog/pjmendes%20blogspot/?action=view&amp;current=pong-2009-05-22-sshot.png" target="_blank"&gt;&lt;img src="http://i49.photobucket.com/albums/f291/TurboLento/Blog/pjmendes%20blogspot/th_pong-2009-05-22-sshot.png" border="0" alt="Photobucket" &gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-2732310520867216102?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/2732310520867216102/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=2732310520867216102' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/2732310520867216102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/2732310520867216102'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2009/05/may-news-update.html' title='May News Update'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-4048244531791504746</id><published>2009-03-28T14:30:00.000Z</published><updated>2009-03-28T16:26:38.012Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='gamedev'/><category scheme='http://www.blogger.com/atom/ns#' term='3d'/><category scheme='http://www.blogger.com/atom/ns#' term='wip'/><title type='text'>Actualização Noticiosa - News Update</title><content type='html'>&lt;a href="#2008-03-29-english"&gt;&lt;span style="font-style: italic;"&gt;Jump to English Version&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Boas, pessoal! Aqui vão notícias sobre aquilo que tenho andado a fazer.&lt;br /&gt;&lt;br /&gt;Tenho estado a trabalhar num "motor" de jogos, que me permitirá produzir vários jogos partindo de um programa comum, reduzindo o esforço de reimplementar tarefas comuns para cada jogo. O motor aproximar-se-á mais de um ambiente de desenvolvimento de jogos completo, e menos de uma "framework" em código sobre a qual se implementa mais código, procurando oferecer o maior número de funcionalidades possível para desenvolver qualquer jogo (para já, apenas baseado em "sprites", ou imagens 2D, não suportando ainda 3D real, mas permitirá uma série de truques para simulação 3D).&lt;br /&gt;Resolvi seguir uma abordagem de uma ideia que me surgiu depois de ler &lt;a href="http://www.squidi.net/three/entry.php?id=4"&gt;este post ("Three Hundred Mechanics - #004 - Environment Tree")&lt;/a&gt;, quando tiver avançado mais o desenvolvimento explico o funcionamento interno do programa em maior pormenor. O código está a ser desenvolvido em C++, utilizando a biblioteca de jogos "Allegro", e outras para carregamento de formatos de imagem.&lt;br /&gt;&lt;br /&gt;As principais funcionalidades que oferecerá serão:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;separação entre lógica de jogo e código, para configuração desta durante o curso do jogo ("run-time")&lt;/li&gt;&lt;li&gt;definição de toda a estrutura de jogo a partir de uma estrutura hierárquica (armazenando o "jogo" num ficheiro com estrutura baseada em XML).&lt;/li&gt;&lt;li&gt;características frequentes em jogos:&lt;br /&gt; &lt;/li&gt;&lt;ul&gt;&lt;li&gt;gráficas&lt;/li&gt;&lt;ul&gt;&lt;li&gt;definição de modelos visuais de jogo ("side-scroller", isométrica)&lt;br /&gt;     &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;efeitos gráficos ("scrolling", zoom)&lt;br /&gt;     &lt;/li&gt;&lt;li&gt;aceleração gráfica por hardware&lt;br /&gt;     &lt;/li&gt;&lt;li&gt;gráficos "raster" ou vectoriais&lt;br /&gt;     &lt;/li&gt;&lt;li&gt;definição de GUIs.&lt;br /&gt;     &lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Acções úteis na implementação de inteligência artificial (linha de visão, navegação baseada em percepção do ambiente)&lt;/li&gt;&lt;li&gt;Modelos para detecção de colisão/física simples ou newtoniana.&lt;br /&gt;   &lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;br /&gt;Algumas destas funcionalidades estão já implementadas, outras estão em curso disso, e algumas estão ainda a ser pensadas. Mas quando estiver tudo, vai ser bastante porreiro, e vão sair daqui uns jogos interessantes :) alguns dos quais já tenho pensados há bastante tempo e têm de ser feitos!&lt;br /&gt;&lt;br /&gt;Ocasionalmente trabalho em pixel-art, ou faço uns modelos 3D (tudo nos tempos livres, o emprego não permite mais). Aqui estão algumas das coisas que posso mostrar (cliquem para ver ao pormenor):&lt;br /&gt;&lt;a href="http://s49.photobucket.com/albums/f291/TurboLento/3D/Work%20In%20Progress/?action=view&amp;amp;current=3d-mao-wings-2008-03-29.jpg" target="_blank"&gt;&lt;img src="http://i49.photobucket.com/albums/f291/TurboLento/3D/Work%20In%20Progress/th_3d-mao-wings-2008-03-29.jpg" alt="Hand (Wings 3D)" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://s49.photobucket.com/albums/f291/TurboLento/3D/Work%20In%20Progress/?action=view&amp;amp;current=3d-2008-03-29-lc-face.jpg" target="_blank"&gt;&lt;img src="http://i49.photobucket.com/albums/f291/TurboLento/3D/Work%20In%20Progress/th_3d-2008-03-29-lc-face.jpg" alt="Face - Wings" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="2008-03-29-english"&gt;&lt;span style="font-style: italic;"&gt;(english version)&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;Hey guys! Some news on stuff i've been busy with.&lt;br /&gt;&lt;br /&gt;I've been working on a "game engine", which will allow me to produce different games using a single program, reducing the effort of reimplementing tasks which are common between games. The engine will be more of a development enviroment than a code framework on which to further code upon, and will provide a large feature list, allowing to develop (almost) any sprite-based game (only 2D sprite-based for now, some 3D effects can be simulated, but "real" 3D isn't really in the plans right now).&lt;br /&gt;&lt;br /&gt;The engine will follow a paradigm based on an idea that came to me after reading &lt;a href="http://www.squidi.net/three/entry.php?id=4"&gt;this post ("Three Hundred Mechanics - #004 - Environment Tree")&lt;/a&gt;, when development is further advanced i'll post more information on how it works. Right now, i've been coding in C++, using the Allegro game library, and several libs for image format handling.&lt;br /&gt;&lt;br /&gt;The main engine features will be:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;separation between engine code and game logic, allowing logic configuration during game run-time&lt;/li&gt;&lt;li&gt;definition of a full game using an hierarchy structure (storing the "game" on a XML language based file).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;frequently used game features:&lt;br /&gt; &lt;/li&gt;&lt;ul&gt;&lt;li&gt;graphics:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;selection of the game's visual mode ("side-scroller", isometric)&lt;br /&gt;     &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;graphical effects ("scrolling", zoom)&lt;br /&gt;     &lt;/li&gt;&lt;li&gt;hardware acceleration&lt;br /&gt;     &lt;/li&gt;&lt;li&gt;"raster" or vectorial graphics&lt;br /&gt;     &lt;/li&gt;&lt;li&gt;GUI construction support&lt;br /&gt;     &lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Useful agent actions for Artificial Intelligence implementation (line of sight, environment based navigation)&lt;/li&gt;&lt;li&gt;Collision Detection/Physics: simple or advanced (newtonian) models.&lt;br /&gt;   &lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;br /&gt;Some of these features are already implemented, others will be later, some requiring further thinking, but when it's done, it'll be pretty neat, and some interesting games will come out of it :) (some of which have been planned for quite some time, and must be done!)&lt;br /&gt;&lt;br /&gt;Occasionally i'll do some pixel-art or 3D models for fun, all in spare time (my job allowing). Here are some incomplete 3D stuff i've been working on, click for bigger size:&lt;br /&gt;&lt;a href="http://s49.photobucket.com/albums/f291/TurboLento/3D/Work%20In%20Progress/?action=view&amp;amp;current=3d-mao-wings-2008-03-29.jpg" target="_blank"&gt;&lt;img src="http://i49.photobucket.com/albums/f291/TurboLento/3D/Work%20In%20Progress/th_3d-mao-wings-2008-03-29.jpg" alt="Hand (Wings 3D)" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://s49.photobucket.com/albums/f291/TurboLento/3D/Work%20In%20Progress/?action=view&amp;amp;current=3d-2008-03-29-lc-face.jpg" target="_blank"&gt;&lt;img src="http://i49.photobucket.com/albums/f291/TurboLento/3D/Work%20In%20Progress/th_3d-2008-03-29-lc-face.jpg" alt="Face - Wings" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-4048244531791504746?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/4048244531791504746/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=4048244531791504746' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/4048244531791504746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/4048244531791504746'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2009/03/actualizacao-noticiosa-news-update.html' title='Actualização Noticiosa - News Update'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-7132475836844746392</id><published>2008-11-30T06:52:00.000Z</published><updated>2008-11-30T06:54:54.417Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='pixel art'/><title type='text'>Ascensão de Alvizzar</title><content type='html'>&lt;img src="http://i49.photobucket.com/albums/f291/TurboLento/Pixel%20Art/Hueg%20Lizard/hueglizard_final.png" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-7132475836844746392?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/7132475836844746392/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=7132475836844746392' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/7132475836844746392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/7132475836844746392'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2008/11/ascenso-de-alvizzar.html' title='Ascensão de Alvizzar'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228817528509556574.post-3155768129884022663</id><published>2008-11-28T17:06:00.001Z</published><updated>2008-11-28T17:06:54.009Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='apresentação'/><title type='text'>Apresentação</title><content type='html'>Ora muito bem vindos ao blog do PJMendes! Sou Paulo Mendes, habito em Coimbra, gosto de jogos electrónicos, filmes e séries de tv, e BD de todo o género.&lt;br /&gt;&lt;br /&gt;Pretendo apresentar neste blog as coisas que vou fazendo nestas áreas. Faço ilustração CG, pixel-art, animação (fg), modelação 3D e texturação, programo diversas coisas e de vez em quando aventuro-me no campo sonoro.&lt;br /&gt;&lt;br /&gt;Fiquem por perto.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228817528509556574-3155768129884022663?l=pjmendes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pjmendes.blogspot.com/feeds/3155768129884022663/comments/default' title='Enviar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228817528509556574&amp;postID=3155768129884022663' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/3155768129884022663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228817528509556574/posts/default/3155768129884022663'/><link rel='alternate' type='text/html' href='http://pjmendes.blogspot.com/2008/11/apresentao_28.html' title='Apresentação'/><author><name>Paulo Mendes</name><uri>http://www.blogger.com/profile/16600909431915868030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
