Study on 1.02 main.cpp
// create the application instance
AppDelegate app;
CCEGLView* eglView = CCEGLView::sharedOpenGLView();
eglView->setViewName("Fei");
eglView->setFrameSize(480, 320);
return CCApplication::sharedApplication()->run();
First, static class member functions Cceglview::sharedopenglview
Ccapplication::sharedapplication
This is a class member static function that starts with share
Twosingle-case modeSingleton mode: Once I come in, this pointer (each with a static pointer), if the static pointer is empty, I create directly, not empty I will return directly. Guarantee only one single case
Three, polymorphic subclasses overwrite the virtual function of the parent class
To have a pointer to a child class object
The child pointer is assigned to the parent class, and the parent pointer calls the virtual interface
Four, this water is very deep
Five, AppDelegate.h three big interface virtual bool applicationdidfinishlaunching (); Game Start Interface
virtual void Applicationdidenterbackground (); Home Key Interface
virtual void Applicationwillenterforeground (); //come tothe interface that interrupts the phone when the phone is answered
vi. relations of Appdelegate, Ccapplication and CcapplicationprotocolAppdelegate and Ccapplicationprotocol will never change.
and ccapplication but put the cross-platform things, change is always ccapplication
Design ideas: The top and the bottom are always unchanged, and the middle can always adapt to different things, which may also be the original intention of the proxy model
From for notes (Wiz)
Study on 1.02 main.cpp