PCSX2 Documentation/WxWidgets Coding Strategies: Difference between revisions
PCSX2 Documentation/WxWidgets Coding Strategies (view source)
Revision as of 18:09, 25 June 2024
, Tuesday at 18:09Update.
No edit summary |
(Update.) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
<center>{{Warning|<big>'''This guide is outdated as PCSX2 now uses Qt!'''<br/>Please refer to the PCSX2 Discord server if you wish to help with programming.</big>}}</center> | |||
==Guidelines== | ==Guidelines== | ||
The wx-based codebase for PCSX2 is designed to 'lean' heavily on wxWidgets, meaning that PCSX2 will whenever possible use wx-provided tools and classes instead of re-inventing our own. This decision was made as it allows us take full advantage of the cross-platform tools offered by wxWidgets, which ensures more correct behavior on Windows and Linux alike and, in turn makes life simpler for all PCSX2 developers. | The wx-based codebase for PCSX2 is designed to 'lean' heavily on wxWidgets, meaning that PCSX2 will whenever possible use wx-provided tools and classes instead of re-inventing our own. This decision was made as it allows us take full advantage of the cross-platform tools offered by wxWidgets, which ensures more correct behavior on Windows and Linux alike and, in turn makes life simpler for all PCSX2 developers. | ||
Line 88: | Line 89: | ||
</source> | </source> | ||
... So the moral of the story is: Use | ... So the moral of the story is: Use <code>GetEventHandler()</code> when possible (basically anything except the <code>wxApp</code> object), and use <code lang="cpp">AddPendingEvent()</code> unless you need a return code ''and'' know you're on the main GUI thread. | ||
< | |||
when possible (basically anything except the wxApp object), and use | |||
< | |||
unless you need a return code ''and'' know you're on the main GUI thread. | |||
==Guidelines when Using Windows/Linux Specific Code== | ==Guidelines when Using Windows/Linux Specific Code== |