avalonia-silk.net-example's People
avalonia-silk.net-example's Issues
Issue with Avalonia controls on top of Silk.Net - GL render missing
I made an app using code from example (without changes in GL part).
But when added buttons in the same area where located GL render, only buttons are visible, GL not displaying.
Is it possible to have Avalonia UI controls on top of GL? What should I change in example code, so both will work together?
Render YUVJ420P is abnormal
I use Silk.Net and Avalonia.OpenGL to play the rtsp stream, and add three textures for rendering, but the problem is here, avalonia will occasionally appear the following error:
Avalonia.OpenGL.OpenGlException: Unable to make the context current
at Avalonia.Win32.OpenGl.WglRestoreContext..ctor(IntPtr gc, IntPtr context, Object monitor, Boolean takeMonitor) in /_/src/Windows/Avalonia.Win32/OpenGl/WglRestoreContext.cs:line 27
at Avalonia.Win32.OpenGl.WglContext.MakeCurrent(IntPtr hdc) in /_/src/Windows/Avalonia.Win32/OpenGl/WglContext.cs:line 74
at Avalonia.Win32.OpenGl.WglGlPlatformSurface.RenderTarget.BeginDraw() in /_/src/Windows/Avalonia.Win32/OpenGl/WglGlPlatformSurface.cs:line 47
at Avalonia.Skia.GlRenderTarget.BeginRenderingSession() in /_/src/Skia/Avalonia.Skia/Gpu/OpenGl/GlRenderTarget.cs:line 63
at Avalonia.Skia.SkiaGpuRenderTarget.CreateDrawingContext(IVisualBrushRenderer visualBrushRenderer) in /_/src/Skia/Avalonia.Skia/Gpu/SkiaGpuRenderTarget.cs:line 27
at Avalonia.Rendering.DeferredRenderer.EnsureDrawingContext(IDrawingContextImpl& context) in /_/src/Avalonia.Visuals/Rendering/DeferredRenderer.cs:line 617
at Avalonia.Rendering.DeferredRenderer.UpdateRenderLayersAndConsumeSceneIfNeeded(IDrawingContextImpl& context, Boolean recursiveCall) in /_/src/Avalonia.Visuals/Rendering/DeferredRenderer.cs:line 374
at Avalonia.Rendering.DeferredRenderer.Render(Boolean forceComposite) in /_/src/Avalonia.Visuals/Rendering/DeferredRenderer.cs:line 323
at Avalonia.Rendering.DeferredRenderer.Avalonia.Rendering.IRenderLoopTask.Render() in /_/src/Avalonia.Visuals/Rendering/DeferredRenderer.cs:line 275
at Avalonia.Rendering.RenderLoop.TimerTick(TimeSpan time) in /_/src/Avalonia.Visuals/Rendering/RenderLoop.cs:line 147
My rendering code is as follows:
protected override unsafe void OnOpenGlRender(GlInterface gl, int fb)
{
this._gl.Viewport(0, 0, (uint)Bounds.Width, (uint)Bounds.Height);
//Get YUVJ420P Frame
if (this._playerBase != null && this._playerBase.OutputFrameCache(this._uniqueKey, out var frame))
{
this._texture.Bind(frame, this._shader);
this._shader.Use();
this._vao.Bind();
this._gl.DrawElements(PrimitiveType.Triangles, (uint)_indices.Length, DrawElementsType.UnsignedInt, null);
}
Dispatcher.UIThread.InvokeAsync(InvalidateVisual);
}
Can you tell me what caused this error, thank you very much!!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.