Giter VIP home page Giter VIP logo

opentkavalonia's People

Contributors

samboycoding avatar wannkunstbeikor 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

opentkavalonia's Issues

BaseTkOpenGlControl is not taking the correct ScaleFactor on MacOS

The GL.Viewport() in the BaseTkOpenGlControl class should take into account the scale factor of the monitor in order to display correctly on MacOS.

In the below example, the viewport should be scaled by a factor of 2 to work fine :

screen

With OpenTK+ImGUI the below code is used when a window is resized for instance (OpenTK propose a GameWindow.FramebufferSize in order to have the correct value versus the Client size :

        // Update the opengl viewport
        Vector2i fb = this.FramebufferSize;
        GL.Viewport(0, 0, fb.X, fb.Y); // 2048 * 1536 

        // Tell ImGui of the new size
        _controller.WindowResized(ClientSize.X, ClientSize.Y); // 1024 * 768 

I don't know what is the equivalent for OpenTK+Avalonia, that's why I'm opening this issue

request for fork consolitation and and update to run on windows , plus advice maybe

hello, hope you are not too busy there is no urgency ..
This is a minor fix to get this update to work on Windows .its working now with the latest from wannkunstbeikor:OpenTKAvalonia:master.. plus my change for windows via openGL i paste below.

Sorry im not a github expert or a collaborator , i cannot do a PR to a fork of a fork and
I cant even update my own fork because of a recent issue with sponsors (me) email leaking into the nugets or something MSFt is havign a crisis about. i get my push blocked to my own fork in my own vault. so i hoped we could get thisi one running , merged for now

mabye I'll or we can find a more general way.. since id like to support 3d graphics on all the avalonia targets, mobile and webassembly..

for now you ask for a PR from wannkunstbeikor , then take my changes?

to merge

  1. merge from master...wannkunstbeikor:OpenTKAvalonia:master via PR

copy paste thsi below to
program.cs on both samples : and test on non windows..

using System;
using Avalonia;
using System.Collections.ObjectModel;
namespace BasicCubeSample
{

class Program
{
    // Initialization code. Don't use any Avalonia, third-party APIs or any
    // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
    // yet and stuff might break.
    [STAThread]
    public static void Main(string[] args) => BuildAvaloniaApp()
        .StartWithClassicDesktopLifetime(args);

    // Avalonia configuration, don't remove; also used by visual designer.
    public static AppBuilder BuildAvaloniaApp()
    {
      
            //Add this line to set ths to UseWGL:
            return AppBuilder.Configure<App>()
                                  .UsePlatformDetect()
                                  .With(new Win32PlatformOptions{  
                                      RenderingMode=new Collection<Win32RenderingMode> { Win32RenderingMode.Wgl }
                                  }
                                  ).LogToTrace();

        }
     
    }
}
  1. Win32RenderingMode.Wgl to the
    the readme,
4.  fix a warning
   private OpenGlTexture? _brickTexture;   <<--- in the sample to fix a waring about nullable


<<<<<

if you want to know,
why im using this: ( in case you want to advise or have similar goals)

my goal is a IDE hosting a 2d or 3d physics window with docking . Something like a game level editor, with maybe scripting , and avalonia property inspectors and such for now. for mobile and web im not sure if i need avalonai UI next to or inside the 3d graphic, i might use custom UI.. Its much like stride was.

I am testing this for now , the only reason im looking to try to to be using openTK right now , because BepuPhysicsV2 demos are using OpenTK. but that is just on desktops. he supports directx and openGl vis a shaderconductor. i support mobile , and webasssemeby i hope, for a game / scientifici simulation rig based using physics engine and visuallized wiht monogame or something like it. i need just 3d graphics wiht basics shaders, and physics heavy / simulation code/ using a lockless producer consumer pattern.

the only issue wht this demo remain seems to be.. resizing.. havent tried with dockiong yet.. wil report
there may be option im unaware of.. for now desktop mac, windows , pc might be a start...

also looking at this:
https://github.com/wieslawsoltes/AvaloniaInside.MonoGame
https://github.com/wieslawsoltes/Dock
and other avanoliaUI stuff.
or advise me if there s more to do on this...there may be other options now , avalonia does much and thers is silk and ideas from stride.. includes vulcan.. I will ask wieslawsoltes what i should do ultimately buit this might be ok for now..

thanks for making this.. and @wannkunstbeikor for updating it..

Missing license

Greetings
I would like to use this project (or a fork that is more up to date respectively) in an ongoing open-source project of mine.

However, this project is missing a LICENSE.md file, thus making it copyright protected with no permissions whatsoever granted (which I assume, is not the intended purpose).

Could you clarify this, or add a LICENSE.md that grants permission (e.g. MIT, CC, GPL) or explicitly probhits use?

Destroying/recreating the control breaks until resized

Video: https://streamable.com/ttapc8

For some reason, destroying and re-creating the control (as is done in the resizing sample, via a Tab control) breaks something (about the depth buffer? not sure) until the control is resized.

Not sure if the bug is in Avalonia, and I need to do a workaround, if it's in the way the base class sets itself up, or if it's in my subclass in that sample.

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.