PCSX2 Documentation/The PCSX2 Program Flow: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 7: Line 7:


==Pcsx2App - the part we care about==
==Pcsx2App - the part we care about==
So where does Pcsx2App live? Well, the declarations are in the header file [https://github.com/PCSX2/pcsx2/blob/master/pcsx2/gui/App.h App.h] and the definitions are in a few different files. But let's first take a look at the header file.
So where does Pcsx2App live? Well, the declarations are in the header file [https://github.com/PCSX2/pcsx2/blob/master/pcsx2/gui/App.h App.h] and the definitions are in a few different files. But let's first take a look at this line in the header file:
<source lang=cpp>
<source lang=cpp>
class Pcsx2App : public wxAppWithHelpers{
class Pcsx2App : public wxAppWithHelpers{}
...
}
</source>
</source>
You can see here that the Pcsx2App class is an extension of the wxAppWithHelpers class. WxWidgets applications are defined as classes, which are instantiated into an object when we start the program. Pcsx2App contains methods that wxWidgets is going to call upon at various times. So what gets called when we fire up Pcsx2App? That would be the OnInit() method which is defined in [https://github.com/PCSX2/pcsx2/blob/master/pcsx2/gui/AppInit.cpp AppInit.cpp]. There's all kinds of crazy stuff happening here, but what we really care about is this line:
You can see here that the Pcsx2App class is an extension of the wxAppWithHelpers class. WxWidgets applications are defined as classes, which are instantiated into an object when we start the program. Pcsx2App contains methods that wxWidgets is going to call upon at various times. So what gets called when we fire up Pcsx2App? That would be the OnInit() method which is defined in [https://github.com/PCSX2/pcsx2/blob/master/pcsx2/gui/AppInit.cpp AppInit.cpp]. There's all kinds of crazy stuff happening here, but what we really care about is this line:
<source lang="cpp">
<source lang="cpp">
if( m_UseGUI ) OpenMainFrame();
if( m_UseGUI ) OpenMainFrame();
</source>
</source>
In addition to Application classes, there are also Frame classes. The frame classes define the various GUI parts that we can click on and interact with. This is opening the main pcsx2 window, which is declared in this header file: [https://github.com/PCSX2/pcsx2/blob/master/pcsx2/gui/MainFrame.h MainFrame.h].
In addition to Application classes, there are also Frame classes. The frame classes define the various GUI parts that we can click on and interact with. This is opening the main pcsx2 window, which is declared in this header file: [https://github.com/PCSX2/pcsx2/blob/master/pcsx2/gui/MainFrame.h MainFrame.h].
ninja
782

edits