public TRender(Control use_canvas) { PresentParameters presentParams = new PresentParameters(); presentParams.Windowed = true; presentParams.SwapEffect = SwapEffect.Discard; presentParams.AutoDepthStencilFormat = DepthFormat.D24S8; presentParams.EnableAutoDepthStencil = true; presentParams.PresentationInterval = PresentInterval.One; canvas = use_canvas; _device = new Device( 0, DeviceType.Hardware, use_canvas, CreateFlags.HardwareVertexProcessing, presentParams); System.Drawing.Font local_font = new System.Drawing.Font("Arial", 14, System.Drawing.FontStyle.Regular); font = new Microsoft.DirectX.Direct3D.Font(_device, local_font); _device.RenderState.Lighting = false; _device.RenderState.CullMode = Cull.None; _device.RenderState.ZBufferEnable = true; _device.DeviceResizing += new System.ComponentModel.CancelEventHandler(this.DeviceResizing); State = new TState(_device); Transform = new TTransform(_device, canvas); Draw = new TDraw(_device, font); Lighting = new TLighting(_device); }
protected virtual void OnEnable() { #if UNITY_EDITOR mTTransform = new TTransform(transform); #endif }
/*! \cond UNITY */ protected virtual void Awake() { mTTransform = new TTransform(transform); }