Giter Site home page Giter Site logo

eto.opentk's People

Contributors

cwensley avatar djohns451 avatar itendswithtens avatar j4m3z0r avatar maxvoxel8 avatar philstopford avatar supersimon81 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

eto.opentk's Issues

Consider upgrading to OpenTK 3.1

What I'm told was a miscommunication among the OpenTK developers was resolved a few months ago, and since then they've been accepting PRs with bug fixes and minor changes to the 3.0 branch of their project. A few days ago they prepared a release, and version 3.1 has been made available on NuGet.

The fix I think would be most useful regards creating GL contexts in Windows (a bug prevented RenderDoc from connecting properly), but there are several others. I'm not sure what impact any of them will have on Eto.OpenTK, especially since I know you've mentioned it's in use in at least one commercial project, and in the meantime I imagine the rest of us can use binding redirects, but I think it'd be worth considering an upgrade to the latest OpenTK release if the changes seem acceptable.

Continuous rendering results in random crashes.

For a live renderer i use the following code:

private class ContinuousGlSurface : GLSurface
{
	private const int FrameDelay = 1000 / 60;

	private readonly Stopwatch stopwatch;

	public Action RenderLoop;

	public ContinuousGlSurface(GraphicsMode graphicsMode, int major, int minor, GraphicsContextFlags graphicsContextFlags)
		: base(graphicsMode, major, minor, graphicsContextFlags)
	{
		this.stopwatch = Stopwatch.StartNew();
	}

	protected override void OnDraw(EventArgs args)
	{
		base.OnDraw(args);

		if (this.stopwatch.ElapsedMilliseconds >= ContinuousGlSurface.FrameDelay)
		{
			this.stopwatch.Restart();
			this.RenderLoop();
		}

		this.Invalidate(false);
	}
}

This works flawless.. basically, because it only works properly with either single buffering (due to frameswap glitches), or not using the stopwatch because not using it will results in rendering as fast as your pc can.
So this works till suddenly out of nowhere a random (sometimes after seconds, sometimes after minutes) crash appears:

OpenTK.Graphics.GraphicsContextException: Failed to make context 65537 current. Error: 2004
   at OpenTK.Platform.Windows.WinGLContext.MakeCurrent(IWindowInfo window)
   at OpenTK.Graphics.GraphicsContext.MakeCurrent(IWindowInfo window)
   at Eto.OpenTK.WinForms.WinGLUserControl.MakeCurrent()
   at Eto.OpenTK.Wpf.WpfWinGLSurfaceHandler.MakeCurrent()
   at Eto.OpenTK.Wpf.WpfWinGLSurfaceHandler.UpdateView()
   at Eto.OpenTK.Wpf.WpfWinGLSurfaceHandler.<AttachEvent>b__7_2(Object sender, PaintEventArgs e)
   at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
   at Eto.OpenTK.WinForms.WinGLUserControl.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.UserControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

When searching for that crash, i came across this one: MonoGame/MonoGame#3196
Which looks quite similar.

Add Eto.Gtk implementation

We need to add an implementation for Eto.Gtk, which is the preferred platform vs. Eto.Gtk2 or Eto.Gtk3.

Future plans

Hey @philstopford, I have some things I'd like to discuss regarding this project. I know in the past you have said it would be no problem for me to bring it into the "officially supported" fold, and that's what I'd like to do. Namely, the following:

  • Fork the repo to the picoe organization
  • Rename the project and assemblies to Eto.OpenTK.* (since it only works with OpenTK)
  • Upgrade projects to sdk-style
  • Add Eto.Gtk platform
  • Add nuget packages
  • Add CI builds
  • Add a process where adding a tag will build an official version and publish to nuget

What are your thoughts? Would you like to keep the official repo here, or does this sound okay to you? I'm also open to other ideas if you or anyone else has any.

Black screen on Mac with complex layouts.

I am seeing a black screen appear on the Mac version when I use etoViewport in a complex layout. When exactly the viewport turns black is not clear to me but I think it has something to do with when the viewport has a definite size in the UI when it is first rendered. For example if I make the following small change to TestEtoGl.XamMac/MainForm.cs (running from TestEtoGl.Mac):

screen shot 2017-11-06 at 12 41 32 pm

I see the following:

screen shot 2017-11-06 at 12 36 44 pm

But if I remove the Begin/EndVertical it renders fine. Needless to say this unpredictability makes it very difficult to create layouts.

Compatibility with OpenTK 4.0.0

When I trying to install the Eto.OpenTK 0.1.2 package in a .NET Core 3.1 Eto.Forms application, I get a NuGet warning NU1701 Package 'Eto.OpenTK 0.1.2' 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 '.NETCoreApp, Version = v3.1'. This package may not be fully compatible with your project.

To eliminate this warning, as well as the application startup error (System.IO.FileNotFoundException: 'Could not load file or assembly' OpenTK, Version = 3.0.1.0, Culture = neutral, PublicKeyToken = ...') I tried to update OpenTK to version 4.0.0 in all of projects contained in this repository, having previously changed TargetFramework property in Eto.OpenTK, Eto.OpenTK.Gtk2, Eto.OpenTK.Mac64, Eto.OpenTK.WinForms, Eto.OpenTK.Wpf projects from net45 to netcoreapp3.1. After that, throughout the solution, I updated OpenTK to version 4.0.0.

It turned out that version 4.0.0 lacks the GraphicsMode class (used, for example, in WpfWinGLSurfaceHandler.cs), so the projects could not be rebuilt.

How difficult would it be to move from .NET Framework to .NET Core for this project and move from OpenTK 3.0.1 to 4.0.0 given changes in the new version?

Currently I use Eto.Forms 2.5.6, Eto.Platform.Wpf 2.5.6.

Running XamMac doesn't work

Could not load type of field 'TestEtoGl.TestViewport:polyArray' (6) due to: Could not resolve type with token 01000019 (from typeref, class/assembly OpenTK.Vector3, OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4) assembly:OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4 type:OpenTK.Vector3 member:<none>

Better panning

Hello and thank you for your awesome work with Eto.OpenTK. I use it alot.

I found your implementation of panning to be very sluggish. Especially considering zooming works very well. I made the following improvements to the dragHandler function in the TestViewport class:

float new_X = (ovpSettings.cameraPosition.X - (((float)e.Location.X - x_orig) * ovpSettings.zoomFactor)); 
float new_Y = (ovpSettings.cameraPosition.Y + (((float)e.Location.Y - y_orig) * ovpSettings.zoomFactor));
ovpSettings.cameraPosition = new PointF(new_X, new_Y);
x_orig = e.Location.X;
y_orig = e.Location.Y;

Simply exchanging the arbitray scaling factor in new_X and new_Y for ovpSettings.zoomFactor and updating x_orig and y_orig gives panning a feeling of moving a surface with the mouse. Much more pleasant!

Thank you

Memory leak on GlSurface resize

I am currently using the following nuget packages:

  • Eto.Forms 2.5.2
  • Eto.OpenTK 0.1.2
  • Eto.OpenTK.Wpf 0.1.2
  • Eto.Platform.Wpf 2.5.2
  • OpenTK 3.2.0 (Same behavior when using 3.0.1)

I basicaly have my own layout engine attached, which reacts on window size changes and updates all elements in a PixelLayout container. Everything works so far, however when updating GlSurface.Size additional memory is consumed which is not freed anymore. The impact seems larger on larger sizes.

When just commenting out the assignments of the size, the memory leak is gone.

When using any other control, for example a button, this problem is gone too, so its tied to GlSurface only.

XamMac: breaks when compiling with VisualStudio for Mac

When I'm trying to start the project with the lastest VisualStudio for Mac the XamMac part won't work.
The MonoMac project still works perfect.

The exeption raises in MacGLView8.cs in Line 95: context = new GraphicsContext(mode, windowInfo, major, minor, flags);
It's an OpenTK.Graphics.GraphicsContextException: The specified window isn't an OpenGL window

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.