
Ogrelicious is a framework or wrapper (depending on how much you use it) for Ogre. It carries much of the philosophy and syntax of the many Javascript libraries (Scriptaculous, JQuery and Prototype) and applies it to Ogre. The screen shot above was just created with only the following code:
Code: Select all
class App
{
public:
App()
{
mRoot = startOgre();
_Plugins("RenderSystem: Direct3D9, Plugin: CgProgramManager, Plugin: ParticleFX").load(_Everything);
_RenderSystems("all").nominate(_First);
initialiseOgre(_NoAutoWindow);
mWindow = _Window("Ogrelicious, yummy!")
.left(_HorizontallyCenter)
.top(_VerticallyCenter)
.width(1024)
.height(768)
.depth(32)
.fullscreen(false);
mWindow.create();
mWindow.onUnload += _Callback(&::Ogrelicious::Ogrelicious::SafeShutdown);
mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "Main");
mSceneMgr->setAmbientLight(ColourValue(1.0,1.0,1.0));
mCamera = _Camera("Camera1", mSceneMgr)
.farClip(1)
.nearClip(5000)
.position(0, 0, -75)
.look(0,0,0);
mViewport = mWindow.add(mCamera).background(Colours::IndianRed);
mRoot->renderOneFrame();
_ResourceGroup("General") += "../../../Media/packs/#?,../../../Media/materials/#?,../../../Media/models/";
_ResourceGroups("all").init(_Everything);
mViewport.background(Colours::Tomato);
_Material("ForestGreen").ambient(Colours::ForestGreen);
_Material("Crimson").ambient(Colours::Crimson);
// Big Green scary Ogre.
_Node("Ogre", mSceneMgr).scale(0.2,0.2,0.2).entity("ogrehead.mesh")->setMaterialName("ForestGreen");
SmartNode root = _Node("root", mSceneMgr);
unsigned int i=0;
for(int x=0;x < 6;x++)
for(int y=0;y < 6;y++)
root.add(i++).position(20 - x * 10, 20 - y * 10, -25).scale(0.05,0.05,0.05).entity("ogrehead.mesh")->setMaterialName("Crimson");
}
void idle()
{
mRoot->startRendering();
}
~App()
{
stopOgre();
}
protected:
Ogre::Root* mRoot;
Ogre::SceneManager* mSceneMgr;
SmartWindow mWindow;
SmartCamera mCamera;
SmartViewport mViewport;
};
Ogrelicious comes in TWO files; a header and source file. It can be downloaded from this folder. It comes under the MIT licence, meaning that you can use it in practically anything.
Wheres the documentation, Betajaen?
I've written a fair amount of it in out Wiki.
Sounds great. But do I have to create a Visual Studio project to try it out?
Nope, I've written a small Application called "Demo_Ogrelicious" which you can download, unpack, compile and find the executable in your Ogre samples directory.
Any other things Betajaen?
This is a first release, so don't judge it to harshly. Most of the stuff in Ogrelicious is just a wrapper. Once I've finished with that, I can start with some fun parts of Ogrelicious I have planned. SmartQuads (like QuickGUI uses), a miniture GUI system, more SceneNode magic, "OISlicious", and lots and lots more. I want to get back to NxOgre now; and develop a new version of Cake with Ogrelicious. Any additions I make will be released.
In summary
- Source Code
- Example
- Documentation
Enjoy!