/// <summary> /// Initializes a new instance of the <see cref="ShaderProgram"/> class. /// </summary> /// <param name="renderContextImp">The <see cref="IRenderContextImp"/>.</param> /// <param name="shaderProgramImp">The <see cref="IShaderProgramImp"/>.</param> internal ShaderProgram(IRenderContextImp renderContextImp, IShaderProgramImp shaderProgramImp) { _spi = shaderProgramImp; _rci = renderContextImp; _paramsByName = new Dictionary <string, ShaderParamInfo>(); foreach (ShaderParamInfo info in _rci.GetShaderParamList(_spi)) { _paramsByName.Add(info.Name, info); } }
/// <summary> /// Initializes a new instance of the <see cref="RenderContext"/> class. /// </summary> /// <param name="rci">The <see cref="Fusee.Engine.IRenderContextImp"/>.</param> public RenderContext(IRenderContextImp rci) { _rci = rci; View = float4x4.Identity; ModelView = float4x4.Identity; Projection = float4x4.Identity; // Todo: Remove multiple Lights per shader !!! _lightParams = new Light[8]; _lightShaderParams = new LightParamNames[8]; _currentShaderParams = new MatrixParamNames(); _updatedShaderParams = false; _debugShader = MoreShaders.GetDiffuseColorShader(this); _debugColor = _debugShader.GetShaderParam("color"); }
/// <summary> /// Initializes a new instance of the <see cref="ShaderProgram"/> class. /// </summary> /// <param name="renderContextImp">The <see cref="IRenderContextImp"/>.</param> /// <param name="shaderProgramImp">The <see cref="IShaderProgramImp"/>.</param> internal ShaderProgram(IRenderContextImp renderContextImp, IShaderProgramImp shaderProgramImp) { _spi = shaderProgramImp; _rci = renderContextImp; _paramsByName = new Dictionary<string, IShaderParam>(); foreach (ShaderParamInfo info in _rci.GetShaderParamList(_spi)) { _paramsByName.Add(info.Name, info.Handle); } //_paramsByName = new Dictionary<string, ShaderParamInfo>(); //foreach (ShaderParamInfo info in _rci.GetShaderParamList(_spi)) //{ // ShaderParamInfo newInfo = new ShaderParamInfo() // { // Handle = info.Handle, // Name = info.Name, // Type = info.Type, // Size = info.Size, // }; // _paramsByName.Add(info.Name, newInfo); //} }
/// <summary> /// Creates a new Instance of TextureManager. Th instance is handling the memory allocation and deallocation on the GPU by observing Texture.cs objects. /// </summary> /// <param name="renderContextImp">The RenderContextImp is used for GPU memory allocation and deallocation. See <see cref="RegisterNewTexture"/>.</param> public TextureManager(IRenderContextImp renderContextImp) { _renderContextImp = renderContextImp; }
/// <summary> /// The RenderCanvas constructor. Depending on the implementation this constructor instantiates a 3D viewing window or connects a 3D /// render context to an existing part of the application window. /// </summary> public void InitImplementors() { if (_canvasImp == null) _canvasImp = ImpFactory.CreateIRenderCanvasImp(); if (_renderContextImp == null) _renderContextImp = ImpFactory.CreateIRenderContextImp(_canvasImp); if (_inputImp == null) _inputImp = ImpFactory.CreateIInputImp(_canvasImp); if (_audioImp == null) _audioImp = ImpFactory.CreateIAudioImp(); if (_inputDriverImp == null) _inputDriverImp = ImpFactory.CreateIInputDriverImp(); if (_networkImp == null) _networkImp = ImpFactory.CreateINetworkImp(); }
/// <summary> /// Creates a new Instance of MeshManager. Th instance is handling the memory allocation and deallocation on the GPU by observing Mesh.cs objects. /// </summary> /// <param name="renderContextImp">The RenderContextImp is used for GPU memory allocation and deallocation. See RegisterMesh.</param> public MeshManager(IRenderContextImp renderContextImp) { _renderContextImp = renderContextImp; }