-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SkiaSharp restores OpenTK libraries not compatible with net 5.0 #1803
Comments
You need to install GLWpfControl v4.1.0:
You may also need to downgrade OpenTK to [4.3, 4.4]. |
There actually is an updated version of GLControl. You can find it here: It's a "prerelease" but it's been stable since we released it so you can think of it like a release candidate. |
Does it support WPF?
令和3年10月28日(木) 8:45 Julius Häger ***@***.***>:
… There actually is an updated version of GLControl. You can find it here:
https://www.nuget.org/packages/OpenTK.WinForms/4.0.0-pre.6
https://github.com/opentk/GLControl
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1803 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABYXW5MMJQCQSXCJRDE4V53UJCMKFANCNFSM5DW6Z2TA>
.
|
If you are looking for a Wpf control GLWpfControl is the best option. I think that GLControl will have the airspace issue when used in a WindowsFormsHost. But I'm not sure. |
I have included that package but still get the warning... |
@mattleibow This is a bigger problem for SkiaSharp.Views.WindowsForms 3.0.0-preview.x since previously SkiaSharp could be used in a WinForms app by referencing SkiaSharp.Views.Desktop.Common. But the Extensions have now been moved to SkiaSharp.Views.WindowsForms, which leads to NU1701 if attempting to use it (it resolves to net462 rather than net7.0-windows10.0.19041). |
@dbowser Did you ever find a solution to this? I'm facing the same issue, is there a workaround for this now several years later? |
@andersforsgren I use SkiaSharp.Views.Desktop.Common (which doesn't bring in OpenTK) and then wrote my own custom control using OpenTK.Graphics. It's not a lot of code to roll your own, but the OpenTK bindings leave a lot to be desired (esp. with ANGLE). |
@jeremy-visionaid what about the OpenTK bindings are lacking? |
@NogginBops Oh dear. I didn't spot you on the chain here. Now I feel bad for being harsh. I'm grateful that I was able to build upon your work which made all this stuff possible to begin with. So, please accept my apologies. I'd thought about opening a PR to address some of the stuff but it would have broken/altered the public API for OpenTK, so I just redefined some stuff internally to make things easier and ship on time. So, some things that I would have in OpenTK that would have helped with my task: Firstly, IIRC some of the constant names that are defined don't match the upstream definitions. I don't recall exactly which ones they were, but I recall it making it hard to write against the extensions because of discrepancies. Secondly, not all the required constants are defined. I'm happy to paste some of them here, but it's not exhaustive (unless I've missed something, stuff like EGL_NO_CONTEXT etc. are also not present):
Lastly, the app I'm working on aims to be high performance and low latency, so I'd prefer bindings that accept spans instead of arrays. Not exactly a problem for EGL I know, but with netstandard2.1 and later I'd think that would be the most favourable signature to work against. |
No, sadly we gave up and used a commercial library instead. After not seeing this addressed, we didn't have the confidence to use the package. |
@jeremy-visionaid It's fine being harsh, getting feedback is important and often the most important feedback never gets where it needs to. If you have time it would be great if you could open an issue or two about what you would like to see be different. Even if it can't be solved in OpenTK 4 (which it very well might be) we could make sure we have things fixed for OpenTK 5. I have recently been using the OpenTK EGL bindings in combination with ANGLE for the new OpenTK 5 platform support and while doing that work I've also noted that some of the constants are missing. I've created a PR with the fixes I had in my working branch #1732, would be really appreciated if you could comment the list of missing constants that you found so I could add them. :) As for spans, it would be totally reasonable to add span overloads to the EGL functions, if you could open an issue about this so I can remember to do it. As for the OpenTK 4 OpenGL bindings it's quite a bit more work to make that happen. OpenTK 5 has a new bindings generator which generate span overloads, so that is something atleast. |
@NogginBops Thats, awesome, thanks for being so responsive. I'd happily look to port to the preview and try and get some feedback/PRs on it if there are problems so I can remove the extra bits from my project. 👍 @dbowser I'm sorry to hear that you had to target something else. I've generally found SkiaSharp to be really good, but admitedly there can be a bit of manual effort to get things off the ground for hardware acceleration for instance. I'd love to see the Direct3D back-end finished off and merged (#2817), then I wouldn't even need OpenGL. |
@jeremy-visionaid I created this PR from this discussion opentk/opentk#1732 but I think I forgot to link or tag you in the issue, so if you are still able to produce a list of missing constants that would be fantastic! |
@NogginBops I'm sorry I've been too bogged down in other urgent work to get to look at OpenTK 5 yet, but I'll certainly take a look at the PR and comment there. Thanks again! |
I am not sure what the best solution is here since there is no stable opentk GL control for winforms. The nuget warning is just a warning and I think if you explicitly reference it and add a nowarn to the package reference then it may just keep working. An alternative is for us to move to 4.x, but we probably will need a stable version of those packages. Is there any technical reason why it is not stable? Or is it more that there is no active development on it? For wpf we merged a PR to move the net7+ things to the 4.x series because we got a stable version. If this is really something that people need for net8 and the warning is super bad for some reason, then maybe getting the GL control stable and in a state where those maintainers are comfortable releasing is the next step here? I think the 3.x series works, but a warning is not ideal and it is not maintained much I think? |
A stable skia nuget depending on a prerelease nuget may be totally fine, but it may scare some companies more that a warning which they may just be ignoring... We could potentially keep netfx on 3 and move net7+ to 4 and live with the fact that scared enterprises will still be on netfx and never know but the young and hip netcore-ers are always on the edge. But, I will need to talk to people. If I was independent, then I could do it, but I got managers and scared enterprises who know those managers :) |
@NogginBops is there a reason the stable preview is not a stable nuget? If you are thinking that it is good and nothing terrible has happened, would be some way to go stable in the near-ish future? We could start the process today and make preview 3.x skia depend on preview 4.x winforms. I want to release stable in time for .net conf, but I got a baby coming this months so who knows. I will try to get stable, but maybe it will be in the new year once all the celebrations stop and then we can start the new year with stable. We shall see, but if opentk is open to going stable in the next 6 months or so then I think this could be a plan? |
I've been meaning to release a release version of the package for quite a while, we've not gotten a lot of bug reports about the current prerelease version for the almost a year it's been out. I'll see if I'm able to release a stable version of the package today. The package will have the same old name |
@mattleibow I just released If you have any issues with it please open an issue about it https://github.com/opentk/GLControl/issues/new |
@NogginBops cool! I'll make a PR to update skia to use the new version on new dotnet. Thanks. |
Merge the PR and trying to get it out in a preview 5 |
I'm using SkiaSharp on Windows. My project is targeting net5.0. When I restore SkiaSharp nuget package this is the warning I get:
Warning NU1701: Package 'OpenTK 3.1.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net5.0-windows7.0'. This package may not be fully compatible with your project.
Warning NU1701: Package 'OpenTK.GLControl 3.1.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net5.0-windows7.0'. This package may not be fully compatible with your project.
I know OpenTK library is already updated to work with net 5.0 but I do not see OpenTK.GLControl being updated any more.
The question is if we OpenTK.GLControl can be removed from SkiaSharp or replaced with some other control? Also can OpenTK dependency be updated to newer version targeting net 5.0? I know I can do that directly in my project but it would be nice to have that directly from the nuget package.
The text was updated successfully, but these errors were encountered: