OGRE Wiki
Support and community documentation for Ogre3D
Ogre Forums
ogre3d.org
Log in
Username:
Password:
CapsLock is on.
Remember me (for 1 year)
Log in
Home
Tutorials
Tutorials Home
Basic Tutorials
Intermediate Tutorials
Mad Marx Tutorials
In Depth Tutorials
Older Tutorials
External Tutorials
Cookbook
Cookbook Home
CodeBank
Snippets
Experiences
Ogre Articles
Libraries
Libraries Home
Alternative Languages
Assembling A Toolset
Development Tools
OGRE Libraries
List of Libraries
Tools
Tools Home
DCC Tools
DCC Tutorials
DCC Articles
DCC Resources
Assembling a production pipeline
Development
Development Home
Roadmap
Building Ogre
Installing the Ogre SDK
Setting Up An Application
Ogre Wiki Tutorial Framework
Frequently Asked Questions
Google Summer Of Code
Help Requested
Ogre Core Articles
Community
Community Home
Projects Using Ogre
Recommended Reading
Contractors
Wiki
Immediate Wiki Tasklist
Wiki Ideas
Wiki Guidelines
Article Writing Guidelines
Wiki Styles
Wiki Page Tracker
Ogre Wiki Help
Ogre Wiki Help Overview
Help - Basic Syntax
Help - Images
Help - Pages and Structures
Help - Wiki Plugins
Toolbox
Freetags
Categories
List Pages
Structures
Trackers
Statistics
Rankings
List Galleries
Ogre Lexicon
Comments
History: Easy Debug Text for MOGRE
View page
Source of version: 5
(current)
This is a port of ((Easy debug text)). {maketoc} !!About The following code is a class, for use with the OgreDebugPanel {LEX()}overlay{LEX} that is added into all the demos and sample applications. The reason for creating it was to be able to change the debug text at different points in the code. If you do something like this... {CODE(wrap="1", colors="c++")} // this must be changed for C# code: mWindow->setDebugText(mWindow->getDebugText() + "new text");{CODE} ...you end up with a never ending line of text that would keep growing and slowly kill your application. Maybe the code has teething problems. If you need help or added improvements, please tell us in [http://www.ogre3d.org/addonforums/viewtopic.php?t=6204|this thread]. !!Comments of the porter [http://www.ogre3d.org/addonforums/memberlist.php?mode=viewprofile&u=7389|RichTufty] You will notice that in the actual printText() method I also couldn't find the setDebugText() method on the RenderWindow class, so I have put a line in there to write the debug text to the Visual Studio output window. You may have your own way of displaying debug information in your own project so just change that line. Also the sceneManager and window objects aren't actually used, so they can be completely removed from this class, but i left them in incase you wanted to expand this class. !!Source code {CODE(wrap="1", colors="c#")}using System; using System.Text; using System.Collections.Generic; using Mogre; namespace your_projects_namespace { public class DebugWriter { SceneManager sceneManager; RenderWindow window; List<string> debugLines; public DebugWriter(SceneManager _sceneManager, RenderWindow _window) { sceneManager = _sceneManager; window = _window; //create empty list of strings debugLines = new List<string>(); } public void addDebugText(string text) { //simply add string to our current list debugLines.Add(text); } public void printText() { string output = ""; //loop through each string in the list and join them together foreach (string line in debugLines) output += line + ", "; //output debug text // I didn't found a member like this... ?? //window.setDebugText(output); System.Diagnostics.Debug.WriteLine(output); debugLines.Clear(); } } }{CODE} !!See also * ((MOGRE MovableText by Billboards)) - shows text, clamped to a SceneNode * ((MOGRE MovableText)) - shows text, clamped to a {LEX()}SceneNode{LEX} * ((MovableTextOverlay)) - shows text, clamped to a SceneNode * ((Simple text in MOGRE)) - shows text independent of a SceneNode * ((SpriteManager2d)) | ((MOGRE SpriteManager2d)) - code snippet * ((OgreSprites)) - similar, but without use of ''Billboard'' * ((ManualObject 2D)) * {LEX()}Overlay{LEX} * {LEX()}Billboard{LEX} * {LEX()}GUI{LEX} - several gui systems --- Alias: (alias(Easy debug text MOGRE))
Search by Tags
Search Wiki by Freetags
Latest Changes
Minimal Ogre Collision
Artifex Terra
OpenMB
Advanced Mogre Framework
MogreSocks
Critter AI
Mogre Add-ons
MOGRE
Mogre MyGUI wrapper
MOGRE Editable Terrain Manager
...more
Search
Find
Advanced
Search Help
Online Users
12 online users