public void RequestPBuffer( PixelComponentType pcType, int width, int height ) { // Check Size GLPBuffer pBuffer = pBuffers[ (int)pcType ].PixelBuffer; if ( pBuffer != null ) { if ( pBuffer.Width < width || pBuffer.Height < height ) { // if the current buffer is too small destroy it and recreate it pBuffer = null; pBuffers[ (int)pcType ].PixelBuffer = null; } } if ( pBuffer == null ) { // create pixelbuffer via rendersystem pBuffers[ (int)pcType ].PixelBuffer = this._glSupport.CreatePBuffer( pcType, width, height ); } pBuffers[ (int)pcType ].InUseCount++; }
public GLPBRenderTexture(GLPBRTTManager manager, string name, GLSurfaceDesc target, bool writeGamma, int fsaa) : base(name, target, writeGamma, fsaa) { this.manager = manager; this.pbFormat = PixelUtil.GetComponentType(target.Buffer.Format); manager.RequestPBuffer(this.pbFormat, Width, Height); }