<?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>To Game or not to Game &#187; Linux</title>
	<atom:link href="http://www.aserrano.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aserrano.com</link>
	<description>Hablando de juegos y de todo un poco</description>
	<lastBuildDate>Mon, 16 Jan 2012 09:05:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Ogre3D 1.7: como instalarlo</title>
		<link>http://www.aserrano.com/2009/11/29/ogre3d-1-7-como-instalarlo/</link>
		<comments>http://www.aserrano.com/2009/11/29/ogre3d-1-7-como-instalarlo/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 08:26:26 +0000</pubDate>
		<dc:creator>Antonio Serrano</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Desarrollo]]></category>
		<category><![CDATA[Informática]]></category>
		<category><![CDATA[Motores 3D]]></category>
		<category><![CDATA[Ogre]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ogre3d]]></category>

		<guid isPermaLink="false">http://www.aserrano.com/?p=260</guid>
		<description><![CDATA[Lo primero que hay mencionar es que a día de creación de este artículo la versión 1.7 todavía está en fase de desarrollo y por tanto puede ser inestable o sufrir cambios o modificaciones. Vamos a utilizar Ubuntu Linux 9.10 pero para cualquier sistema operativo los pasos serían similares. Antes que nada habría que instalar [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Lo primero que hay mencionar es que a día de creación de este artículo la versión 1.7 todavía está en fase de desarrollo y por tanto puede ser inestable o sufrir cambios o modificaciones.</p>
<p>Vamos a utilizar Ubuntu Linux 9.10 pero para cualquier sistema operativo los pasos serían similares.</p>
<p>Antes que nada habría que instalar todas las dependencias que nos van a hacer falta:</p>
<p><strong>cmake</strong>&#8211;> como novedad ogre 1.7 usa ahora cmake para su compilación<br />
<strong>libfreeimage3</strong>&#8211;> librería gratuita para acceder a ficheros gráficos como jpeg o png<br />
<strong>libboost</strong> &#8211;> son opcionales, aunque yo os recomiendo su uso<br />
<strong>libzzip-dev</strong>&#8211;> librería para acceder a ficheros zip. Fundamental si queremos compilar los ejemplos.<br />
<strong>subversion</strong>&#8211;> cliente subversion para poder bajar el código fuente de los repositorios ogre3d</p>
<p>Instalamos todas las dependencias con nuestro gestor de paquetes habitual, aptitude, synaptic, apt-get, etc. y bajamos el código fuente:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> directorio_donde_queramos_los_fuentes
<span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">co</span> https:<span style="color: #000000; font-weight: bold;">//</span>svn.ogre3d.org<span style="color: #000000; font-weight: bold;">/</span>svnroot<span style="color: #000000; font-weight: bold;">/</span>ogre<span style="color: #000000; font-weight: bold;">/</span>trunk ogre</pre></div></div>

<p>Una vez descargado tenemos dos opciones.</p>
<p>La del impaciente. Vamos al directorio ogre y tecleamos lo siguiente:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">cmake <span style="color: #660033;">-G</span> <span style="color: #ff0000;">&quot;Unix Makefiles&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #660033;">-j2</span></pre></div></div>

<p>El primer comando nos genera los ficheros makefile y el segundo los compila. Recuerda que el número -j2 indica los procesos que quieres usar. Si tienes un dual core. Puedes poner 3 ó 4 por ejemplo.</p>
<p>La siguiente opción sería usar cmake-gui.<br />
Una vez que cargue el frontal cmake, en la parte superior indicaremos el directorio donde tenemos el código fuente.<br />
En la siguiente caja indicaremos donde queremos compilarlo.<br />
Podéis poner el mismo trayecto.</p>
<p>Pinchamos sobre configure y luego sobre generate y ya podríamos compilar con &#8220;make&#8221;</p>
<p><a href="http://www.aserrano.com/2009/11/29/ogre3d-1-7-como-instalarlo/pantallazo-cmake-2-6-patch-4/" rel="attachment wp-att-268"><img src="http://www.aserrano.com/wp-content/uploads/2009/11/Pantallazo-CMake-2.6-patch-4-300x235.png" alt="CMake Gui 2.6" title="CMake Gui 2.6" width="300" height="235" class="alignnone size-medium wp-image-268" /></a></p>
<p>Las opciones del diálogo tienen su propia ayuda, pero como más destacable vamos a mencionar CMAKE_BUILD_TYPE, en la que podríamos usar los siguientes parámetros:</p>
<p>Debug  &#8211;>  Compila Ogre3D en modo depuración<br />
Release &#8211;> Compilación para ejecución óptima<br />
RelWithDebInfo  &#8211;> Compilación para ejecución óptima pero con información de depuración incluida.<br />
MinSizeRel  &#8211;> Ejecución óptima pero de mínimo tamaño.</p>
<div class="shr-publisher-260"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F11%2F29%2Fogre3d-1-7-como-instalarlo%2F' data-shr_title='Ogre3D+1.7%3A+como+instalarlo'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F11%2F29%2Fogre3d-1-7-como-instalarlo%2F' data-shr_title='Ogre3D+1.7%3A+como+instalarlo'></a><a class='shareaholic-tweetbutton' data-shr_count='horizontal' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F11%2F29%2Fogre3d-1-7-como-instalarlo%2F' data-shr_title='Ogre3D+1.7%3A+como+instalarlo'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.aserrano.com/2009/11/29/ogre3d-1-7-como-instalarlo/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OpenOffice: alcanza los 100,000,000 de descargas</title>
		<link>http://www.aserrano.com/2009/11/01/openoffice-alcanza-los-100000000-de-descargas/</link>
		<comments>http://www.aserrano.com/2009/11/01/openoffice-alcanza-los-100000000-de-descargas/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 08:03:19 +0000</pubDate>
		<dc:creator>Antonio Serrano</dc:creator>
				<category><![CDATA[Informática]]></category>
		<category><![CDATA[Software Libre]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[openoffice]]></category>

		<guid isPermaLink="false">http://www.aserrano.com/?p=233</guid>
		<description><![CDATA[Pues sí, tal y como suena. OpenOffice alcanzó el día 28 de Octubre semejante cifra de descargas. Me alegro por ellos y por todo el mundo del software libre.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Pues sí, tal y como suena. </p>
<p><a href="http://www.openoffice.org" target="_blank">OpenOffice</a> alcanzó el día 28 de Octubre semejante cifra de descargas.</p>
<p>Me alegro por ellos y por todo el mundo del software libre.</p>
<div class="shr-publisher-233"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F11%2F01%2Fopenoffice-alcanza-los-100000000-de-descargas%2F' data-shr_title='OpenOffice%3A+alcanza+los+100%2C000%2C000+de+descargas'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F11%2F01%2Fopenoffice-alcanza-los-100000000-de-descargas%2F' data-shr_title='OpenOffice%3A+alcanza+los+100%2C000%2C000+de+descargas'></a><a class='shareaholic-tweetbutton' data-shr_count='horizontal' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F11%2F01%2Fopenoffice-alcanza-los-100000000-de-descargas%2F' data-shr_title='OpenOffice%3A+alcanza+los+100%2C000%2C000+de+descargas'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.aserrano.com/2009/11/01/openoffice-alcanza-los-100000000-de-descargas/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tutorial Ogre3D: Creación de un proyecto paso por paso (III)</title>
		<link>http://www.aserrano.com/2009/10/28/ogre3d-creacion-de-un-proyecto-paso-por-paso-iii/</link>
		<comments>http://www.aserrano.com/2009/10/28/ogre3d-creacion-de-un-proyecto-paso-por-paso-iii/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 20:32:20 +0000</pubDate>
		<dc:creator>Antonio Serrano</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Juegos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Motores 3D]]></category>
		<category><![CDATA[Ogre]]></category>
		<category><![CDATA[Desarrollo]]></category>
		<category><![CDATA[engine 3d]]></category>
		<category><![CDATA[ogre3d]]></category>

		<guid isPermaLink="false">http://www.aserrano.com/?p=183</guid>
		<description><![CDATA[Una vez inicializado Ogre Procederemos a la creación de la ventana y del SceneManager. Recordemos que el gestor del escenario es un plugin especializado según el tipo de escenario y pueden ser de los siguientes tipos: ST_GENERIC: Escenarios de propósito general ST_EXTERIOR_CLOSE: Escenarios de exteriores de visibilidad media ST_EXTERIOR_FAR: Practicamente no usado ST_EXTERIOR_REAL_FAR: Escenarios de [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Una vez inicializado Ogre Procederemos a la creación de la ventana y del SceneManager.</p>
<p>Recordemos que el gestor del escenario es un plugin especializado según el tipo de escenario y pueden ser de los siguientes tipos:</p>
<ul>
<li>ST_GENERIC: Escenarios de propósito general</li>
<li>ST_EXTERIOR_CLOSE:  Escenarios de exteriores de visibilidad media</li>
<li>ST_EXTERIOR_FAR: Practicamente no usado</li>
<li>ST_EXTERIOR_REAL_FAR: Escenarios de paisajes con grandes terrenos</li>
<li>ST_INTERIOR: Escenarios de interior, por ejemplo, edificios.</li>
</ul>
<p>Veamos ya como crearlo:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">mRoot<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>initialise<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">true</span>, <span style="color: #FF0000;">&quot;Mi Ventana&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>	
&nbsp;
RenderWindow<span style="color: #000040;">*</span> window <span style="color: #000080;">=</span> mRoot<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getAutoCreatedWindow<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
SceneManager <span style="color: #000040;">*</span>sceneMgr <span style="color: #000080;">=</span> mRoot<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>createSceneManager<span style="color: #008000;">&#40;</span>ST_GENERIC<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>A continuación crearemos la cámara que nos permitirá ver el escenario desde el ángulo y con la profundidad y distancia que queramos:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">Camera<span style="color: #000040;">*</span> cam <span style="color: #000080;">=</span> sceneMgr<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>createCamera<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;Camara&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
cam<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setNearClipDistance<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">5</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
cam<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setFarClipDistance<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">1000</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
cam<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setAspectRatio<span style="color: #008000;">&#40;</span>Real<span style="color: #008000;">&#40;</span><span style="color:#800080;">1.333333</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
Viewport<span style="color: #000040;">*</span> vp <span style="color: #000080;">=</span> window<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>addViewport<span style="color: #008000;">&#40;</span>cam,<span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
vp<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setBackgroundColour<span style="color: #008000;">&#40;</span>ColourValue<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">1</span>, <span style="color: #0000dd;">0</span>, <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>Hemos definido para la cámara los valores de distincia mínima y máxima y su relación entre el tamaño x e y de la ventana que hemos creado, 800/600.</p>
<p>Además hemos añadido un viewport a la cámara con fondo de color rojo. Podremos tener tantos como queramos pero recuerda que se ordenan mediante el parámetro z-order y sólo puede existir uno por cada valor de z-order. Los viewport definen los rectángulos donde se visualizarán el rendererizado de la cámara.</p>
<p>Crearíamos ahora el listener que se encargará del renderizado de los frames:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">MyFrameListener listener<span style="color: #008000;">&#40;</span>window<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
mRoot<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>addFrameListener<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>listener<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
mRoot<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>startRendering<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>Es importante crear el listener antes de comenzar el renderizado de la aplicación o se nos colgará.</p>
<p><a href="http://www.aserrano.com/2009/10/26/ogre3d-creacion-de-un-proyecto-paso-por-paso-ii/">Ogre3D Paso a paso II</a><br />
<a href="http://www.aserrano.com/2009/10/31/tutorial-ogre3d-creacion-de-un-proyecto-paso-por-paso-y-iv/">Ogre3D Paso a paso (y IV)</a></p>
<div class="shr-publisher-183"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F28%2Fogre3d-creacion-de-un-proyecto-paso-por-paso-iii%2F' data-shr_title='Tutorial+Ogre3D%3A+Creaci%C3%B3n+de+un+proyecto+paso+por+paso+%28III%29'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F28%2Fogre3d-creacion-de-un-proyecto-paso-por-paso-iii%2F' data-shr_title='Tutorial+Ogre3D%3A+Creaci%C3%B3n+de+un+proyecto+paso+por+paso+%28III%29'></a><a class='shareaholic-tweetbutton' data-shr_count='horizontal' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F28%2Fogre3d-creacion-de-un-proyecto-paso-por-paso-iii%2F' data-shr_title='Tutorial+Ogre3D%3A+Creaci%C3%B3n+de+un+proyecto+paso+por+paso+%28III%29'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.aserrano.com/2009/10/28/ogre3d-creacion-de-un-proyecto-paso-por-paso-iii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu 9.10 el día 29</title>
		<link>http://www.aserrano.com/2009/10/27/ubuntu-9-10-el-dia-29/</link>
		<comments>http://www.aserrano.com/2009/10/27/ubuntu-9-10-el-dia-29/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 12:11:30 +0000</pubDate>
		<dc:creator>Antonio Serrano</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.aserrano.com/2009/10/27/ubuntu-9-10-el-dia-29/</guid>
		<description><![CDATA[Ya está por llegar ubuntu 9.10]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Ya está por llegar ubuntu 9.10<br />
<script type="text/javascript" src="http://www.ubuntu.com/files/countdown/display.js"></script></p>
<div class="shr-publisher-182"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F27%2Fubuntu-9-10-el-dia-29%2F' data-shr_title='Ubuntu+9.10+el+d%C3%ADa+29'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F27%2Fubuntu-9-10-el-dia-29%2F' data-shr_title='Ubuntu+9.10+el+d%C3%ADa+29'></a><a class='shareaholic-tweetbutton' data-shr_count='horizontal' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F27%2Fubuntu-9-10-el-dia-29%2F' data-shr_title='Ubuntu+9.10+el+d%C3%ADa+29'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.aserrano.com/2009/10/27/ubuntu-9-10-el-dia-29/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial Ogre3D: Creación de un proyecto paso por paso (II)</title>
		<link>http://www.aserrano.com/2009/10/26/ogre3d-creacion-de-un-proyecto-paso-por-paso-ii/</link>
		<comments>http://www.aserrano.com/2009/10/26/ogre3d-creacion-de-un-proyecto-paso-por-paso-ii/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 19:50:46 +0000</pubDate>
		<dc:creator>Antonio Serrano</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Desarrollo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Motores 3D]]></category>
		<category><![CDATA[Ogre]]></category>
		<category><![CDATA[engine 3d]]></category>

		<guid isPermaLink="false">http://www.aserrano.com/?p=174</guid>
		<description><![CDATA[El primero de los tres parámetros que toma la función es el fichero de configuración de plugins. Dicho fichero contiene los plugins que el engine 3D Ogre va a cargar en tiempo de ejecución por lo que mi recomendación es la de cargar sólo los que el proyecto vaya a usar. Veamos el fichero de [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>El primero de los tres parámetros que toma la función es el fichero de configuración de plugins.</p>
<p>Dicho fichero contiene los plugins que el engine 3D Ogre va a cargar en tiempo de ejecución por lo que mi recomendación es la de cargar sólo los que el proyecto vaya a usar.</p>
<p>Veamos el fichero de los ejemplos que vienen con ogre:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;"># Defines plugins to load</span>
&nbsp;
<span style="color: #339900;"># Define plugin folder</span>
PluginFolder<span style="color: #000080;">=</span>..<span style="color: #000040;">/</span>lib
&nbsp;
<span style="color: #339900;"># Define plugins</span>
<span style="color: #339900;"># Plugin=RenderSystem_Direct3D9</span>
<span style="color: #339900;"># Plugin=RenderSystem_Direct3D10</span>
 Plugin<span style="color: #000080;">=</span>RenderSystem_GL
 Plugin<span style="color: #000080;">=</span>Plugin_ParticleFX
 Plugin<span style="color: #000080;">=</span>Plugin_BSPSceneManager
 Plugin<span style="color: #000080;">=</span>Plugin_CgProgramManager
 Plugin<span style="color: #000080;">=</span>Plugin_PCZSceneManager
 Plugin<span style="color: #000080;">=</span>Plugin_OctreeZone
 Plugin<span style="color: #000080;">=</span>Plugin_OctreeSceneManager</pre></div></div>

<p>Vemos que carga el plugin que gestiona el renderizado OpenGL, el gestor de partículas, y 5 diferentes &#8220;Scene manager&#8221;, que serán los encargados de visualizar los escenarios y además cada uno está especializado en una forma de hacerlo diferente.</p>
<p>Además la línea pluginfolder indica de que directorios cargará dichos plugins que en este caso serán de la forma de una librería dinámica linux &#8220;.so&#8221;.</p>
<p>El tercer parámetro es del fichero de log de ogre muy útil para gestionar los posibles fallos de la aplicación que estamos desarrollando.</p>
<p>Si quisiesemos generar nuestro fichero de log sin usar este parámetro podríamos usar el siguiente código incluso antes de la inicialización de Ogre3D:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">LogManager<span style="color: #000040;">*</span> logmanager <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> LogManager<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
Log<span style="color: #000040;">*</span> <span style="color: #0000dd;">log</span> <span style="color: #000080;">=</span> LogManager<span style="color: #008080;">::</span><span style="color: #007788;">getSingleton</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>.<span style="color: #007788;">createLog</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;logogre.log&quot;</span>,<span style="color: #0000ff;">true</span>,tru,<span style="color: #0000ff;">false</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
Root<span style="color: #000040;">*</span> mRoot<span style="color: #000080;">=</span><span style="color: #0000dd;">new</span> Root<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;plugins.cfg&quot;</span>,<span style="color: #FF0000;">&quot;ogre.cfg&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>&#8230;<a href="http://www.aserrano.com/2009/10/25/ogre3d-creacion-de-un-proyecto-paso-por-paso/">Ogre3D Paso a paso I</a>&#8230;<br />
&#8230;<a href="http://www.aserrano.com/2009/10/28/ogre3d-creacion-de-un-proyecto-paso-por-paso-iii/">Ogre3D Paso a paso III</a>&#8230;</p>
<div class="shr-publisher-174"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F26%2Fogre3d-creacion-de-un-proyecto-paso-por-paso-ii%2F' data-shr_title='Tutorial+Ogre3D%3A+Creaci%C3%B3n+de+un+proyecto+paso+por+paso+%28II%29'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F26%2Fogre3d-creacion-de-un-proyecto-paso-por-paso-ii%2F' data-shr_title='Tutorial+Ogre3D%3A+Creaci%C3%B3n+de+un+proyecto+paso+por+paso+%28II%29'></a><a class='shareaholic-tweetbutton' data-shr_count='horizontal' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F26%2Fogre3d-creacion-de-un-proyecto-paso-por-paso-ii%2F' data-shr_title='Tutorial+Ogre3D%3A+Creaci%C3%B3n+de+un+proyecto+paso+por+paso+%28II%29'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.aserrano.com/2009/10/26/ogre3d-creacion-de-un-proyecto-paso-por-paso-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial Ogre3D: Creación de un proyecto paso por paso (I)</title>
		<link>http://www.aserrano.com/2009/10/25/ogre3d-creacion-de-un-proyecto-paso-por-paso/</link>
		<comments>http://www.aserrano.com/2009/10/25/ogre3d-creacion-de-un-proyecto-paso-por-paso/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 08:32:06 +0000</pubDate>
		<dc:creator>Antonio Serrano</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Desarrollo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ogre]]></category>
		<category><![CDATA[engine 3d]]></category>

		<guid isPermaLink="false">http://www.aserrano.net/2009/10/25/ogre3d-creacion-de-un-proyecto-paso-por-paso/</guid>
		<description><![CDATA[<p>Aunque CodeBlocks tiene un template para crear tu propio proyecto, lo que pretendemos es ver de forma detallada y comprender un poco mejor como hacerlo. ... Ambas las he bajado y compilado para poder usarlas, pero valdrían perfectamente el SDK, para el ogre, y el codeblocks que viene integrado en ubuntu.</p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Para la creación de un proyecto <a href="http://www.ogre3d.org" target="_blank">Ogre3D</a> paso a paso vamos a usar Ubuntu y Codeblocks.</p>
<p>Aunque CodeBlocks tiene un template para crear tu propio proyecto, lo que pretendemos es ver de forma detallada y comprender un poco mejor como hacerlo.</p>
<p>Yo en mi caso he usado una versión de desarrollo de Ogre3D y una versión de desarrollo también de Codeblocks.</p>
<p>Ambas las he bajado y compilado para poder usarlas, pero valdrían perfectamente el SDK, para el ogre, y el codeblocks que viene integrado en ubuntu.</p>
<p>Desde codeblocks creamos un nuevo proyecto de consola, si queréis el clásico Hello World, eliminamos el cout e incluimos las cabeceras de Ogre y su espacio de nombres.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#include &lt;Ogre.h&gt;;</span>
<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> Ogre<span style="color: #008080;">;</span></pre></div></div>

<p>El primer paso en cualquier proyecto Ogre es la inicialización de las librerías en la forma</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">&nbsp;
Root<span style="color: #000040;">*</span> mRoot<span style="color: #000080;">=</span><span style="color: #0000dd;">new</span> Root<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
Root<span style="color: #000040;">*</span> mRoot<span style="color: #000080;">=</span><span style="color: #0000dd;">new</span> Root<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;ogre.cfg&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
Root<span style="color: #000040;">*</span> mRoot<span style="color: #000080;">=</span><span style="color: #0000dd;">new</span> Root<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;ogre.cfg&quot;</span>,<span style="color: #FF0000;">&quot;plugins.cfg&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
Root<span style="color: #000040;">*</span> mRoot<span style="color: #000080;">=</span><span style="color: #0000dd;">new</span> Root<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;ogre.cfg&quot;</span>,<span style="color: #FF0000;">&quot;plugins.cfg&quot;</span>,<span style="color: #FF0000;">&quot;ogre.log&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
Root<span style="color: #000040;">*</span> mRoot<span style="color: #000080;">=</span><span style="color: #0000dd;">new</span> Root<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;&quot;</span>,<span style="color: #FF0000;">&quot;&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>Cualquiera de las anteriores opciones serían perfectamente válidas, aunque yo en mi caso prefiero usar la de tres parámetros para tener una completa perspectiva de cuales son mis ficheros de configuración en uso.</p>
<p>Veamos ahora el contenido del fichero ogre.cfg, que en mi caso lo tengo de la forma siguiente</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">Render System<span style="color: #000080;">=</span>OpenGL Rendering Subsystem
&nbsp;
<span style="color: #008000;">&#91;</span>OpenGL Rendering Subsystem<span style="color: #008000;">&#93;</span>
Display Frequency<span style="color: #000080;">=</span><span style="color: #0000dd;">50</span> MHz
FSAA<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span>
Full Screen<span style="color: #000080;">=</span>No
RTT Preferred Mode<span style="color: #000080;">=</span>FBO
VSync<span style="color: #000080;">=</span>No
Video Mode<span style="color: #000080;">=</span><span style="color: #0000dd;">1024</span> x  <span style="color: #0000dd;">768</span>
sRGB Gamma Conversion<span style="color: #000080;">=</span>No</pre></div></div>

<p>Esta configuración siempre la podemos sobreescribir con una llamada al diálogo de configuración de ogre:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">&nbsp;
<span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">!</span>mRoot<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>restoreConfig<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  mRoot<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>showConfigDialog<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  mRoot<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>saveConfig<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p><a href="http://www.aserrano.com/2009/10/26/ogre3d-creacion-de-un-proyecto-paso-por-paso-ii/">Ogre3D Paso a paso II</a></p>
<div class="shr-publisher-155"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F25%2Fogre3d-creacion-de-un-proyecto-paso-por-paso%2F' data-shr_title='Tutorial+Ogre3D%3A+Creaci%C3%B3n+de+un+proyecto+paso+por+paso+%28I%29'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F25%2Fogre3d-creacion-de-un-proyecto-paso-por-paso%2F' data-shr_title='Tutorial+Ogre3D%3A+Creaci%C3%B3n+de+un+proyecto+paso+por+paso+%28I%29'></a><a class='shareaholic-tweetbutton' data-shr_count='horizontal' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F25%2Fogre3d-creacion-de-un-proyecto-paso-por-paso%2F' data-shr_title='Tutorial+Ogre3D%3A+Creaci%C3%B3n+de+un+proyecto+paso+por+paso+%28I%29'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.aserrano.com/2009/10/25/ogre3d-creacion-de-un-proyecto-paso-por-paso/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lua: breve tutorial de integración con C++</title>
		<link>http://www.aserrano.com/2009/10/22/lua-breve-tutorial-de-integracion-con-c/</link>
		<comments>http://www.aserrano.com/2009/10/22/lua-breve-tutorial-de-integracion-con-c/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 20:18:23 +0000</pubDate>
		<dc:creator>Antonio Serrano</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Desarrollo]]></category>
		<category><![CDATA[Juegos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[luabind]]></category>

		<guid isPermaLink="false">http://www.aserrano.net/?p=117</guid>
		<description><![CDATA[Para poder acelerar y mejorar los tiempos de desarrollo de tu aplicación C++ tienes la posibilidad de integrar algún lenguaje de script en la misma. Vamos por tanto a ver un breve tutorial de integración Lua, un lenguaje de script con una sintáxis bastante similar a C, y C++. El método más directo es usar [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Para poder acelerar y mejorar los tiempos de desarrollo de tu aplicación C++ tienes la posibilidad de integrar algún lenguaje de script en la misma.</p>
<p>Vamos por tanto a ver un breve tutorial de integración Lua, un lenguaje de script con una sintáxis bastante similar a C, y C++.</p>
<p>El método más directo es usar luabind, una librería que nos va a permitir dicha integración de una manera rápida y sin grandes dolores de cabeza.</p>
<p>Comentar que el tutorial ha sido desarrollado en Ubuntu 9.04. Ubuntu 9.04 viene con el paquete luabind versión 0.7 que es incompatible con lua 5.1, por tanto, deberemos descargar la última versión que a día de hoy es la 0.8.1 y compilarla.</p>
<p>Bajamos la última versión de luabind de <a title="Luabind en sourceforge" href="http://sourceforge.net/projects/luabind/" target="_blank">aquí</a>.</p>
<p>Luabind necesita de las librerías boost. Procedemos a instalarla:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libboost1.35-dev
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> boost-build</pre></div></div>

<p>Si no estuviera instalada la herramienta de compilación bjam:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> bjam</pre></div></div>

<p>Descomprimimos el paquete de luabind y lo compilamos:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> luabind-0.8.1
&nbsp;
bjam
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> bjam <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Luabind nos permite integrar en lua, casi de de forma integra cualquier elemento del lenguaje C++: clases, funciones, operadores, variables, etc.</p>
<p>Veamos como llamar una función desde un script LUA.</p>
<p>Incluimos las cabeceras de lua de la siguiente forma y definimos la función que formará parte de la librería:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">extern</span> <span style="color: #FF0000;">&quot;C&quot;</span> <span style="color: #008000;">&#123;</span>
&nbsp;
<span style="color: #339900;">#include &lt;lua5.1/lua.h&gt;</span>
&nbsp;
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #339900;">#include &lt;stdio.h&gt;</span>
&nbsp;
<span style="color: #339900;">#include &lt;luabind/luabind.hpp&gt;</span>
&nbsp;
<span style="color: #0000ff;">void</span> sayHelloWorld<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
&nbsp;
<span style="color: #008000;">&#123;</span>
&nbsp;
<span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;Hello World<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Añadimos también la función de inicialización de la librería:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">extern</span> <span style="color: #FF0000;">&quot;C&quot;</span> <span style="color: #0000ff;">int</span> init<span style="color: #008000;">&#40;</span>lua_State<span style="color: #000040;">*</span> L<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> luabind<span style="color: #008080;">;</span>
&nbsp;
open<span style="color: #008000;">&#40;</span>L<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
module<span style="color: #008000;">&#40;</span>L<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#91;</span>
def<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;sayHelloWorld&quot;</span>, <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span>amp<span style="color: #008080;">;</span>amp<span style="color: #008080;">;</span>amp<span style="color: #008080;">;</span>amp<span style="color: #008080;">;</span>amp<span style="color: #008080;">;</span>sayHelloWorld<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Compilamos la librería:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">gcc</span> -I<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>include -I<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>lua5.1 <span style="color: #660033;">-shared</span> <span style="color: #660033;">-fPIC</span> <span style="color: #660033;">-o</span> sayhello.so sayhello.cpp <span style="color: #660033;">-lluabindd</span> -llua5.1</pre></div></div>

<p>Ya sólo nos quedaría crear un programa en lua para usarlo. Mediante la función &#8220;loadlib&#8221; cargamos la librería y la inicializamos con la función C que hemos creado &#8220;init&#8221;:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">package.<span style="color: #007788;">loadlib</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">'./sayhello.so'</span>,<span style="color: #FF0000;">'init'</span><span style="color: #008000;">&#41;</span>
&nbsp;
sayHelloWorld<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span></pre></div></div>

<p>De forma análoga podríamos definir clases, estructuras, funciones, operadores sobrecargados, etc.</p>
<p>Veamos un ejemplo más complejo que refleja una clase, un operador de suma y una función para obtener el total:</p>

<div class="wp_syntax"><div class="code"><pre class="lua" style="font-family:monospace;">#include <span style="color: #66cc66;">&lt;</span>luabind<span style="color: #66cc66;">/</span>luabind.hpp<span style="color: #66cc66;">&gt;</span>
#include <span style="color: #66cc66;">&lt;</span>luabind<span style="color: #66cc66;">/</span>operator.hpp<span style="color: #66cc66;">&gt;</span>
&nbsp;
class Prueba
<span style="color: #66cc66;">&#123;</span>
int totalPrice<span style="color: #66cc66;">;</span>
public:
&nbsp;
Prueba<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
Prueba<span style="color: #66cc66;">&#40;</span>int nume<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
totalPrice<span style="color: #66cc66;">=</span>nume<span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span>
Prueba operator+<span style="color: #66cc66;">&#40;</span>Prueba op2<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
int getTotal<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #b1b100;">return</span> totalPrice<span style="color: #66cc66;">;</span> <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">;</span>
&nbsp;
Prueba Prueba::operator+<span style="color: #66cc66;">&#40;</span>Prueba op2<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
Prueba temp<span style="color: #66cc66;">;</span>
&nbsp;
temp.totalPrice<span style="color: #66cc66;">=</span>totalPrice+op2.totalPrice<span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #b1b100;">return</span> temp<span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
extern <span style="color: #ff0000;">&quot;C&quot;</span> int init<span style="color: #66cc66;">&#40;</span>lua_State<span style="color: #66cc66;">*</span> L<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
&nbsp;
using namespace luabind<span style="color: #66cc66;">;</span>
&nbsp;
open<span style="color: #66cc66;">&#40;</span>L<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
module<span style="color: #66cc66;">&#40;</span>L<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#91;</span>
class_<span style="color: #66cc66;">&lt;</span>Prueba<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Prueba&quot;</span><span style="color: #66cc66;">&#41;</span>
.def<span style="color: #66cc66;">&#40;</span>constructor<span style="color: #66cc66;">&lt;</span>const int<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
.def<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;getTotal&quot;</span>,<span style="color: #66cc66;">&amp;</span>amp<span style="color: #66cc66;">;</span>amp<span style="color: #66cc66;">;</span>amp<span style="color: #66cc66;">;</span>amp<span style="color: #66cc66;">;</span>amp<span style="color: #66cc66;">;</span>Prueba::getTotal<span style="color: #66cc66;">&#41;</span>
.def<span style="color: #66cc66;">&#40;</span>self + other<span style="color: #66cc66;">&lt;</span>Prueba<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Ya sólo nos queda ejecutarlo con Lua:</p>

<div class="wp_syntax"><div class="code"><pre class="lua" style="font-family:monospace;">Lua 5.1.4  Copyright <span style="color: #66cc66;">&#40;</span>C<span style="color: #66cc66;">&#41;</span> <span style="color: #cc66cc;">1994</span>-<span style="color: #cc66cc;">2008</span> Lua.org, PUC-Rio
package.<span style="color: #b1b100;">loadlib</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;./prueba.so&quot;</span>,<span style="color: #ff0000;">&quot;init&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
a<span style="color: #66cc66;">=</span>Prueba<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">12</span><span style="color: #66cc66;">&#41;</span>
b<span style="color: #66cc66;">=</span>Prueba<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">23</span><span style="color: #66cc66;">&#41;</span>
c<span style="color: #66cc66;">=</span>a+b
<span style="color: #b1b100;">print</span><span style="color: #66cc66;">&#40;</span>c:getTotal<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #cc66cc;">35</span></pre></div></div>

<div class="shr-publisher-117"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F22%2Flua-breve-tutorial-de-integracion-con-c%2F' data-shr_title='Lua%3A+breve+tutorial+de+integraci%C3%B3n+con+C%2B%2B+'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F22%2Flua-breve-tutorial-de-integracion-con-c%2F' data-shr_title='Lua%3A+breve+tutorial+de+integraci%C3%B3n+con+C%2B%2B+'></a><a class='shareaholic-tweetbutton' data-shr_count='horizontal' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F22%2Flua-breve-tutorial-de-integracion-con-c%2F' data-shr_title='Lua%3A+breve+tutorial+de+integraci%C3%B3n+con+C%2B%2B+'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.aserrano.com/2009/10/22/lua-breve-tutorial-de-integracion-con-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux: Libre competencia ya</title>
		<link>http://www.aserrano.com/2009/10/17/linux-libre-competencia-ya/</link>
		<comments>http://www.aserrano.com/2009/10/17/linux-libre-competencia-ya/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 18:58:17 +0000</pubDate>
		<dc:creator>Antonio Serrano</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[sistemas operativos]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.aserrano.net/?p=109</guid>
		<description><![CDATA[Leía hoy un artículo sobre &#8220;¿Por qué fracasan Ubuntu y Linux?&#8220;. En este artículo se insinúa que una posible causa del fracaso de Linux podría ser que le falta un algo especial para triunfar, esa cosa que hace que te fijes en un producto y lo compres. Seamos serios, yo me voy a comprar un [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Leía hoy un artículo sobre &#8220;<a href="http://www.muylinux.com/2009/10/13/%C2%BFpor-que-fracasan-ubuntu-y-linux/" target="_blank">¿Por qué fracasan Ubuntu y Linux?</a>&#8220;.</p>
<p>En este artículo se insinúa que una posible causa del fracaso de Linux podría ser que le falta un algo especial para triunfar, esa cosa que hace que te fijes en un producto y lo compres.</p>
<p>Seamos serios, yo me voy a comprar un coche y al llegar me dice el vendedor que tengo dos modelos de motores por coche, &#8220;ultimamente incluso tres, el híbrido&#8221;, diesel y gasolina.</p>
<p>Acto seguido este señor me explica las ventajas de ambos modelos y opto por gasolina si pienso hacer pocos kilómetro o diesel si pienso hacer muchos, pero tengo una elección y un señor me ha explicado las capacidades de uno y de otro y sus precios.</p>
<p>Pasemos a una tienda de ordenadores, ¿quien te vende un ordenador con linux?, nadie, o casi nadie, no existe campaña de marketing de ciento de millones de dolares a favor de linux, y existe una compañía como microsoft impidiendo que grandes compañías vendan ordenadores con linux preinstalados, tema ya bastante sabido, que microsoft incentiva a los fabricantes, e incluso penaliza, para que instalen su sistema operativo&#8230;.</p>
<p>En el mundo del ordenador personal, el de casa, no la informática empresarial que tan bien conozco, el linux simplemente no existe porque las grandes compañías se han encargado de que desaparezcan.</p>
<p>Linux tiene las mismas capacidades, ya no entro en si es mejor o no, que tienen Windows y tiene Mac OS X y no le falta ningún &#8220;nada&#8221; especial.</p>
<p>Lo único que le falta a Linux es &#8220;LIBRE COMPETENCIA&#8221;. No sé a que espera la unión europea para exigir la libre competencia en el sector de los sistemas operativos. Una vez que haya libre competencia se verá si linux triunfa o no, mientras tanto será la lucha de David contra Goliat. Una lucha desigual, demasiado desigual.</p>
<div class="shr-publisher-109"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F17%2Flinux-libre-competencia-ya%2F' data-shr_title='Linux%3A+Libre+competencia+ya'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F17%2Flinux-libre-competencia-ya%2F' data-shr_title='Linux%3A+Libre+competencia+ya'></a><a class='shareaholic-tweetbutton' data-shr_count='horizontal' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2009%2F10%2F17%2Flinux-libre-competencia-ya%2F' data-shr_title='Linux%3A+Libre+competencia+ya'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.aserrano.com/2009/10/17/linux-libre-competencia-ya/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Motores de juego: Torque</title>
		<link>http://www.aserrano.com/2007/12/16/motores-de-juego-torque/</link>
		<comments>http://www.aserrano.com/2007/12/16/motores-de-juego-torque/#comments</comments>
		<pubDate>Sun, 16 Dec 2007 20:38:57 +0000</pubDate>
		<dc:creator>Antonio Serrano</dc:creator>
				<category><![CDATA[Desarrollo]]></category>
		<category><![CDATA[Juegos]]></category>
		<category><![CDATA[Motores 3D]]></category>
		<category><![CDATA[Torque]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.aserrano.net/2007/12/16/motores-de-juego-torque/</guid>
		<description><![CDATA[Los chicos de GarageGames han desarrollado muchos productos entre los que se encuentran el Torque Game Engine y el Torque Engine Advanced. De su página web podréis bajar una demo de ambos motores de juego totalmente funcionales durante 30 días. El segundo es una evolución del primero y practicamente igual con la salvedad de que [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Los chicos de GarageGames han desarrollado muchos productos entre los que se encuentran el Torque Game Engine y el Torque Engine Advanced. De su página web podréis bajar una demo de ambos motores de juego totalmente funcionales durante 30 días.</p>
<p>El segundo es una evolución del primero y practicamente igual con la salvedad de que nos permitirá efectos visuales de última generación.</p>
<p>Una de las cosas que hace más diferente a Torque de otros motores de juego es su curva de aprendizaje. En muy poco tiempo podéis empezar a crear vuestros propios juegos.</p>
<p><a href="http://www.aserrano.net/wp-content/uploads/2007/12/torque-fps.JPG" title="Torque Demo FPS"><img src="http://www.aserrano.net/wp-content/uploads/2007/12/torque-fps.thumbnail.JPG" alt="Torque Demo FPS" /></a></p>
<p>Como yo podéis intuir este motor no es gratis pero realmente el precio de la licencia &#8220;Indie&#8221; merece la pena, más ahora que tenemos un Euro tan potente <img src='http://www.aserrano.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Quiero recordar que son unos 150$ (100€ más o menos a la fecha de este artículo).</p>
<p>Como indicaba por muy poco dinero tendréis un motor plenamente funcional y además una vez adquirido el producto se suministra con el código fuente en C++ que con los adecuados niveles avanzados podréis modificar a vuestra conveniencia. De todas formas el producto es totalmente funcional sin tener ni siquiera un compilador de C++, ya que viene compilado una vez adquirida la licencia.</p>
<p>Otra de las ventajas de este motor es que para la versión normal todo el producto es multiplataforma. Realmente es una pena que el motor avanzado haya perdido esa característica.</p>
<p>Torque se programa por misiones y si bien cada terreno es bastante amplio, es una de sus limitaciones el no poder crear terrenos tan grandes como queramos, siendo casi con toda probalidad, nuestro primer contacto con el editor de terrenos y creador del mundo.</p>
<p>El creador de terrenos nos permitirá incluir lagos, editar montañas, poner edificios, hacer cavernas, poner el punto de salida de nuestro héroe, etc.</p>
<p>Otra característica destacable es que todos los desarrollos creados tienen arquitectura cliente servidor incluso aunque los juegos sean para ejecutar solamente en local. Esta característica hace que cualquier juego pueda ser creado con facilidad para soportar muchos jugadores online.</p>
<p>Todo el producto se complementa con un editor de diálogos, exportadores para los principales programas gráficos, una gran documentación, foros de soporte, etc.</p>
<p>Resumiendo, torque es un producto muy recomendable si queremos empezar a desarrollar juegos con prontitud y con una curva de aprendizaje muy corta.</p>
<p>Si queréis ver las posibilidades reales de este motor echad un vistazo a este mmorpg <a href="http://www.prairiegames.com/" title="Minions of mirth" target="_blank">minions of mirth</a></p>
<p><a href="http://www.garagegames.com" target="_blank">Garagegames</a></p>
<div class="shr-publisher-8"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2007%2F12%2F16%2Fmotores-de-juego-torque%2F' data-shr_title='Motores+de+juego%3A+Torque'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2007%2F12%2F16%2Fmotores-de-juego-torque%2F' data-shr_title='Motores+de+juego%3A+Torque'></a><a class='shareaholic-tweetbutton' data-shr_count='horizontal' data-shr_href='http%3A%2F%2Fwww.aserrano.com%2F2007%2F12%2F16%2Fmotores-de-juego-torque%2F' data-shr_title='Motores+de+juego%3A+Torque'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.aserrano.com/2007/12/16/motores-de-juego-torque/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

