• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
1 2 3 4 5 ... 116 Next »

Qt, SDL, EGL and input
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Qt, SDL, EGL and input
03-15-2023, 10:03 AM
#1
elahav Offline
Junior Member
**
Posts: 2
Threads: 1
Joined: Mar 2023
Hello,

I spent a couple of days porting Dolphin to QNX, and I'm at the point of a game rendering properly inside a window. However, I am quite confused as to how input should be handled. Dolphin uses Qt and SDL, each of which has its own notion of a window and of handling input. But for rendering the game I had to create a new native window to host the EGL context. That window is not associated with any event loop.

How is it all supposed to come together? Is there a reason why Dolphin does not use a Qt window for the game? Or an SDL window? Perhaps I got it wrong when creating a new native window, but I don't see which existing window is supposed to be used for rendering. The default `GLContextEGL::GetEGLNativeWindow()` code returns a display cast to a window, which seems odd.

--Elad
Find
Reply
03-16-2023, 02:56 AM
#2
JosJuice Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 8,877
Threads: 7
Joined: Oct 2014
Can't say I'm familiar with how input is handled in QNX, but I can try to provide some context for the Dolphin side of things at least.

Dolphin is architectured in such a way that the implementation of inputs isn't dependent on the frontend code, and vice versa. For instance, if you ran Dolphin 10 years ago or so, you would probably be using the wxWidgets frontend with the DInput input backend, or perhaps the XInput input backend if you were using an Xbox controller. Later, we added a Qt frontend as a replacement for the wxWidgets frontend, and we just brought over all of the existing input backends more or less as-is.

The use of SDL in Dolphin is only for providing an additional input backend. We don't use it for creating windows or anything like that.
Find
Reply
03-16-2023, 07:44 AM
#3
elahav Offline
Junior Member
**
Posts: 2
Threads: 1
Joined: Mar 2023
(03-16-2023, 02:56 AM)JosJuice Wrote: Can't say I'm familiar with how input is handled in QNX, but I can try to provide some context for the Dolphin side of things at least.

Dolphin is architectured in such a way that the implementation of inputs isn't dependent on the frontend code, and vice versa. For instance, if you ran Dolphin 10 years ago or so, you would probably be using the wxWidgets frontend with the DInput input backend, or perhaps the XInput input backend if you were using an Xbox controller. Later, we added a Qt frontend as a replacement for the wxWidgets frontend, and we just brought over all of the existing input backends more or less as-is.

The use of SDL in Dolphin is only for providing an additional input backend. We don't use it for creating windows or anything like that.

Thanks for replying.

My confusion is about the event loop that has to handle the input events. While QNX is very different at the low level from other systems, at the high level it's conceptually the same - there is an event loop that receives the various event types, decodes and handles each. Since dolphin is a Qt application it has a Qt-based event loop, but that will not get the input events for the game window, as that is just a raw native window.

That said, I think I have a path forward - it seems that it is possible to create a separate context and event loop for this window, and that the window manager will dispatch events to the window under focus regardless of the fact that there is another "main" window with a Qt event loop.

--Elad
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode