public GLSurfaceFactory(OpenGLGraphicsAdapter adapter)
                : base(adapter)
            {
                _maxSupportedSamples = Adapter.Invoke(() =>
                {
                    // Query platform for multisample capabilities
                    var allowableSamplesCount = GL.GetInternalformat(RenderbufferFormat.RGBA8, InternalFormatParameter.NUM_SAMPLE_COUNTS, 1)[0];
                    var allowableSamples      = GL.GetInternalformat(RenderbufferFormat.RGBA8, InternalFormatParameter.SAMPLES, allowableSamplesCount);

                    // Get intended max samples, and compare against max allowed on this platform
                    return(allowableSamples[0]);
                });
            }
Exemplo n.º 2
0
        private void Dispose(bool disposeManaged)
        {
            if (!_isDisposed)
            {
                if (disposeManaged)
                {
                    //
                }

                // Schedule for deletion on a GL thread.
                OpenGLGraphicsAdapter.Schedule(() =>
                {
                    Log.Debug($"[Dispose] {GetType().Name} ({Handle}).");
                    GL.DeleteBuffer(Handle);
                });

                _isDisposed = true;
            }
        }
Exemplo n.º 3
0
        private void Dispose(bool disposeManaged)
        {
            if (!_isDisposed)
            {
                if (disposeManaged)
                {
                    // ...
                }

                // Schedule for deletion on a GL thread.
                OpenGLGraphicsAdapter.Schedule(() =>
                {
                    Log.Debug($"[Dispose] Shader Stage ({Handle})");
                    GL.DeleteShader(Handle);
                });

                _isDisposed = true;
            }
        }
Exemplo n.º 4
0
        private void Dispose(bool disposeManaged)
        {
            if (!_isDisposed)
            {
                if (disposeManaged)
                {
                    // nothing
                }

                // Schedule deleting the GL texture resource
                OpenGLGraphicsAdapter.Schedule(() =>
                {
                    Log.Debug($"[Dispose] Texture ({Handle})");
                    GL.DeleteTexture(Handle);
                });

                _isDisposed = true;
            }
        }
Exemplo n.º 5
0
        private void Dispose(bool disposeManaged)
        {
            if (!_isDisposed)
            {
                if (disposeManaged)
                {
                    // Nothing
                }

                // Schedule for deletion on a GL thread.
                OpenGLGraphicsAdapter.Schedule(() =>
                {
                    Log.Debug($"[Dispose] Renderbuffer ({Handle})");
                    GL.DeleteRenderbuffer(Handle);
                });

                _isDisposed = true;
            }
        }
 public GLShaderFactory(OpenGLGraphicsAdapter adapter)
     : base(adapter)
 {
 }
 protected FactoryBase(OpenGLGraphicsAdapter adapter)
 {
     Adapter = adapter ?? throw new ArgumentNullException(nameof(adapter));
 }