<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - Maratis MCore/MEngine C++ "Hello World" Example]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=276</link>
		<description><![CDATA[The most recent posts in Maratis MCore/MEngine C++ "Hello World" Example.]]></description>
		<lastBuildDate>Tue, 17 Jan 2012 04:59:08 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Maratis MCore/MEngine C++ "Hello World" Example]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=1157#p1157</link>
			<description><![CDATA[<p>Well if anyone want&#039;s to use Maratis with SFML2 here is some code to start<br />with. Can&#039;t see the model but I imagen that has something to do with transformations.</p><p>But the viewport is visible.</p><div class="codebox"><pre><code>#include &lt;SFML/Graphics.hpp&gt;
#include &lt;MCore.h&gt;
#include &lt;MEngine.h&gt;
#include &quot;MGLContext.h&quot;
#include &lt;iostream&gt;

int main()
 {
     // Create the main window
     sf::RenderWindow window(sf::VideoMode(800, 600), &quot;SFML window&quot;);

     MEngine * engine = MEngine::getInstance();

     MRenderingContext * render = new MGLContext();
     render-&gt;disableScissorTest();
     render-&gt;setViewport(0, 0, 200, 200);

     engine-&gt;setRenderingContext(render);

     MGame * game = new MGame();
     engine-&gt;setGame(game);

     // get level
     MLevel * level = new MLevel();
     engine-&gt;setLevel(level);

     if(level-&gt;getScenesNumber() == 0)
     {
         MScene * scene = level-&gt;addNewScene();

         MOCamera * camera = scene-&gt;addNewCamera();
         camera-&gt;setClearColor(MVector3(1.0f, 0.075f, 1.0f)); // set grey clear color
         camera-&gt;setPosition(MVector3(0.0f, -80.0f, 20.0f));
         camera-&gt;setEulerRotation(MVector3(90.0f, 0.0f, 0.0f));

         MMeshRef * meshRef = level-&gt;loadMesh(&quot;box.mesh&quot;);
         MOEntity * box1 = scene-&gt;addNewEntity(meshRef);

         box1-&gt;setPosition(MVector3(70, 65, 0));
         box1-&gt;setScale(MVector3(4, 4, 0.2f));

         MOLight * light = scene-&gt;addNewLight();
         light-&gt;setPosition(MVector3(0.0f, 0.0f, 100.0f));
         light-&gt;setRadius(1000.0f);
     }

     game-&gt;begin();
     // Start the game loop
     while (window.IsOpened())
     {
         // Process events
         sf::Event event;
         while (window.PollEvent(event))
         {
             // Close window : exit
             if (event.Type == sf::Event::Closed)
                 window.Close();
         }
 
         // Clear screen
         window.Clear(sf::Color(255, 255, 255 ,255));
         game-&gt;draw();
         std::cout &lt;&lt; game-&gt;isRunning() &lt;&lt; std::endl;
         // Update the window
         window.Display();
     }
     
     game-&gt;end();

     SAFE_DELETE(game);
     SAFE_DELETE(level);

     SAFE_DELETE(render);
     return EXIT_SUCCESS;
 }</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (zester)]]></author>
			<pubDate>Tue, 17 Jan 2012 04:59:08 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=1157#p1157</guid>
		</item>
		<item>
			<title><![CDATA[Re: Maratis MCore/MEngine C++ "Hello World" Example]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=1156#p1156</link>
			<description><![CDATA[<p>I also want to know simple Hello World standalone executable, not dynamic library, and without MaratisPlayer<br />can it?</p><p>can I bundle MaratisPlayer source into my project?<br />what about the license?since MaratisPlayer use GPL not zlib/png license.</p><br /><p>*edit<br />forget it, I look at ManualUse, and this is what I&#039;m lookin for.</p><p>ohh, currently lua is used for scripting, right?<br />any plan to make lua as binding?so we can make game entirely with lua, just like corona <img src="http://forum.maratis3d.com/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (jurgel)]]></author>
			<pubDate>Tue, 17 Jan 2012 00:17:24 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=1156#p1156</guid>
		</item>
		<item>
			<title><![CDATA[Re: Maratis MCore/MEngine C++ "Hello World" Example]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=1127#p1127</link>
			<description><![CDATA[<p>There is no game by default,<br />engine-&gt;getGame(); will return a NULL</p><p>but MGame implement basic functionalities, so you can create one :</p><p>MGame * game = new MGame();<br />engine-&gt;setGame(game);</p><p>And of course, for a custom game, you can inherit MGame and customize functions you want (update, draw).</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sun, 15 Jan 2012 10:13:31 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=1127#p1127</guid>
		</item>
		<item>
			<title><![CDATA[Re: Maratis MCore/MEngine C++ "Hello World" Example]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=1126#p1126</link>
			<description><![CDATA[<div class="quotebox"><cite>anael wrote:</cite><blockquote><p>ManualUse example is one of the simplest,<br />just initializing MCore + MEngine and loading some mesh.</p><p>What do you mean by subclassed ?</p></blockquote></div><p>In ManualUse MyGame.h you derive a new class from MGame<br /></p><div class="codebox"><pre><code>class MyGame : public MGame
{
public:</code></pre></div><p>I was asking because with some library&#039;s there not meant to be used directly. You have to <br />&quot;subclass&quot; derive a new class from an existing one.</p><p>What I was trying to do was use Maratis&#039; Rendering context in SFML2<br /></p><div class="codebox"><pre><code> int main()
 {
     // Create the main window
     sf::RenderWindow window(sf::VideoMode(800, 600), &quot;SFML window&quot;);
 
    MEngine *engine = MEngine::getInstance();
    MRenderingContext *render = engine-&gt;getRenderingContext();
    MGame *game = engine-&gt;getGame();
    
    render-&gt;setViewport(0, 0, 100, 100);</code></pre></div><p>But when I initialize my MGame pointer *game I get a segfault.</p>]]></description>
			<author><![CDATA[dummy@example.com (zester)]]></author>
			<pubDate>Sun, 15 Jan 2012 00:37:38 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=1126#p1126</guid>
		</item>
		<item>
			<title><![CDATA[Re: Maratis MCore/MEngine C++ "Hello World" Example]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=1118#p1118</link>
			<description><![CDATA[<p>ManualUse example is one of the simplest,<br />just initializing MCore + MEngine and loading some mesh.</p><p>What do you mean by subclassed ?</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sat, 14 Jan 2012 22:56:54 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=1118#p1118</guid>
		</item>
		<item>
			<title><![CDATA[Re: Maratis MCore/MEngine C++ "Hello World" Example]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=1117#p1117</link>
			<description><![CDATA[<p>Looking at the example, it looks like you can inherit from MGame if you want (although it does nothing with it) however I think it&#039;s probably fairly unwise to replace MEngine as it&#039;s a singleton.</p>]]></description>
			<author><![CDATA[dummy@example.com (Nistur)]]></author>
			<pubDate>Sat, 14 Jan 2012 22:55:31 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=1117#p1117</guid>
		</item>
		<item>
			<title><![CDATA[Re: Maratis MCore/MEngine C++ "Hello World" Example]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=1115#p1115</link>
			<description><![CDATA[<p>Maybe I asked the wrong question.</p><p>Do the MEngine or MGame classes have to be subclassed<br />in order to be used?</p>]]></description>
			<author><![CDATA[dummy@example.com (zester)]]></author>
			<pubDate>Sat, 14 Jan 2012 22:45:22 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=1115#p1115</guid>
		</item>
		<item>
			<title><![CDATA[Re: Maratis MCore/MEngine C++ "Hello World" Example]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=1112#p1112</link>
			<description><![CDATA[<p><a href="http://www.maratis3d.org/?p=500">http://www.maratis3d.org/?p=500</a> &lt;-- have you tried that example?</p>]]></description>
			<author><![CDATA[dummy@example.com (Nistur)]]></author>
			<pubDate>Sat, 14 Jan 2012 21:04:46 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=1112#p1112</guid>
		</item>
		<item>
			<title><![CDATA[Maratis MCore/MEngine C++ "Hello World" Example]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=1111#p1111</link>
			<description><![CDATA[<p>I was wondering if anyone had a simple C++ &quot;Hello, World&quot; type example that uses <br />MCore &amp; MEngine?</p><p>I tried using the ManualUse example as a reference for a bare-bones<br />type example but I keep getting a segfault.</p><p>I need something even more basic for testing.</p><p>Any help would be great <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (zester)]]></author>
			<pubDate>Sat, 14 Jan 2012 20:59:13 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=1111#p1111</guid>
		</item>
	</channel>
</rss>
