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

<channel>
	<title>Get Off My Lawn Entertainment</title>
	<atom:link href="http://GetOffMyLawnEntertainment.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://GetOffMyLawnEntertainment.com/blog</link>
	<description></description>
	<lastBuildDate>Sun, 25 Mar 2012 23:12:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>GDC 2012</title>
		<link>http://GetOffMyLawnEntertainment.com/blog/2012/03/25/gdc-2012/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=gdc-2012</link>
		<comments>http://GetOffMyLawnEntertainment.com/blog/2012/03/25/gdc-2012/#comments</comments>
		<pubDate>Sun, 25 Mar 2012 19:50:31 +0000</pubDate>
		<dc:creator>Chris Regnier</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://GetOffMyLawnEntertainment.com/blog/?p=147</guid>
		<description><![CDATA[I&#8217;ve been meaning to get this out for a little while now since GDC was 2 weeks ago now, but a whole bunch of things have gotten in the way. Alas I have finally found the time to do a small recap of GDC 2012. To begin with, it was just lots of fun. Got [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been meaning to get this out for a little while now since GDC was 2 weeks ago now, but a whole bunch of things have gotten in the way. Alas I have finally found the time to do a small recap of GDC 2012.</p>
<p>To begin with, it was just lots of fun. Got to meet lots of new people again this year. Oddly enough a good majority of them were all from here in Toronto. Maybe we should do a GDC Toronto? And I was informed that I now have to start coming to <a href="http://www.tojam.ca/home/default.asp" title="TOJam" target="_blank">TOJam</a> and <a href="http://handeyesociety.com/" title="Hand Eye Society" target="_blank">Hand Eye Society</a>, so I&#8217;ll try to make some time to visit these in the future. It&#8217;s nice to see the sheer amount of support there is in Toronto for the indie community. </p>
<p>There was lots of boozing all week long of course, and I think Tim and I found our main watering hole at The Chieftan after everyone else would be heading home. The little pub was close enough to the hotel and the Moscone Center that it was a definite win. But San Francisco, you really need to do something about your air! Everyone morning after drinking I would wake up the worst sore dry throat. Maybe I just need to hook up some beer helmet contraption to slowly moisten my throat throughout the night while sleeping (note: don&#8217;t actually try this unless you want to try for a <a href="http://www.darwinawards.com/" title="Darwin award" target="_blank">Darwin award</a>).</p>
<p>I wasn&#8217;t a fan of the new location. Most of the talks were in the west building this year. It did seem better for flow of people, but it just didn&#8217;t have the same &#8216;pizazz&#8217; for me because it just seemed like a bunch of big open warehouses to hold talks in. There was just something more intimate about having to walk through north and south more to get to all the talks. I think they had a lot more lines and overflow in north though, so I can understand the move to west.</p>
<p>I didn&#8217;t actually hit the show floor until Friday afternoon. I was far too busy trying to take in all the talks I could throughout the week. And after my visit to the show floor last year, I knew there wasn&#8217;t likely much more for me to see because I wasn&#8217;t looking for any sort of new products to integrate with, or services to use, etc. etc.. With that said, there were a couple cool things I noticed.</p>
<p>Adobe had an awesome little photobooth that would take your picture and send you a model of your face to use within your games. Talk about feeding into ones ego! Damn right I sat down and got my picture taken. Funny, but the guy wouldn&#8217;t let me sit and do multiple poses. <a href="http://GetOffMyLawnEntertainment.com/blog/2012/03/25/gdc-2012/funny-guys-poses-facebook-photos/" rel="attachment wp-att-148"><img src="http://GetOffMyLawnEntertainment.com/blog/wp-content/uploads/2012/03/funny-guys-poses-facebook-photos-e1332700660949-300x300.jpg" alt="poses boys do" title="poses-boys-do" width="300" height="300" class="alignnone size-medium wp-image-148" /></a><br />
Unfortunately, I never seemed to receive my model. I&#8217;m very curious where in cyberspace it is now, and more importantly what I had to sign in order to get the portrait done cause they didn&#8217;t give me a copy or send one to my email. Who knows, maybe I&#8217;ll go for a trip to some other country some day and see my mug on a huge poster! </p>
<p><a href="http://zspace.com/" title="zspace" target="_blank">zspace</a> had a super cool display of their 3d tablet drawing system. Put on the 3d glasses and you can now manipulate your scene in 3d space using a wacom like tablet and pen. Very impressed! I can definitely see some awesome uses for that.</p>
<p><a href="http://www.neurosky.com/" title="NeuroSky" target="_blank">NeuroSky</a> was there again this year and had a headset that can read your brainwaves. They have an api that allows you to use the device through bluetooth on an android or ios device. And for $99 you better believe I picked myself up one! I don&#8217;t expect this will be extremely useful for me at all as a product right now, but it&#8217;s got tons of potential so I wanted to get one and see what kind of data I could get out of it and whether it might turn into something useful in the future. I&#8217;ll definitely have to go into more detail on this cause I&#8217;m really psyched to play with it, but that won&#8217;t be for a couple of months at least I expect. I&#8217;ll let you know when I start investigating things more.  </p>
<p>And lastly, I liked the <a href="http://handelabra.com/" title="Game.Minder" target="_blank">Game.Minder</a> service that would give you reminders about upcoming games for companies that you want to be informed about. Basically it&#8217;s just another take at the app discoverability issue. I think the major issue for them will be getting everyone to use their app to get the updates. However, if they can get their app installed by default on android devices through a particular carrier for example, or become integrated into the ios sphere then I think they&#8217;d really have something! So good luck to them.</p>
<p>Other than all that it was talk after talk. I love knowledge, and so I find myself giddy trying to run from room to room to soak up the knowledge from each of the speakers. One of the best talks I sat in on would have to be <a href="http://www.insomniacgames.com/gdc12-mike_acton-data-oriented-design-for-math/" title="Mike Acton: DOD" target="_blank">Mike Acton&#8217;s talk on Data Driven Design</a> the first day. He ripped on object oriented programming a fair bit throughout the talk in favour of general c practices and data oriented design. Let me tell you, it&#8217;s funny to see someone rage against something that a lot of people in the audience were taught to believe and hold so dearly. Everyone was up in arms trying to argue with him on points. Although I do agree with almost everything he said, because the statements were all correct in certain scenarios, I believe he takes things a little too far in general. c++ has many extras in its language that are all useful in certain scenarios. There&#8217;s no reason not to use those features in those scenarios. Unfortunately many people do not have a strong enough grasp of absolutely everything in the language and/or a strong highly abstract thought process to really see where the boundaries are for these scenarios. And so you see these language constructs used in all kinds of places they shouldn&#8217;t be. But one of his arguments was to not use operator overloads on something like a matrix class. I see no reason not to, and I&#8217;ll have to leave the reasons for another day. It was a great talk though and I think more people within high positions in the industry need to push ideas like these. Not because these ideas are right, but because you then get people to critically think about what they&#8217;re doing and when to use different ideas which is extremely important.</p>
<p>And also I have to give a thanks to RIM for a new free playbook that I got in one of their talks. If things look on the up and up for them when I get around to doing any porting of my current engine I&#8217;ll definitely give some good thought to porting to their platform since there&#8217;s a lack of apps there now, and first mover advantage is always helpful.</p>
<p>Once again, awesome GDC 2012. If you didn&#8217;t go this year then make sure you go next year so you can join in on the fun. I&#8217;m positive you won&#8217;t regret it.</p>
]]></content:encoded>
			<wfw:commentRss>http://GetOffMyLawnEntertainment.com/blog/2012/03/25/gdc-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arrived at GDC 2012</title>
		<link>http://GetOffMyLawnEntertainment.com/blog/2012/03/04/arrived-at-gdc-2012/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=arrived-at-gdc-2012</link>
		<comments>http://GetOffMyLawnEntertainment.com/blog/2012/03/04/arrived-at-gdc-2012/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 02:19:07 +0000</pubDate>
		<dc:creator>Chris Regnier</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://GetOffMyLawnEntertainment.com/blog/?p=143</guid>
		<description><![CDATA[Well it&#8217;s that time of year again when copious amounts of game developers all show up in one city to eat, sleep, and play games; that&#8217;s right it&#8217;s GDC 2012 in San Francisco time. A friend (Tim McLennan, nothingness.ca) joined me and our trip didn&#8217;t start off too well since our plane was delayed about [...]]]></description>
			<content:encoded><![CDATA[<p>Well it&#8217;s that time of year again when copious amounts of game developers all show up in one city to eat, sleep, and play games; that&#8217;s right it&#8217;s GDC 2012 in San Francisco time.</p>
<p>A friend (Tim McLennan, <a href="http://www.nothingness.ca">nothingness.ca</a>) joined me and our trip didn&#8217;t start off too well since our plane was delayed about 5 hours due to a faulty parking break on the plane. On top of that I had recently gotten some kind of sinus infection that started with a big bump on my forehead and a puffy eye, and it was starting to puff up again. So I ended up passing out pretty quickly on the plane and slept almost the whole way there. It was kinda nice.</p>
<p>We got to our hotel, the Good Hotel, (seriously, it&#8217;s called the Good Hotel and they want you to know it!), and had a couple laughs cause of the decor. Everywhere around the hotel there&#8217;s a reference to &#8216;good.&#8217; In fact we were sitting there talking and Tim noticed something and flicked the lights. Above the bed in glow-in-the-dark stickers was the phrase &#8220;good-night&#8221;. Also, above the bed are signs that say &#8220;Be Good.&#8221; Yep it&#8217;s everywhere, it&#8217;s kinda funny. I like the hotel though and the rooms were much bigger than i was expecting for the price we paid, at least they were bigger than the ones last year. But the downside&#8230; the area around has gotta be the sketchiest area EVER! It&#8217;s really not a safe area at all. Unfortunately for the hotel, I really wouldn&#8217;t suggest anyone to ever get a place in this area.</p>
<p>Saturday we took a walk down the street on a mission to find some pirate store. I was thinking I may need a pirate patch to cover my puffed up eye so it wouldn&#8217;t scare anyone away. Heh, if anything it would be a conversational eye patch, cause who doesn&#8217;t love a good pirate&#8230;arrrr. Well like I said, the whole area we were in was super sketchy and there&#8217;s people hitting up on the streets, but we managed to walk through and find the coolest pirate store called 626 Velencia. All proceeds go to language classes for kids as well so how could go wrong. Seriously check out this store! I was extremely impressed with the &#8216;authenticity&#8217; of the place.</p>
<p>Today, Sunday, we register to get our GDC badges and get prepared for the awesomeness that&#8217;s gonna go down the rest of the week. I&#8217;m sure it&#8217;s gonna be an absolutely great week again, and I&#8217;m looking forward to tons of fun. If you see a guy with a pirate patch, that may just be me, so don&#8217;t forget to say ahoy matey.</p>
]]></content:encoded>
			<wfw:commentRss>http://GetOffMyLawnEntertainment.com/blog/2012/03/04/arrived-at-gdc-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keybinding beauty</title>
		<link>http://GetOffMyLawnEntertainment.com/blog/2012/02/26/keybinding-beauty/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=keybinding-beauty</link>
		<comments>http://GetOffMyLawnEntertainment.com/blog/2012/02/26/keybinding-beauty/#comments</comments>
		<pubDate>Sun, 26 Feb 2012 21:42:58 +0000</pubDate>
		<dc:creator>Chris Regnier</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://GetOffMyLawnEntertainment.com/blog/?p=140</guid>
		<description><![CDATA[When I first jumped into iOS development I obviously had to start using OSX. I hadn&#8217;t used a mac product before and wasn&#8217;t happy when I first moved over cause I had lost all productivity with my hands and my shortcuts. It sorta worked out that my main computer at the died on me so [...]]]></description>
			<content:encoded><![CDATA[<p>When I first jumped into iOS development I obviously had to start using OSX. I hadn&#8217;t used a mac product before and wasn&#8217;t happy when I first moved over cause I had lost all productivity with my hands and my shortcuts. It sorta worked out that my main computer at the died on me so I was &#8216;stuck&#8217; using my new macbook pro for absolutely everything &#8211; not just development. It took a while but I finally picked up the majority of the shortcuts so I could move around fluidly without having to touch that blasted mouse. In fact I&#8217;m able to quickly jump back and forth between Windows and OSX on a daily basis and instantly switch between which keys I press (even though I use the exactly same 101-keyboard type for both).</p>
<p>I still had problems with some of the shortcuts in XCode from an effective coding basis (like camelcase and fullword jumping) and thankfully I was able to change those around in XCode&#8217;s preferences. I think the most important shortcuts I changed were for page up/down and the home/end keys. It&#8217;s an automatic for me to jump around a file using home/end page up/down and the arrow keys and I was getting frustrated not being able to use them before. My key changes make me happy and more productive in XCode&#8230; but what about the rest of the system? I write a bunch of notes in TextEdit usually and I found lately I&#8217;m starting to get really frustrated when I go for that home/end key to jump around the line, only to find myself at the top/bottom of the document. Useless! A little bit of googlin&#8217; and I find myself an <a href="http://blog.macromates.com/2005/key-bindings-for-switchers/" title="Changing Keybindings" target="_blank">answer</a> &#8211; you can change your key bindings <img src='http://GetOffMyLawnEntertainment.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>So real quick just do the following:</p>
<p><code>
<pre>
mkdir ~/Library/KeyBindings
cd ~/Library/KeyBindings
touch DefaultKeyBinding.dict
</pre>
<p></code></p>
<p>Now edit the new DefaultKeyBinding.dict file and add the following:<br />
<code>
<pre>
{
    /* home */
    "\UF729"  = "moveToBeginningOfLine:";
    "$\UF729" = "moveToBeginningOfLineAndModifySelection:";

    /* end */
    "\UF72B"  = "moveToEndOfLine:";
    "$\UF72B" = "moveToEndOfLineAndModifySelection:";

    /* page up/down */
    "\UF72C"  = "pageUp:";
    "\UF72D"  = "pageDown:";
}
</pre>
<p></code></p>
<p>Restart any Cocoa apps (like TextEdit) if they&#8217;re open, and then presto! home/end keys work as expected. I can now jump to the beginning and end of the line with ease. It&#8217;s a small win, but I&#8217;ll take what I can get! <img src='http://GetOffMyLawnEntertainment.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://GetOffMyLawnEntertainment.com/blog/2012/02/26/keybinding-beauty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clang plugin development tutorial</title>
		<link>http://GetOffMyLawnEntertainment.com/blog/2011/10/01/clang-plugin-development-tutorial/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clang-plugin-development-tutorial</link>
		<comments>http://GetOffMyLawnEntertainment.com/blog/2011/10/01/clang-plugin-development-tutorial/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 03:54:52 +0000</pubDate>
		<dc:creator>Chris Regnier</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://GetOffMyLawnEntertainment.com/blog/?p=109</guid>
		<description><![CDATA[The past week I&#8217;ve had my hands deep in &#8216;build system&#8217; land.  It&#8217;s been frustrating as hell!  The goal was to pull down the clang source and start hacking away at a quick plugin to see what&#8217;s possible and if I can transform the code tree automagically.  Boy was I off on the quick part.  [...]]]></description>
			<content:encoded><![CDATA[<p>The past week I&#8217;ve had my hands deep in &#8216;build system&#8217; land.  It&#8217;s been frustrating as hell!  The goal was to pull down the clang source and start hacking away at a quick plugin to see what&#8217;s possible and if I can transform the code tree automagically.  Boy was I off on the quick part.  One problem after another trying to get things to actually build.  Since things were so difficult for me I figured I&#8217;d share what I&#8217;ve learned in case it can help someone else.<span id="more-109"></span></p>
<p>There isn&#8217;t really much documentation out there specific to making clang plugins, and there&#8217;s definitely not a lot of help if things go wrong.  One of the links I found was from the chromium <a title="Chromium Clang plugin" href="http://code.google.com/p/chromium/wiki/WritingClangPlugins" target="_blank">project</a>. Their advice was to just copy the build system which I wasn&#8217;t happy with, and that&#8217;s what lead me down a path of pain and suffering.  But if you&#8217;re cool with that then they&#8217;re right it might just be easier to copy the clang build system, but if you&#8217;re not cool with that then you&#8217;re in the right place.</p>
<p>As prereqs here&#8217;s the things you&#8217;re likely going to want installed already to make things easier:</p>
<ul>
<li>doxygen</li>
<li>graphviz</li>
<li>cmake</li>
</ul>
<p>&nbsp;</p>
<h3><strong>Download LLVM/Clang</strong></h3>
<p>To start off you&#8217;re gonna need the LLVM source tree and the clang source tree (more detail <a title="Clang getting started" href="http://clang.llvm.org/get_started.html" target="_blank">here</a>).  I didn&#8217;t want to go for trunk and maybe have problems beyond my understanding to begin with so I pulled down the most recent release versions instead.</p>
<p>Open a shell and go do to where you want to put things.<br />
<code><br />
mkdir dev-lib    #(/Users/chris/dev-lib)<br />
cd dev-lib<br />
svn co http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_29/final llvm<br />
</code></p>
<p>Then pull down the source tree for clang.<br />
<code>cd llvm/tools<br />
svn co http://llvm.org/svn/llvm-project/cfe/branches/release_29/ clang<br />
cd ../     #(back to the llvm dir)<br />
</code><br />
&nbsp;</p>
<h3><strong>Build LLVM/Clang</strong></h3>
<p>Instead of using configure and makefiles directly I decided to play with cmake instead.  Pretty slick if you ask me.  And it definitely cleans up those make files.  So I&#8217;d suggest you go the cmake route here (at least it was the way I was finally able to get things to work).<br />
Create a build directory<br />
<code>mkdir build<br />
cd build<br />
cmake -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo ../<br />
</code></p>
<p>There&#8217;s a bunch of options you can pass to cmake <a title="Some CMake options for LLVM" href="http://llvm.org/docs/CMake.html" target="_blank">here</a>. There&#8217;s a GUI you can use as well that will allow you to see a bunch of options (or you can run &#8220;<code>make edit-cache</code>&#8221; after you&#8217;ve done the initial cmake call).  If you want to compile in the clang examples add the option &#8220;<code>-DCLANG_BUILD_EXAMPLES:BOOL=ON</code>&#8221;</p>
<p>Now compile the llvm/clang source. This could take a while.<br />
<code>make -j3</code></p>
<p>Since this is a development tree I didn&#8217;t want to install it on the system and have it mess with the version of clang that shipped with XCode. So I&#8217;m going to assume things are not installed and full paths are needed.</p>
<p>You can now compile and test out the clang examples, like PrintFunctionNames, to make sure things work.  The README in the example folder tells you how to do this.  Don&#8217;t forget to use the clang version you just compiled (in build/bin/) rather than any others on the system.<br />
&nbsp;</p>
<h3><strong>Create new plugin</strong></h3>
<p>In fact since the PrintFunctionNames is the basic plugin that we want to test out let&#8217;s pull the example into our own workspace to try and build it there.<br />
<code>cd ~/dev-lib/<br />
mkdir example<br />
cd example<br />
mkdir printer<br />
cp ../llvm/tools/clang/examples/PrintfFunctionNames.cpp printer/<br />
cp ../llvm/tools/clang/examples/PrintfFunctionNames.exports printer/<br />
</code><br />
&nbsp;</p>
<h3><strong>Create separate build system</strong></h3>
<p>Now we want to make this plugin separately from the llvm/clang source tree so we&#8217;ll need to create some CMakeLists.txt for cmake to do its magic. First one is ~/dev-lib/example/CMakeLists.txt<br />
<code>
<pre>
cmake_minimum_required (VERSION 2.6)
project (Printer)

set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )

set (LLVM_SRC_DIR /Users/chris/dev-lib/llvm)
set (CLANG_SRC_DIR /Users/chris/dev-lib/llvm/tools/clang)
set (LLVM_BUILD_DIR /Users/chris/dev-lib/llvm/build)
set (CLANG_BUILD_DIR /Users/chris/dev-lib/llvm/build/tools/clang)

add_definitions (-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS)
add_definitions (-D_GNU_SOURCE -DHAVE_CLANG_CONFIG_H)

# this sets up the devel clang as our compiler
set (CMAKE_CXX_COMPILER "${LLVM_BUILD_DIR}/bin/clang++")
set (CMAKE_CC_COMPILER "${LLVM_BUILD_DIR}/bin/clang")

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
	-fPIC
	-fno-common
	-Woverloaded-virtual
	-Wcast-qual
	-fno-strict-aliasing
	-pedantic
	-Wno-long-long
	-Wall
	-W
	-Wno-unused-parameter
	-Wwrite-strings
	-fno-exceptions
	-fno-rtti")
set (CMAKE_MODULE_LINKER_FLAGS "-Wl,-flat_namespace -Wl,-undefined -Wl,suppress")

set (LLVM_LIBS
	LLVMJIT
	LLVMX86CodeGen
	LLVMX86AsmParser
	LLVMX86Disassembler
	LLVMExecutionEngine
	LLVMAsmPrinter
	LLVMSelectionDAG
	LLVMX86AsmPrinter
	LLVMX86Info
	LLVMMCParser
	LLVMCodeGen
	LLVMX86Utils
	LLVMScalarOpts
	LLVMInstCombine
	LLVMTransformUtils
	LLVMipa
	LLVMAnalysis
	LLVMTarget
	LLVMCore
	LLVMMC
	LLVMSupport
)

macro(add_clang_plugin name)
	set (srcs ${ARGN})

	include_directories( "${LLVM_SRC_DIR}/include"
		"${CLANG_SRC_DIR}/include"
		"${CLANG_BUILD_DIR}/include" )
	link_directories( "${LLVM_BUILD_DIR}/lib" )

	add_library( ${name} SHARED ${srcs} )

	if (SYMBOL_FILE)
		set_target_properties( ${name} PROPERTIES LINK_FlAGS
			"-exported_symbols_list ${SYMBOL_FILE}")
	endif()

	foreach (clang_lib ${CLANG_LIBS})
		target_link_libraries( ${name} ${clang_lib} )
	endforeach()

	foreach (llvm_lib ${LLVM_LIBS})
		target_link_libraries( ${name} ${llvm_lib} )
	endforeach()

	foreach (user_lib ${USER_LIBS})
		target_link_libraries( ${name} ${user_lib} )
	endforeach()

endmacro(add_clang_plugin)

add_subdirectory(printer)
</pre>
<p></code></p>
<p>Notice the large list of LLVM libs to link in.  I&#8217;m not totally sure if ALL of them need to be in the list, I just included everything to make my life easier. You should also make sure the path names for <code>LLVM_SRC_DIR</code> and others point to your proper paths.</p>
<p>Now we have an easy macro to add any new clang plugin with.  Just fill in a couple of variables with libraries and source files and you&#8217;re done.  The variables you can set are <code>SYMBOL_FILE</code>, <code>CLANG_LIBS</code>, and <code>USER_LIBS</code>. So let&#8217;s make the CMakeLists.txt in our Printer plugin folder.</p>
<p><code>
<pre>
set(SYMBOL_FILE PrintFunctionNames.exports)

set (CLANG_LIBS
	clang
	clangFrontend
	clangAST
	clangAnalysis
	clangBasic
	clangCodeGen
	clangDriver
	clangFrontendTool
	clangIndex
	clangLex
	clangParse
	clangRewrite
	clangSema
	clangSerialization
	clangStaticAnalyzerCheckers
	clangStaticAnalyzerCore
	clangStaticAnalyzerFrontend
)

set (USER_LIBS
	pthread
)

add_clang_plugin(PrintFunctionNames PrintFunctionNames.cpp)

set_target_properties(PrintFunctionNames PROPERTIES
	LINKER_LANGUAGE CXX
	PREFIX "")
</pre>
<p></code></p>
<p>We first set all the variables to pass in the proper data.<br />
<code>SYMBOL_FILE</code> points to the symbol exports file needed to make the shared library.<br />
<code>CLANG_LIBS</code> contains any clang libs to link with. And again, just to make my life easier I included ALL of the clang libs, whether they were needed or not.<br />
<code>USER_LIBS</code> then contains any extra libraries you want to add, but you may need to add more link_directories if they&#8217;re not in the current search list.<br />
Then we call the add_clang_plugin macro and pass it the name of the library we want made, and the name of any dependent files (*.cpp/*.h).<br />
Last, we do a couple of maintenance things on our PrintFunctionNames target so that things build the way we want them.</p>
<p>That&#8217;s it for the build system! Now time to build our plugin<br />
&nbsp;</p>
<h3><strong>Build the plugin</strong></h3>
<p>Create another build folder.<br />
<code><br />
mkdir build   #(/Users/chris/dev-lib/example/build)<br />
cd build<br />
cmake ../<br />
make<br />
</code></p>
<p>You should now have a PrintFunctionNames shared library sitting in your build/lib folder.<br />
&nbsp;</p>
<h3><strong>Test the plugin</strong></h3>
<p>Let&#8217;s test it out. (I&#8217;m using bash here)<br />
<code><br />
export TEMP_CXX_FLAGS="-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I../../llvm/include -I../../llvm/tools/clang/include -I../../llvm/build/tools/clang/include"<br />
../../llvm/build/bin/clang -cc1 -load lib/PrintFunctionNames.dylib ${TEMP_CXX_FLAGS} -plugin print-fns ../printer/PrintFunctionNames.cpp<br />
</code></p>
<p>If everything went right, there should be a ton of function names on your screen<br />
&nbsp;</p>
<h3><strong>Profit!&#8230;</strong></h3>
<p>So that&#8217;s it. There&#8217;s your first clang plugin. Hopefully this helps someone get started.</p>
<p>My next goal is to test things out a bit and build up something to create an automatic RTTI system. Still a long ways away from that though, but I&#8217;ll be sure to let you know how it goes.</p>
<p>Be sure to add me on twitter @<a title="GOMLE_ca" href="http://twitter.com/#!/GOMLE_ca" target="_blank">GOMLE_ca</a> and let me know if you come up with any cool plugins if your own.</p>
]]></content:encoded>
			<wfw:commentRss>http://GetOffMyLawnEntertainment.com/blog/2011/10/01/clang-plugin-development-tutorial/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>The Numbers Game</title>
		<link>http://GetOffMyLawnEntertainment.com/blog/2011/09/19/the-numbers-game/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-numbers-game</link>
		<comments>http://GetOffMyLawnEntertainment.com/blog/2011/09/19/the-numbers-game/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 02:52:20 +0000</pubDate>
		<dc:creator>Chris Regnier</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://GetOffMyLawnEntertainment.com/blog/?p=104</guid>
		<description><![CDATA[I often read AltDevBlogADay and love the amount of great articles that are posted there!  Today Kristen Bornemann made a good post on the topic of game cloning.  She touched on a point that I find will be very important for the future and I think the cause of it is all because of the [...]]]></description>
			<content:encoded><![CDATA[<p>I often read <a title="AltDevBlogADay" href="http://altdevblogaday.com/" target="_blank">AltDevBlogADay</a> and love the amount of great articles that are posted there!  Today Kristen Bornemann made a good post on the topic of <a title="To Players There's No Concept of Cloning" href="http://altdevblogaday.com/2011/09/19/to-players-theres-no-concept-of-cloning/" target="_blank">game cloning</a>.  She touched on a point that I find will be very important for the future and I think the cause of it is all because of the numbers game that we as humans are playing.  So I felt the need to gather a couple of thoughts and give an explanation of why I think it&#8217;s going to become more and  more of a reality, and that there&#8217;s really no point in fighting it, but instead try to be ahead of the curve and provide more than what others can.  Here was my response:<br />
<span id="more-104"></span><br />
&nbsp;</p>
<p><em>I think this &#8216;problem&#8217; as many consider it, will continue to get worse and will eventually become the norm.  The cause is a pure numbers game and helped by efficiencies throughout production.</em></p>
<p><em>Let me explain more.</em><br />
<em>To begin with you have a convoy of settlers and only one person knows how to plant and grow apples. Everyone likes apples and want the product. That person has a skill that no one else has, and is able to monetize/trade from it.  Until someone else gains that skill, and notices that they too can make the same product and profit. They&#8217;ll probably make something a little different in order to differentiate their product.  Since there&#8217;s not many competitors yet in this harvesting game someone quickly figures out how to differentiate more and harvests oranges.  Since everyone knows you can&#8217;t compare apples and oranges it&#8217;s considered a new product.  All is good.</em></p>
<p><em>Fast forward lifetimes.  There&#8217;s now tons of people all trying to market their apples and oranges, etc. and competing for customers and lowering their prices.  There&#8217;s been a bunch of new harvesting technologies as well that has helped make it super easy to harvest all kinds of fruits.  These efficiencies have made it so easy in fact that now more people are doing it as a pastime even.  They&#8217;re not looking to make money off it either, so they&#8217;re willing to practically give away the &#8216;fruits of their labour&#8217; if you will, for free!  Teleporters exist of course too, making it super easy to market goods to anyone around their world in an instant, and removing any sort of &#8216;shipping&#8217; costs.</em></p>
<p><em>There&#8217;s now tons of people all trying to harvest fruit and market it.  How many possible variations can there be?  Location may have been a deciding factor before, but now thanks to the efficiencies in transporting these goods apples on one side of the world are in the same market as the ones on the other side of the world.  So you&#8217;re bound to start seeing the same product.</em></p>
<p><em>When you have so many people all doing the same thing with very little cost to themselves, it&#8217;s like a brute force method of finding every type of fruit out there.  Welcome to crowd-sourcing &#8230;err crowd-harvesting.</em></p>
<p><em>So what to do about it? Don&#8217;t fight it cause you&#8217;re fighting numbers. Numbers almost always win. Instead you adapt. Figure out what &#8216;variables&#8217; are in the whole process (from creation to marketing), which ones you were relying on before, why they&#8217;re gone now, and then which ones are still there that you can make your competency and do better than others.</em></p>
<p><em>You&#8217;re right about one thing, being first to market with a new variation can help. That&#8217;s your timing variable. Does that affect your quality variable though.  Marketing to the right audience and just getting eyeballs on your product is a big one.  That&#8217;s often the one that pulls in the customers for iOS.  But I think there&#8217;s more than just the marketing or timing.  I think that quality variable is huge! As well as providing some sort of value to the customer. </em><br />
<em>But the only way you&#8217;re going to be able to combat the clones is to make your product unique enough that it&#8217;s hard for others to reproduce.  That&#8217;s why Walmart is where they are. JIT shipping is huge, and it&#8217;s not easy to reproduce.  Learning your trade better than others, and figuring out how to exploit one of those variables means you can make better and faster art than the next guy, or you can make some killer particle effects code that&#8217;s #1, or you can manage 10x more projects at the same time, and you can do it fast enough that the cloners are always a couple steps behind.</em></p>
<p>&nbsp;</p>
<p>As they say, times they-are-a-changin&#8217;. The world in general is seeing many things become relatively cheap or easy to do thanks to technological advances.  And with the massive population that we have, there are tons of ideas out there, so you&#8217;re bound to find someone working on the same idea as you.  This is extremely important for the patent debate, but I&#8217;ll leave that for another day.  Not sure what the next &#8216;right&#8217; move is, but who knows maybe we should be finding these others and collaborating instead? Could we possibly make a better game together?</p>
]]></content:encoded>
			<wfw:commentRss>http://GetOffMyLawnEntertainment.com/blog/2011/09/19/the-numbers-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Freemium Pricing</title>
		<link>http://GetOffMyLawnEntertainment.com/blog/2011/09/05/freemium-pricing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=freemium-pricing</link>
		<comments>http://GetOffMyLawnEntertainment.com/blog/2011/09/05/freemium-pricing/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 18:51:52 +0000</pubDate>
		<dc:creator>Chris Regnier</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://GetOffMyLawnEntertainment.com/blog/?p=99</guid>
		<description><![CDATA[Through the copious amounts of stuff that I&#8217;ve read about pricing over the past couple of years and the work I&#8217;ve done at school so far, I&#8217;d like to believe that I have a decent idea about what exactly the Freemium pricing model is all about and why it&#8217;s so hot right now. I&#8217;ve obviously [...]]]></description>
			<content:encoded><![CDATA[<p>Through the copious amounts of stuff that I&#8217;ve read about pricing over the past couple of years and the work I&#8217;ve done at school so far, I&#8217;d like to believe that I have a decent idea about what exactly the Freemium pricing model is all about and why it&#8217;s so hot right now.</p>
<p>I&#8217;ve obviously been trying to think about pricing strategies and where to place my games/products in the mix. I figured I&#8217;d write up some stuff on the different pricing models in general. … But since I&#8217;m no expert, and TechCrunch had a great post on the freemium model yesterday, I&#8217;ll just post this well placed link right <a title="Complete Guide To Freemium" href="http://techcrunch.com/2011/09/04/complete-guide-freemium/" target="_blank">here</a> <img src='http://GetOffMyLawnEntertainment.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
<span id="more-99"></span></p>
<p>When you piece everything together it fits in well with how the iOS gaming world has taken shape. With so many apps to choose from, there&#8217;s obviously TONS of competition battling for your $$$. Add on to that the fact that many people don&#8217;t know if they should spend money on your game or another one, because you normally need some experience with something before you can compare against it. You&#8217;re left with those first few people that take the plunge and decide to give something away for free because they found another way to monetize off things (or they don&#8217;t care about the money?). Others then see the amazing numbers of people that flock towards free, and figure they&#8217;ll do the same and find another way to monetize as well. You then get a significant number of developers doing the same which eventually leads to users &#8216;expecting&#8217; free because the &#8216;other guy&#8217; is doing it, or because they have no reason to check our yours since as far as they&#8217;re concerned they can get the &#8216;same&#8217; game elsewhere for free. The last part is a pretty important part I think, but I&#8217;ll get back to this in a bit.</p>
<p>The article also slightly touched on the quality of product factor, but more from the angle of &#8220;this is what you need to be successful.&#8221; Well I think the quality of product has also led to people going the freemium route as well. With many titles on iOS lacking in what I would call professional quality (not everyone can be a top level studio!), people would compare the price-value of the products and determine that it is lower than a top quality game. The developers likely realize this and instead offer price points that reflect the value they believe is there. With a limit on how low you can sell your product for (ie. free), I think we many have ended up at freemium models.</p>
<p>I don&#8217;t think this is either right, wrong, good, or bad. It&#8217;s just something different! It&#8217;s just another way of doing things and in general is a perfectly viable (and sometimes superior) way to make money from your games.</p>
<p>You have to remember that this is still a product though, and you need to make enough money on it to cover costs at least. And so we come back to what people will pay money for. Value. People will pay for something they consider valuable. Show them that your game has more value to them than the competitor and they will be willing to pull out the wallets. What is that &#8216;value&#8217; is a-whole-nother topic for another day.</p>
]]></content:encoded>
			<wfw:commentRss>http://GetOffMyLawnEntertainment.com/blog/2011/09/05/freemium-pricing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Site Design</title>
		<link>http://GetOffMyLawnEntertainment.com/blog/2011/08/21/new-site-design/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=new-site-design</link>
		<comments>http://GetOffMyLawnEntertainment.com/blog/2011/08/21/new-site-design/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 03:04:38 +0000</pubDate>
		<dc:creator>Chris Regnier</dc:creator>
				<category><![CDATA[Company]]></category>

		<guid isPermaLink="false">http://GetOffMyLawnEntertainment.com/blog/?p=89</guid>
		<description><![CDATA[I am pleased to announce the new website design for Get Off My Lawn Entertainment! The old template was something quick that I found when I first set things up because I am not a web developer (in fact I have quite the aversion to it).  The plan was to then get someone to make [...]]]></description>
			<content:encoded><![CDATA[<p>I am pleased to announce the new website design for Get Off My Lawn Entertainment!</p>
<p>The old template was something quick that I found when I first set things up because I am not a web developer (in fact I have quite the aversion to it).  The plan was to then get someone to make up a site for the business.  That didn&#8217;t seem to happen very quickly &#8230; or at all really.  I had already done a quick layout of how I wanted things to look for myself, and created some of the art, I just needed to hand it to someone to actually code it.  A couple of things got in the way.  I really didn&#8217;t know where to find someone to actually do web development for me.  Not that I couldn&#8217;t find one through a quick search, but I didn&#8217;t know where to look for someone that I could trust to have the skills to do it quick, at a reasonable price, and to hash out some more of the fine details of my quick layout.<br />
<span id="more-89"></span></p>
<p>The biggest problem of all I think was time.  Just the time to look for someone to do things, or the time to set everything up with them, or bad timing in general, etc.  One friend was too busy to help out at one point, another was off on vacation when I went to ask him.  Each time it would go through my head that I&#8217;ll find someone for it next week, or I&#8217;ll wait until someone was ready.  Well there&#8217;s always one thing or another in the way!</p>
<p>Time dragged on, and it became almost embarrassing for myself because I still didn&#8217;t have the proper site up.  Eventually it got up to 8 months later and I finally said screw it, I&#8217;ll do it myself.  And that&#8217;s exactly what I&#8217;ve been doing for the past 10 days, learning how to code in html, php, css, and wordpress.  I&#8217;m actually extremely happy with the results too.  However, I&#8217;m sure that&#8217;s just inexperienced web-coder Chris talking, and I just don&#8217;t know what the problems are yet.  Whereas someone with say, more than 10 days experience, might see some other problems immediately.  Regardless, I&#8217;m still happy <img src='http://GetOffMyLawnEntertainment.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .  As well it is always a good feeling to &#8216;finish&#8217; a task, so that&#8217;s one more checkmark today.</p>
<p>The ultimate question: should I have done it and was it worth it? No! and sorta.  In comparison, purchasing another theme would&#8217;ve cost me maybe $10-$50? But that wouldn&#8217;t have necessarily displayed things the way I wanted.  Pay to have one specifically made &#8211; I think $1000-$1500 were a couple of the numbers I saw.  I wasn&#8217;t really prepared to pay $1500 for things though because 1. that&#8217;s a decent amount of money for an indie starting out on web design, 2. I already had the majority of the layout and art planned and done, and I didn&#8217;t think it was more than $500, which I would&#8217;ve happily paid.  Instead, I spent the last week+ (40-60 hours maybe?) learning things and coding it myself. I&#8217;m cheap labour!  From a business standpoint, web development is not a core competency and the time spent on it was not worth it, when the work could&#8217;ve been purchased instead.</p>
<p>Now the good side of all of this is that I&#8217;m now familiar with the code for the website, and if there&#8217;s any other small quick changes I can likely pop in there and figure out what to do. Oh and I&#8217;m not down $1500, just time.  Should I be spending my time in the future making those changes, even after I just said I shouldn&#8217;t have this time? I think the answer is simple, I&#8217;m a one man team at this point, and when you&#8217;re bootstrapping a new business you have to wear a lot of hats.  Well today I made my own hat and I&#8217;ll be able to fix it up to look and fit just how I want in the future.  So I feel good, and that&#8217;s all that matters at the end of today.</p>
<p>Hope you like the new site design.  If there are any problems or suggestions please shoot me a comment,  thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://GetOffMyLawnEntertainment.com/blog/2011/08/21/new-site-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sem_init: &#8216;Function Not Implemented&#8217;</title>
		<link>http://GetOffMyLawnEntertainment.com/blog/2011/06/27/sem_init-function-not-implemented/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sem_init-function-not-implemented</link>
		<comments>http://GetOffMyLawnEntertainment.com/blog/2011/06/27/sem_init-function-not-implemented/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 07:31:11 +0000</pubDate>
		<dc:creator>Chris Regnier</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://GetOffMyLawnEntertainment.com/blog/?p=83</guid>
		<description><![CDATA[I&#8217;ve been doing some thread related code lately and just came across a problem. I&#8217;m using a semaphore for a producer/consumer solution around a shared resource, the build thread to be exact. So multiple producers are wanting to flag that a build needs to be done, but there&#8217;s only one consumer (the actual build thread). [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing some thread related code lately and just came across a problem.  I&#8217;m using a semaphore for a producer/consumer solution around a shared resource, the build thread to be exact.  So multiple producers are wanting to flag that a build needs to be done, but there&#8217;s only one consumer (the actual build thread).</p>
<p>Finished up all the code and then hit play only to find that my build thread ran continuously and never waited.  In fact it would run without a call to build!  After adding in some checks on return statements I find out that sem_init always fails when trying to create my semaphore: &#8220;Function Not Implemented.&#8221;</p>
<p>Turns out Apple decided not to implement unnamed semaphores <img src='http://GetOffMyLawnEntertainment.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Instead you&#8217;re supposed to use named semaphores.  Well I&#8217;m not a fan!  Named semaphores are available to other processes too.  That means that two apps can both open the same named semaphore and interact (note: I haven&#8217;t actually tested if apps can &#8216;actually&#8217; cross boundaries on iOS, but they can on other systems and portability is important for the engine).  And since this is in generic engine code, I can&#8217;t just pick a really unique name cause it would clash between two or more games based on the same engine.</p>
<p>As the CEO of Yahoo recently stated, &#8220;<a title="Downer" href="http://techcrunch.com/2011/06/24/yahoo-shareholder-bartz/" target="_blank">that was certainly a downer</a>.&#8221;  Guess I&#8217;m going to have to come up with my own solution now.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://GetOffMyLawnEntertainment.com/blog/2011/06/27/sem_init-function-not-implemented/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My View on Views</title>
		<link>http://GetOffMyLawnEntertainment.com/blog/2011/06/17/my-view-on-views/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=my-view-on-views</link>
		<comments>http://GetOffMyLawnEntertainment.com/blog/2011/06/17/my-view-on-views/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 04:00:52 +0000</pubDate>
		<dc:creator>Chris Regnier</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://GetOffMyLawnEntertainment.com/blog/?p=72</guid>
		<description><![CDATA[I was going over some GUI related code the other day and saw something I figured I could share with the world. Don&#8217;t design your views through inheritance. Design them through components instead. Not that this is GUI specific, but I tend to see the same problem again and again when people think about designing [...]]]></description>
			<content:encoded><![CDATA[<p>I was going over some GUI related code the other day and saw something I figured I could share with the world.  Don&#8217;t design your views through inheritance.  Design them through components instead.  Not that this is GUI specific, but I tend to see the same problem again and again when people think about designing GUI related code.<br />
<span id="more-72"></span></p>
<p>The code usually looks something like this</p>
<p><code><br />
class Foo {<br />
...<br />
&nbsp;&nbsp;virtual void setup() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;view.set(createBunchOfWidgetsLookAndFeel());<br />
&nbsp;&nbsp;}</code></p>
<p><code><br />
&nbsp;&nbsp;Container createABunchOfWidgetsLookAndFeel() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;Container c = createContainer();<br />
&nbsp;&nbsp;&nbsp;&nbsp;c.add(new Button("OK"));<br />
&nbsp;&nbsp;&nbsp;&nbsp;c.add(new Button("Cancel"));<br />
&nbsp;&nbsp;&nbsp;&nbsp;c.add(new Text("hi"));<br />
&nbsp;&nbsp;&nbsp;&nbsp;return c;<br />
&nbsp;&nbsp;}<br />
...<br />
};<br />
</code><br />
&nbsp;<br />
<code>class SubFoo : public Foo {<br />
...<br />
&nbsp;&nbsp;void setup() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;Container c = createABunchOfWidgetsLookAndFeel();<br />
&nbsp;&nbsp;&nbsp;&nbsp;c.add(new OtherWidget());<br />
&nbsp;&nbsp;&nbsp;&nbsp;view.set(c );<br />
&nbsp;&nbsp;}<br />
...<br />
};</code></p>
<p>Nothing really looks wrong here, and in fact you&#8217;re reusing code which is good right? Nope sorry you lose! You&#8217;ve just created a set of views which depend on each other and are now a pain to try to customize.</p>
<p>Let&#8217;s work through this and go a bit deeper first so that we really understand the problem.  You&#8217;ve now got two separate views and you&#8217;re asked to change only one of them.  In particular let&#8217;s add a new &#8220;Donate&#8221; button in SubFoo in between the OK and Cancel.  At this point most people will create a virtual in Foo called getOtherButton().  The new method returns null in Foo, and the new Button in SubFoo, and then if not null, it adds the button into the middle of our container.  That&#8217;s kind of an odd bit of knowledge Foo now has about its children.  I&#8217;m also going to claim that it&#8217;s much harder to maintain the two views.  It&#8217;s harder because now when you change one, you have to think about the effects in the other.  In fact, before you change one, you should probably understand what the effects are for both.</p>
<p>I think it&#8217;s our perception of a View and how we&#8217;re using it here that is the real problem, and that&#8217;s probably why I typically relate it to GUI design.  A View is a set of components that we can see and often a View is really just a component itself, but I ask you to think of a View and a set of components as slightly different.  A set of components is just that, a set of components arranged together and any one of those components is swappable with another.  Where as the View is that top level component that holds everything and you don&#8217;t usually swap between views in the same way as components.  I think most people usually consider the View in this scenario as the Controller as well.</p>
<p>So what does it actually mean to subclass a View?  Can you really think of a View that should change polymorphically?  Is it really the View that should be changing polymorphically or is it one of the components within the View?  If it&#8217;s one of the components within, then yes I can definitely understand wanting to reuse code to do something that&#8217;s very similar.  And in fact we&#8217;re all taught that we should reuse code whenever possible.  Well in this case it&#8217;s bad… or at least there&#8217;s a better place to reuse the code.</p>
<p>Look at what you&#8217;re trying to do.  You&#8217;re trying to create two separate views with a very similar sets of components.  So why not create a new MegaComponent that is the similar set of components?  Then you can create a MegaSubComponent that fills in the new Button in the middle, and each View creates the component it wants.  Yes, we&#8217;ve really only moved the code reuse to another spot, but now each of our views are separate, just like how we normally think about them from a high level.  The views are now being created through reusable components, you just happened to have created a new tree of components to use.</p>
<p>No the code isn&#8217;t very different between the two cases, but I really want to stress that there is a huge difference in the design at this point.  And a huge difference in how things will get reused later on.  You can now reuse that bigger component in many different scenarios without pulling in some of the other code that might be related to the View.  People will also  be able to quickly jump into code based on the View they see and trace through things from a solid starting point, rather than having to know the intricacies of everything all up front.</p>
<p>In most cases subclassing Views in order to inherit code means you&#8217;re creating hard to maintain dependencies.  Instead, code should be pulled out to a helper class or separate component etc. in order to allow the same reuse.  Remember design by inheritance is BAD! Design by components is GOOD!</p>
]]></content:encoded>
			<wfw:commentRss>http://GetOffMyLawnEntertainment.com/blog/2011/06/17/my-view-on-views/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clipped Wings</title>
		<link>http://GetOffMyLawnEntertainment.com/blog/2011/05/29/clipped-wings/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clipped-wings</link>
		<comments>http://GetOffMyLawnEntertainment.com/blog/2011/05/29/clipped-wings/#comments</comments>
		<pubDate>Mon, 30 May 2011 02:12:20 +0000</pubDate>
		<dc:creator>Chris Regnier</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://GetOffMyLawnEntertainment.com/blog/?p=68</guid>
		<description><![CDATA[Well it looks like Angry Birds has gotten their wings clipped and been bumped from #1 for a couple days straight now. The culprit is The Heist. I haven&#8217;t actually played it, so this is not a review or anything, although I really like their startup video (I was totally waiting for Jack Bauer to [...]]]></description>
			<content:encoded><![CDATA[<p>Well it looks like Angry Birds has gotten their wings clipped and been bumped from #1 for a couple days straight now.  The culprit is <a title="The Heist" href="http://macheist.com/theheist" target="_blank">The Heist</a>.  I haven&#8217;t actually played it, so this is not a review or anything, although I really like their startup video (I was totally waiting for Jack Bauer to show up).  I&#8217;m actually more impressed with how fast it&#8217;s gotten to #1.<br />
<span id="more-68"></span></p>
<p><a title="TechCrunch" href="http://techcrunch.com/2011/05/27/the-heist-sales/" target="_blank">TechCrunch</a> has a lot more details about things than I&#8217;ll go into, but apparently they did a very impressive (and now lucrative) marketing campaign within their own apps.  Impressive enough to muster up 25k+ downloads the first day and a phenomenal 89k+ downloads for day number two.  That&#8217;s a nice chunk of change for a $0.99 app in the first couple of days.</p>
<p>It&#8217;s typical for the sales to drop significantly after the first couple of days, but once you hit that level who cares!  You&#8217;ve already made your money back (at least it looks like they probably have from the screenshots and description of gameplay I&#8217;ve seen).  But I have a feeling that they&#8217;re not going to disappear quite so quickly.  If anything I&#8217;m sure the volley of news posts that will be coming about its success will keep the game up and fighting for top spots.</p>
<p>One thing I didn&#8217;t notice mention of in the TechCrunch article was the fact that I think they&#8217;re giving away a couple of new iPad2&#8242;s for the next few days.  I&#8217;ve thought about this before as well and I wonder how much it has to attribute to the success, if at all.  Who wouldn&#8217;t want to spend a buck and get the chance to win something shiny and new, especially if all you had to do was solve a puzzle first?  I imagine if you can get the word out about the contest you could easily be able to get 1000 extra sales just for the contest.  You&#8217;re easily profiting for this and mustering up a bunch of extra exposure for your app.  Sounds like a good deal to me.  I&#8217;d like to test this out in the future with some of our games, so I&#8217;ll be sure to let you know if and when the chance arises.</p>
]]></content:encoded>
			<wfw:commentRss>http://GetOffMyLawnEntertainment.com/blog/2011/05/29/clipped-wings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

