当前位置: 首页>>代码示例>>C#>>正文


C# SceneView.Initialize方法代码示例

本文整理汇总了C#中SceneView.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# SceneView.Initialize方法的具体用法?C# SceneView.Initialize怎么用?C# SceneView.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SceneView的用法示例。


在下文中一共展示了SceneView.Initialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnGlwidget1Initialized

	//public ref int testRef(ref int param) { return ref param; }
	protected void OnGlwidget1Initialized(object sender, EventArgs e)
	{
		Console.WriteLine("init");
		//if (GLinit)
		//return;
		GLinit = true;
		MainEditorView.editorBackendRenderer = new SharpSL.BackendRenderers.OpenGL.EditorOpenGLRenderer();
		SceneView.backendRenderer = new SharpSL.BackendRenderers.OpenGL.OpenGLRenderer();
		mainEditorView.Initialize();
		mainEditorView.OnResize(glwidget1.Allocation.Width, glwidget1.Allocation.Height);

		Sharp.InputHandler.input.Initialize(MainEditorView.canvas);


		var assets = new AssetsView();


		Sharp.InputHandler.OnMouseDown += (args) =>
		{
			Console.WriteLine("click: " + focusedView);
			if (focusedView == null)
				foreach (var view in View.views)
				{

					if (view.panel != null && view.panel.IsChild(Gwen.Input.InputHandler.HoveredControl, true))
					{
						view.OnMouseDown(args);
						break;
					}
				}
			else
				focusedView.OnMouseDown(args);
		};
		Sharp.InputHandler.OnMouseUp += (args) =>
		{
			if (focusedView == null)
				foreach (var view in View.views)
				{
					if (view.panel != null && view.panel.IsChild(Gwen.Input.InputHandler.HoveredControl, true))
					{
						view.OnMouseUp(args);
						break;
					}
				}
			else
				focusedView.OnMouseUp(args);
		};
		Sharp.InputHandler.OnMouseMove += (args) =>
		{
			if (focusedView == null)
				foreach (var view in View.views)
				{
					if (view.panel != null && view.panel.IsChild(Gwen.Input.InputHandler.HoveredControl, true))
					{
						view.OnMouseMove(args);
						break;
					}
				}
			else
				focusedView.OnMouseMove(args);
		};

		var scene = new SceneView();
		var structure = new SceneStructureView();
		var inspector = new InspectorView();

		var tab = new Gwen.Control.TabControl(mainEditorView.splitter);
		mainEditorView.splitter.OnSplitMoved += (o, args) =>
		{
			scene.OnResize(glwidget1.Allocation.Width, glwidget1.Allocation.Height);
			//assets.OnResize(glwidget1.Allocation.Width,glwidget1.Allocation.Height);
		};
		var btn = tab.AddPage("scene");
		var page = btn.Page;
		page.Margin = new Gwen.Margin(3, 3, 3, 3);
		scene.panel = btn.Page; //make GLControl for gwen

		var tab1 = new Gwen.Control.TabControl(mainEditorView.splitter);
		btn = tab1.AddPage("Assets");
		page = btn.Page;
		page.Margin = new Gwen.Margin(3, 3, 3, 3);
		page.HoverEnter += (item, args) => { Console.WriteLine("hover"); };
		assets.panel = page;

		var tab2 = new Gwen.Control.TabControl(mainEditorView.splitter);
		btn = tab2.AddPage("Structure");
		page = btn.Page;
		page.Margin = new Gwen.Margin(3, 3, 3, 3);
		structure.panel = btn.Page;

		var tab3 = new Gwen.Control.TabControl(mainEditorView.splitter);
		btn = tab3.AddPage("Inspector");
		page = btn.Page;
		page.Margin = new Gwen.Margin(3, 3, 3, 3);
		inspector.panel = btn.Page;

		scene.Initialize();
		structure.Initialize();

//.........这里部分代码省略.........
开发者ID:BreyerW,项目名称:Sharp.Engine,代码行数:101,代码来源:MainWindow.cs


注:本文中的SceneView.Initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。