private GenFramebuffers ( |
||
n | ||
framebuffers | [ | |
리턴 | void |
protected unsafe override bool init(IDisposableResource parent, Image image, int width, int height, bool generateMipmaps, MultiSampleTypes multiSampleType, SurfaceFormats surfaceFormat, RenderTargetUsage renderTargetUsage, BufferUsages usage, bool isRenderTarget, Loader.LoadedCallbackMethod loadedCallback) { initSuccess = base.init(parent, image, width, height, false, multiSampleType, surfaceFormat, renderTargetUsage, usage, true, loadedCallback); if (!initSuccess) { return(false); } try { if (usage == BufferUsages.Write) { Debug.ThrowError("RenderTarget", "Only Textures may be writable"); } uint frameBufferTEMP = 0; GL.GenFramebuffers(1, &frameBufferTEMP); frameBuffer = frameBufferTEMP; uint error; string errorName; if (Video.checkForError(out error, out errorName)) { Debug.ThrowError("RenderTarget", string.Format("{0} {1}: Failed to create renderTarget", error, errorName)); } } catch (Exception e) { FailedToLoad = true; Loader.AddLoadableException(e); Dispose(); if (loadedCallback != null) { loadedCallback(this, false); } return(false); } Loaded = true; if (loadedCallback != null) { loadedCallback(this, true); } return(true); }