I'm new to c# and am looking to find how to call global object instances in my winform.
namespace BeastEngine {
public partial class Form1 : Form
{
private Root mRoot = new Root();
private RenderWindow mWindow;
private SceneManager mgr = mRoot.CreateSceneManager(SceneType.ST_GENERIC);
private Camera cam = mgr.CreateCamera("Camera");
Right now I'm calling my variables like so, but I'm getting various errors.
private void meshToolStripMenuItem_Click(object sender, EventArgs e)
{
Entity ent = mgr.CreateEntity("ninja", "ninja.mesh");
mgr.RootSceneNode.CreateChildSceneNode().AttachObject(ent);
cam.LookAt(ent.BoundingBox.Center);
}
I want it so that all of my functions can use the one instance. Does anyone know of the proper way? I've googled everywhere.