private bool Initialize(TextureManager manager, D3d.Format format, int size, bool mipmap,int multisample ) { D3d.Pool d3dPool = D3d.Pool.Default; D3d.Usage d3dUsage = manager.GetUsageFlags( false,mipmap,true ); try { d3dTexture = new D3d.CubeTexture( manager.Device.D3dDevice,size,manager.GetMipLevelCount(mipmap),d3dUsage,format,d3dPool); // Create depth buffer. d3dDepthBuffer = manager.Device.D3dDevice.CreateDepthStencilSurface(size, size, manager.Device.Settings.depthBufferFormat, (D3d.MultiSampleType)multisample, 0, true); this.Initialize(manager, format, size,size,6, d3dTexture); return true; } catch (D3d.InvalidCallException e) { log.Warning("Unable to create render cube texture: {0}", e.Message); } catch (D3d.OutOfVideoMemoryException e) { log.Warning("Unable to create render cube texture: {0}", e.Message); } catch (OutOfMemoryException e) { log.Warning("Unable to create render cube texture: {0}", e.Message); } return false; }
private bool Initialize(TextureManager manager, D3d.Format format, int size, bool dynamic, bool mipmap) { D3d.Pool d3dPool = D3d.Pool.Managed; D3d.Usage d3dUsage = manager.GetUsageFlags(dynamic, mipmap, false); try { d3dTexture = new D3d.CubeTexture(manager.Device.D3dDevice, size, manager.GetMipLevelCount(mipmap), d3dUsage, format, d3dPool); this.Initialize(manager, format, size, size, 6, d3dTexture); return(true); } catch (D3d.InvalidCallException e) { log.Warning("Unable to create cube texture: {0}", e.Message); } catch (D3d.OutOfVideoMemoryException e) { log.Warning("Unable to create cube texture: {0}", e.Message); } catch (OutOfMemoryException e) { log.Warning("Unable to create cube texture: {0}", e.Message); } return(false); }
private bool Initialize(TextureManager manager, D3d.Format format, int width, int height, bool dynamic, bool mipmap) { D3d.Pool d3dPool = D3d.Pool.Managed; D3d.Usage d3dUsage = manager.GetUsageFlags( dynamic,mipmap,false ); try { d3dTexture = new D3d.Texture( manager.Device.D3dDevice, width, height, manager.GetMipLevelCount(mipmap), d3dUsage, format, d3dPool ); this.Initialize(manager, format, width, height, 1, d3dTexture); return true; } catch (D3d.InvalidCallException e) { log.Warning("Unable to create texture: {0}", e.Message); } catch (D3d.OutOfVideoMemoryException e) { log.Warning("Unable to create texture: {0}", e.Message); } catch (OutOfMemoryException e) { log.Warning("Unable to create texture: {0}", e.Message); } return false; }
private bool Initialize(TextureManager manager, D3d.Format format, int size, bool mipmap, int multisample) { D3d.Pool d3dPool = D3d.Pool.Default; D3d.Usage d3dUsage = manager.GetUsageFlags(false, mipmap, true); try { d3dTexture = new D3d.CubeTexture(manager.Device.D3dDevice, size, manager.GetMipLevelCount(mipmap), d3dUsage, format, d3dPool); // Create depth buffer. d3dDepthBuffer = manager.Device.D3dDevice.CreateDepthStencilSurface(size, size, manager.Device.Settings.depthBufferFormat, (D3d.MultiSampleType)multisample, 0, true); this.Initialize(manager, format, size, size, 6, d3dTexture); return(true); } catch (D3d.InvalidCallException e) { log.Warning("Unable to create render cube texture: {0}", e.Message); } catch (D3d.OutOfVideoMemoryException e) { log.Warning("Unable to create render cube texture: {0}", e.Message); } catch (OutOfMemoryException e) { log.Warning("Unable to create render cube texture: {0}", e.Message); } return(false); }