public static void Run(Form form, Graphics3DDevice graphics3d) { form.Show(); if (Initialize != null) { Initialize(graphics3d); } while (form.Visible) { if (PreRender != null) { PreRender(graphics3d); } graphics3d.Render(); if (PostRender != null) { PostRender(graphics3d); } Application.DoEvents(); } if (Dispose != null) { Dispose(graphics3d); } graphics3d.Dispose(); form.Dispose(); }
private static void Graphics3DApplication_Initialize(Graphics3DDevice obj) { Viewport vp1 = ViewportManager.CreateViewport("main1", ViewportCreator.CreateViewport( 0, 0, Graphics3DSystem.Configuration.ScreenConfiguration.Width, Graphics3DSystem.Configuration.ScreenConfiguration.Height / 2, Color.Blue)); vp1.Camera.ViewInformation.Position = new Vector3(2, 2, 2); Viewport vp2 = ViewportManager.CreateViewport("main2", ViewportCreator.CreateViewport( 0, Graphics3DSystem.Configuration.ScreenConfiguration.Height / 2, Graphics3DSystem.Configuration.ScreenConfiguration.Width, Graphics3DSystem.Configuration.ScreenConfiguration.Height / 2, Color.Red)); vp2.Camera.ViewInformation.Position = new Vector3(2, 2, 0); Mesh mesh = MeshManager.CreateMesh("mesh1", MeshCreator.CreateBox(1, 1, 1)); Entity entity = EntityManager.CreateEntity("entity1", EntityCreator.CreateObjectEntity(mesh)); Light light = LightManager.CreateLight("light1", LightCreator.CreatePointLight(new Vector3(5, 5, 5), Color.White, Color.Red, Color.White, 8f)); EntityNode node = obj.RootNode.AddEntityNode("node1", entity); }
public static void Run(Form form, Graphics3DDevice graphics3d) { form.Show(); if (Initialize != null) Initialize(graphics3d); while (form.Visible) { if (PreRender != null) PreRender(graphics3d); graphics3d.Render(); if (PostRender != null) PostRender(graphics3d); Application.DoEvents(); } if (Dispose != null) Dispose(graphics3d); graphics3d.Dispose(); form.Dispose(); }
/// <summary> /// Initialize a graphics 3d system from a plugin. <b>Do not call initialize on the returned Graphics3DDevice! Already called by this method!</b> /// </summary> /// <param name="config">Configuration for Graphics 3D Engine</param> /// <param name="systemName">Name of the low layer system (e. g. Direct3D9, ...)</param> /// <returns>A Graphics3DDevice object. Represent an instance of the graphics 3d engine</returns> /// <exception cref="Graphics3DSystemNotFoundException">Is thrown if no system with the given system name was found</exception> public static Graphics3DDevice InitializeSystem(Graphics3DConfiguration config, String systemName) { if (!layerList.ContainsKey(systemName)) { throw new Graphics3DSystemNotFoundException("Cannot find system: " + systemName); } Configuration = config; Implementors = layerList[systemName].LayerImplementor; Graphics3DDevice device = layerList[systemName].Device; device.Initialize(config); CurrentDeviceType = systemName; return(device); }
public static void Run(Graphics3DDevice graphics3d) { Run(new Form(), graphics3d); }
private static void Graphics3DApplication_Dispose(Graphics3DDevice obj) { }