private static unsafe void SetEngineStudioAPI(void *pEngineStudioAPI) { IEngineStudio.Init((EngineStudioAPI *)pEngineStudioAPI); //register goldsrc global variables //拿到金源引擎的API,使物理引擎可以访问缓存的模型信息、地图信息等 BWorld.CreateInstance(); StudioRenderer.Init(); StudioRenderer.Drawer = BWorld.Instance.DebugDrawer; //Validation //if ((void*)(&StudioRenderer.NativePointer->m_plighttransform) != lastFieldAddress) // throw new Exception("Studio model renderer is invalid."); }
public void RenderStudioModel(ref StudioModelRenderData renderData) { if (renderData.Model == null) { throw new ArgumentNullException(nameof(renderData), $"{nameof(renderData.Model)} cannot be null"); } if (!_active) { throw new InvalidOperationException($"Cannot call {nameof(RenderStudioModel)} outside the render operation"); } var resources = _resourcesManager.GetResources(renderData.Model); StudioRenderer.Render( _renderContext.GraphicsDevice, _renderContext.CommandList, _renderContext.SceneContext, _renderContext.RenderPass, (StudioModelResourceContainer)resources, ref renderData); }