Ogrelicious

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Ogrelicious

Post by betajaen »

Ogrelicious 0.0.7

Image

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;
};
So where can I download it? I bet it's a huge library isn't it Betajaen? Do I have to sell my granny to use it?

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!
User avatar
Nauk
Gnoll
Posts: 653
Joined: Thu May 11, 2006 9:12 pm
Location: Bavaria
x 36
Contact:

Post by Nauk »

0.0.7
You could make a James Bond like Demo for it too.

Very interesting, I like the syntax, looks much like Ogre-Speed-Coding from what I can judge :)
User avatar
ajs15822
OGRE Expert User
OGRE Expert User
Posts: 570
Joined: Mon Jan 02, 2006 2:05 am
Location: Texas
x 2
Contact:

Post by ajs15822 »

Pretty fancy framework, takes a bit of reading to understand at first but I imagine this could be really useful to those who wanna write simple Ogre-based apps quickly. I myself adore Prototype, Scriptaculous, and friends and so I can understand the value of compact, expressive semantics.

Great job! :)
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

You're crazy, Betajaen! :)

I quite like it! It's nifty! :lol:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Post by betajaen »

Of course I'm crazy, I'd be mad to do something as insane as this.

Also 7 isn't the version. It's the rewrite. Yeah, seven times. :D
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Post by Thieum »

yum yum, your screenshot tastes like strawberry!
I am impressed. It is very simple but very aesthetic.

(But you are doing very evil things in the header file of Ogrelicious :evil: )
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

The language C++ will never be the same again .. :(

Ogre neither. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
tdev
Silver Sponsor
Silver Sponsor
Posts: 244
Joined: Thu Apr 12, 2007 9:21 pm
Location: Germany
x 14

Post by tdev »

betajaen wrote:Of course I'm crazy, I'd be mad to do something as insane as this.
i can foresee ogre speedcode contests with that :p
very unique idea, thanks for sharing :)
User avatar
calsmurf2904
Orc
Posts: 401
Joined: Tue Sep 16, 2008 9:39 pm
Location: Netherlands

Post by calsmurf2904 »

grr....windows vista !
Just kidding lol...looks great (and simple lol)
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)
Image
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

I bet you can code as fast as you can fix a jukebox 8)
Image
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Post by betajaen »

I can't keep away from this code.

"SmartConfig", serializes names and meta-data of some of the Smart classes to a file, and once I've written it - read it all back in again.

Example:

Code: Select all

  _Plugins plugins("RenderSystem: Direct3D9, RenderSystem: GL, Plugin: ParticleFX, Plugin: CgProgramManager");

  mWindow = _Window("CakeWindow")
    .title("Ogrelicious, yummy!")
    .size(1024, 768)
    .depth(32)
    .fullscreen(false);

  SmartConfig()
  .comment("Configuration file for Bloody Cake")
  .saveFrom(plugins)
  .saveFrom(mWindow)
  .save("config.cfg");

config.cfg

Code: Select all

# Configuration file for Bloody Cake
[Plugins]
Plugins=CgProgramManager ParticleFX
RenderSystems=Direct3D9 GL
[Window]
Depth=32
Fullscreen=false
Height=768
Width=1024
I had a brilliant idea a few hours ago, for when I implement OISlicious. I can use SmartConfig to bind key presses and mouse events directly from the configuration file through the Ogrelicious events system into the user's function.
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Post by nullsquared »

I don't see the need for the underscore prefixes. Considering Ogre is its own namespace, what's the need? Or better yet, just put Ogrelicious in its own namespace.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Post by betajaen »

Ogrelicious is in it's own namespace called Ogrelicious. Most of the underscore prefixes are typedef's, the rest are enums.

Besides, I think it looks cool. ;)

Oh; If anyone is using it, and is happening to be using the SmartWindow class. I found a bug, I forgot to fill out the operator= properly; so binding events to a SmartWindow, after it being returned the window from a function won't work. I'll post a fix once I've finished this SmartConfig class.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

betajaen wrote:Besides, I think it looks cool. ;)
I agree it does. It looks ilicious! Or something like a mad systems programmer might use. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Post by betajaen »

But to be fair to NullSquared. You can do:

Code: Select all

SmartWindow("Goldfish");

Code: Select all

_Window("Goldfish");
It's the exactly same to Ogrelicious and to the compiler.

The underscore prefix is just a unofficial guideline saying for any fetching or creating "Use the underscore so it stands out better in the IDE". You don't have to keep to the guideline. I just think it looks better.



Oh; I'm taking ideas in to what to call the main Ogrelicious class. I can't call it Ogrelicious anymore because it's confusing VisualStudio as the namespace is also called Ogrelicious. Currently it's "Licious"; but I'm sure someone can come up with something better.
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

OgreFlavour? It's the core of anything Ogrelicious 8)
Image
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Post by Vectrex »

Ogravy.. 8)
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

The topic lives! :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Post by betajaen »

jacmoe wrote:The topic lives! :)
I knew you stole it from me Jacmoe, and this proves it!
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

betajaen wrote:
jacmoe wrote:The topic lives! :)
I knew you stole it from me Jacmoe, and this proves it!
:lol:
PhpBB2 is acting up on us, and this isn't the first time.. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Kerion
Goblin
Posts: 235
Joined: Wed Feb 05, 2003 5:49 am
Contact:

Post by Kerion »

I don't really get the whole Prototype-style syntax, but this is cool none the less!
User avatar
calsmurf2904
Orc
Posts: 401
Joined: Tue Sep 16, 2008 9:39 pm
Location: Netherlands

Post by calsmurf2904 »

Vectrex wrote:Ogravy.. 8)
xD agree with that one lol.
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)
Image
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Post by betajaen »

I'm not a gravy fan, besides Ogrelicious is an ice-cream flavour.


On topic though; I did release Ogrelicious 0.0.7.5 with BloodyCake today. It's just includes some of the SmartConfig file stuff I was talking about with a few bug fixes. If anyone wants it, I can upload it in the morning.
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

There is something very wrong with the word "BloodyCake"... :lol:
Creator of QuickGUI!
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Post by nullsquared »

Hm... 'Root'? :D

Why is MSVC getting confused? I use things like engine::input::input, etc., and it's all fine :|
Post Reply