PicoGK Viewer #27
-
Hello, I plan to develop a UI for the PicoGK. For that purpose I am working with Blazor in Visual Studio. The first challenge is to embed PicoGK Viewer window inside webview. In my current implementation, PicoGK Viewer opens in a separate window. I was wondering if it is possible that PicoGK Viewer opens inside a Blazor component (i.e. viewer is embedded in the web browser )? Any guide or hint is welcome. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
This is not going to be trivial. The PicoGK viewer uses GLFW to provide access to a generic operating system window. You could see, if you could somehow gain access to a Window handle of your Blazor compoinent, provided, it actually uses an OS window (and not its own windowing system inside the browser window, which I suspect). If you can get access to the OS window handle, you could attempt to child the GLFW window to this handle. Again, not a trivial undertaking. The other thing you could do is get rid of the PicoGK viewer and re-implement it using WebGL, rendering the triangles. There's a lot of functionality in the viewer, but most of it is implemented outside the C++ part. To replace the PicoGK viewer you would need to pass keystrokes, mouse movements, render triangle meshes, render polylines, set the global view matrix, and be able to set the individual group matrices of each viewer group (which is used for animated objects). Have a look at the C++ code for the viewer here: https://github.com/leap71/PicoGKRuntime/blob/main/Source/PicoGKGLViewer.h It is not super complex, because I tried to keep it quite generic, but it's also not trivial. What I am currently looking at is using Avalonia for a viewer framework. Best, |
Beta Was this translation helpful? Give feedback.
-
I had not opportunity to work with Viewer, however, I have developed a few dialog boxes. Here is how Cylinder dialog box looks. blazor.mp4Cheers |
Beta Was this translation helpful? Give feedback.
This is not going to be trivial. The PicoGK viewer uses GLFW to provide access to a generic operating system window. You could see, if you could somehow gain access to a Window handle of your Blazor compoinent, provided, it actually uses an OS window (and not its own windowing system inside the browser window, which I suspect). If you can get access to the OS window handle, you could attempt to child the GLFW window to this handle. Again, not a trivial undertaking.
The other thing you could do is get rid of the PicoGK viewer and re-implement it using WebGL, rendering the triangles. There's a lot of functionality in the viewer, but most of it is implemented outside the C++ part. To replace…