The New Ogre Wiki

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39
Contact:

Re: The New Ogre Wiki

Post by Beauty »

I want to extend the page Help - Wiki Plugins, but I have problems.

The preview works, but when I try to save the changes, I just see a completely empty page.

Here is the code, which I want to add as sub chapter of the VERSIONS section.

Jacmoe, do you know what's the problem?
It's just frustating.

Code: Select all

!!Tabbed source code view 
The "versions" you can use to display source code snippets for different programming langues. It also supports specific syntax highlighting.

__This is a STUB for C# and VB:__

%beginsmall%Important 1: For usage __remove the underscores__!%endsmall%
%beginsmall%Important 2: It's normal when the preview looks a little bit strange. After page saving the tabbing works.%endsmall%
{CODE()}
{__VERSIONS(nav="y",default="C#")}
{__CODE(wrap="1", colors="C#")}

... C# code here ...

{__CODE}

---(VB.NET)--------------------------

{__CODE(wrap="1", colors="vbnet")}

... VB code here ...

{__CODE}
{__VERSIONS}
{CODE}

It will look like this:
{VERSIONS(nav="y",default="C#")}
{CODE(wrap="1", colors="C#")}

// C# code example
Console.WriteLn("Hello Ogre user")

{CODE}

---(VB.NET)--------------------------

{CODE(wrap="1", colors="vbnet")}

' VB code example
Console.WriteLn("Hello Ogre user")

{CODE}
{VERSIONS}


---
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.
Epi
Gnoblar
Posts: 1
Joined: Mon Mar 05, 2012 6:19 pm

Re: The New Ogre Wiki

Post by Epi »

hey!

just worked through most of the tutorials for getting an impression on ogre and found that in the intermediate tutorial4 the method "void IntermediateTutorial4::deselectObjects()" is not removing the objects from the list("mSelected"), so the list just grows with every new volumeselect.

on more thing is in intermediate tutorial3

Code: Select all

char name[16];
sprintf(name, "Robot%d", mCount++);
Entity *ent = mSceneMgr->createEntity(name, "robot.mesh");
u could use something like

Code: Select all

Ogre::stringstream ss;
ss << "Robot" << mCount++;
Entity *ent = mSceneMgr->createEntity(ss.str(), "robot.mesh");
its more c++'ish:p

hope this is the right place to post this?

nice engine and good tutorials though!
User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39
Contact:

Re: The New Ogre Wiki

Post by Beauty »

Thanks for your feedback. :D

I hope, somebody will apply your suggestion.
I don't do it, because my C++ knowledge is bad. (Instead I use C# and Mogre.)
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: The New Ogre Wiki

Post by Kojack »

Technically you don't even need the name bit, the code could become:

Code: Select all

Entity *ent = mSceneMgr->createEntity("robot.mesh");
Ogre used to need unique names on everything, now it will generate ones itself if you don't give it one (works for scenenodes too).

Or the way intermediate tutorial 4 might be better:

Code: Select all

Ogre::Entity* ent = mSceneMgr->createEntity("Robot" + Ogre::StringConverter::toString(i+j*10), "robot.mesh");
Less lines of code than string streams or sprintf and still has custom names.

I still tend to use sprintf instead of string streams. Partly a habit from years of C coding, partly the memory of how Visual C++ 2005 (before service pack 1) leaked 4 bytes on memory every time a string stream (or any stream class) goes out of scope. :)
User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39
Contact:

Re: The New Ogre Wiki

Post by Beauty »

Epi wrote:on more thing is in intermediate tutorial3

Code: Select all

char name[16];
sprintf(name, "Robot%d", mCount++);
Entity *ent = mSceneMgr->createEntity(name, "robot.mesh");
I wanted to replace it by the second suggestion of Kojack, but as I see the code is still like that (on this wiki page). The last wiki page edit was last year. So I wonder where you found the code. Perhaps in the OgreSDK?
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.
Post Reply