[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] pygame fullscreen help and joystick hat issue
- To: "pygame-users@xxxxxxxx" <pygame-users@xxxxxxxx>
- Subject: [pygame] pygame fullscreen help and joystick hat issue
- From: Brian Sturk <bsturk@xxxxxxxxxxx>
- Date: Mon, 23 Nov 2020 11:53:09 -0500
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Mon, 23 Nov 2020 12:01:23 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1606150391; bh=YUCkSER3PQ95Qo1C3ovffR3uIEQZi2fzdVjm7juRKgQ=; h=Received:Received:To:From:Subject:Message-ID:Date:MIME-Version: Content-Type; b=VQgaYzbIU3mXAdjpOBz9+AbhCq1tN21JLCWMTHsV4zb/RkiBUW9ir8YUNPy9jswgT Ar9CTsFRgHuoGpnRTw8SAqUNZzrXD6WcIaWcZELZkGxfNPEJH7gx8bL4VRjT+PJjOH a1cfnLjkzdMq7A996H3FFZIjatj0fPLJQQnzoTNocofFOZQ7jX+EeuixSYRcOyUekq kS10cYzBTSvkuPYeqTlcnCA66Nszc9NZ7p6h3c3ljvbe/c4yG6UPBYQifdTC3fmnhG hI+B9zyqJg/N0ozHZjP/u3lHrULi8Yzb0I/gJHw5jVEFTjbM/14HVth3sfqhCHmCMz cHxqgJ/FHUlOw==
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
- User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0
Hello!
I've been using pygame for a very long time in an settop
emulator frontend I've written. It works great, but there's one
thing I haven't been able to do well and I'm looking for ideas
on how I might be able to improve it. The pygame program runs
in fullscreen and launches *other* fullscreen programs. I've
tried many different techniques (different python calls, flags,
etc) for launching to have everything work cleanly and each
thing I've tried has issues.
What I'm doing now is before launching I set my pygame program
to go back to windowed mode before launching the fullscreen
program. This works but is clunky in that it sometimes causes
issues with Windows window focus, timing, etc. The program also
supports pre launching a program before the emulator (and is
done async). This is mostly for joystick/keyboard mapping.
Is anyone else doing stuff like this, and if so how are you
doing it? I use a frontend on my MAME cabinet called
AdvanceMenu which is C++ and uses SDL and it works perfectly and
just calls system().
Any ideas to try would be greatly appreciated.
If it helps, I've put my program here, relevant code starts @
line 1483:
https://www.dropbox.com/s/wq2t2rl6irmbysn/frontend.py?dl=0
Unrelated, there's a specific pygame method, joy.get_hat(),
which seems to have an enabled debug print (it also could be
compiled into the SDL library itself). I tried using a trick I
found online to suppress it by mucking with the file
descriptors, but it didn't seem to help.
Here's a screenshot of it
https://www.dropbox.com/s/dpf0sbydol7fvc5/sdlhat.jpg?dl=0
One of the prints is mine (the one with "DEBUG:"), but the other
is from SDL/pygame. It's not a huge deal, but calling that in
the event loop causes that to show up a LOT and could be a
potential performance thing.
~brian
--
.-------------------------------------------------------.
| Brian Sturk ------- http://www.briansturk.com ------ | .> )\,^a__
|-------------------------. _______ Ethical Hacker ___ |( _ _)/ /-."~
| --- C/C++/Python/ASM `----------------------------| `( )_ )/
| Linux/BSD/OSX/Windows embedded/system programming --- |_<_s_<_s
`-------------------------------------------------------'