/// <summary> /// Internal. /// </summary> internal static void CheckCompiling() { if (Entity.Compiling) { MeshCreator.CheckMeshCreator(); } }
/// <summary> /// calls recursively the <see cref="CustomEntity.OnDraw(OpenGlDevice)"/>method of the members in the <see cref="Children"/>list. /// </summary> /// <param name="Device"></param> public void Paint(OpenGlDevice Device) { if ((!Visible) && (Device.RenderKind != RenderKind.SnapBuffer)) { return; } double SaveOpacity = Device.Translucent; OpenGlDevice.CheckError(); if (Device.RenderKind == RenderKind.Render) { if ((Pattern != null) && (Texture == null)) { Texture = GetPatternTexture(Device);// ActivatePattern(Device); } } OpenGlDevice.CheckError(); Entity SaveCurrent = CurrentEntity; if (HasTexture) { Device.texture = Texture; } if (HasMaterial) { Device.Material = Material; } if (HasOpacity) { Device.Translucent = System.Math.Min(Opacity, Device.Translucent); } CurrentEntity = this; if (Device.OutFitChanged) { setMesh(null); } if (Device.RenderKind == RenderKind.Render) { if (Invalid) { Device.invalid = true; } } if (((Mesh == null) || (Invalid)) && (CompileEnable) && (!Compiling) && (Device.RenderKind == RenderKind.Render)) { Compile(Device); // sollte nicht bei refreshSnapBuffer auf gerufen werden } Invalid = false; if (Device.Selector.CreateSnap) // kommt vonRefreshMeshBuffer { if (SnappEnable) { MeshCreator.CreateMeshes(Device, CompileMeshDraw); // Entity wird gedrawt im snap items mode } return; // eventuell Children interndraw braucht nicht aufgerufen werden!!! } if (HasTransformation) { Device.PushMatrix(); Device.MulMatrix(Transformation); } if ((Mesh != null))// && (Device.RenderKind == RenderKind.Render)) { Mesh.internDraw(Device); base.OnDraw(Device); } else { if (Mesh != null) { Mesh.Paint(Device); } else { internDraw(Device); // bei snap wird im createsnap registriert } } if (Mesh == null) { for (int i = 0; i < Children.Count; i++) { if (Children[i].Visible) { Children[i].Paint(Device); } } } CurrentEntity = SaveCurrent; if (HasTransformation) { Device.PopMatrix(); } if (HasOpacity) { Device.Translucent = SaveOpacity; } if (Entity.Compiling) { MeshCreator.CheckMeshCreator(); } OpenGlDevice.CheckError(); if (Device.RenderKind == RenderKind.Render) { Invalid = false; } }