You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System: windows。
I used. net to create a win32 handle in Avalonia, then created a window using SFML and embedded it into the Avalonia form. The rendering and drawing are all normal, but the SFML form cannot receive any events. Is there anything that needs to be set?
publicpartialclassMainWindow:Window{publicMainWindow(){InitializeComponent();this.Loaded+=MainWindow_Loaded;}privatevoidMainWindow_Loaded(object?sender,Avalonia.Interactivity.RoutedEventArgse){varwindow=[new](http://www.google.com/search?q=new+msdn.microsoft.com) SFML.Graphics.RenderWindow(windowBox.Handle);// window.KeyPressed += Window_KeyPressed;window.MouseMoved+=Window_MouseMoved;;var circle =[new](http://www.google.com/search?q=new+msdn.microsoft.com) SFML.Graphics.CircleShape(100f){FillColor=SFML.Graphics.Color.Blue,Position=[new](http://www.google.com/search?q=new+msdn.microsoft.com) Vector2f(500,500)};window.Draw(circle);// Finally, display the rendered frame on screenwindow.Display();}
private voidWindow_MouseMoved(object?sender,SFML.Window.MouseMoveEventArgse){//Can In it}}
public class NativeEmbeddingControl : NativeControlHost
{
public IntPtr Handle {get; private set;}
protected override IPlatformHandle CreateNativeControlCore(IPlatformHandleparent){
var handle =base.CreateNativeControlCore(parent);
Handle = handle.Handle;
Console.WriteLine($"Handle : {Handle}");return handle;}}
The text was updated successfully, but these errors were encountered:
Thank you, I suspect that this issue is related to creating windows from existing native handles, and it may not be just a problem with C # binding usage. Perhaps using Qt to embed SFML window also has this issue.
And this issue has also appeared to some extent in another multimedia library (SDL).
System: windows。
I used. net to create a win32 handle in Avalonia, then created a window using SFML and embedded it into the Avalonia form. The rendering and drawing are all normal, but the SFML form cannot receive any events. Is there anything that needs to be set?
The text was updated successfully, but these errors were encountered: