{"id":167245,"date":"2013-01-28T12:21:05","date_gmt":"2013-01-28T08:21:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=167245"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=167245","title":{"rendered":"<span class=\"post_title\">\u041f\u0435\u0440\u0435\u0432\u043e\u0434 SDL Game Framework Series. \u0427\u0430\u0441\u0442\u044c 3 \u2014 SDL Events<\/span>"},"content":{"rendered":"<div class=\"content html_format\">       \u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0433\u0440 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (<i>Events<\/i>). \u0412\u0441\u0435 \u0432\u0438\u0434\u0435\u043e\u0438\u0433\u0440\u044b, \u043e\u0442 \u0442\u0435\u043d\u043d\u0438\u0441\u0430 \u0434\u043e \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0438\u0433\u0440 \u0434\u043b\u044f \u041f\u041a \u0438 \u043a\u043e\u043d\u0441\u043e\u043b\u0435\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0442.\u043d. \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0438\u0433\u0440\u043e\u043a\u043e\u043c. \u042d\u0442\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043e\u0442 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440, \u043c\u044b\u0448\u0435\u0439, \u0434\u0436\u043e\u0439\u0441\u0442\u0438\u043a\u043e\u0432, \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u043e\u0432, \u0438 \u0442.\u0434., \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442 \u0441\u0430\u043c\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u0438\u0433\u0440\u043e\u0439. \u041c\u044b \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u043a\u043d\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0433\u043b\u0443\u0431\u0436\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041a\u0430\u043a \u0432\u044b \u0443\u0436\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0440\u043e\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043a\u0430 \u043e\u0442\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043e\u0442 \u044d\u0442\u043e\u0439 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0438. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441. \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 <i>CEvent.h<\/i> \u0438 <i>CEvent.cpp<\/i>. \u0412 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u041d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 <i>CApp<\/i> \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043d\u0430\u0447\u043d\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <i>CEvent.h<\/i> \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">CEvent.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#ifndef _CEVENT_H_     #define _CEVENT_H_   #include &lt;SDL.h&gt;   class CEvent {     public:         CEvent();           virtual ~CEvent();           virtual void OnEvent(SDL_Event* Event);           virtual void OnInputFocus();           virtual void OnInputBlur();           virtual void OnKeyDown(SDLKey sym, SDLMod mod, Uint16 unicode);           virtual void OnKeyUp(SDLKey sym, SDLMod mod, Uint16 unicode);           virtual void OnMouseFocus();           virtual void OnMouseBlur();           virtual void OnMouseMove(int mX, int mY, int relX, int relY, bool Left,bool Right,bool Middle);           virtual void OnMouseWheel(bool Up, bool Down);    \/\/Not implemented           virtual void OnLButtonDown(int mX, int mY);           virtual void OnLButtonUp(int mX, int mY);           virtual void OnRButtonDown(int mX, int mY);           virtual void OnRButtonUp(int mX, int mY);           virtual void OnMButtonDown(int mX, int mY);           virtual void OnMButtonUp(int mX, int mY);           virtual void OnJoyAxis(Uint8 which, Uint8 axis, Sint16 value);           virtual void OnJoyButtonDown(Uint8 which, Uint8 button);           virtual void OnJoyButtonUp(Uint8 which, Uint8 button);           virtual void OnJoyHat(Uint8 which, Uint8 hat, Uint8 value);           virtual void OnJoyBall(Uint8 which, Uint8 ball, Sint16 xrel, Sint16 yrel);           virtual void OnMinimize();           virtual void OnRestore();           virtual void OnResize(int w,int h);           virtual void OnExpose();           virtual void OnExit();           virtual void OnUser(Uint8 type, int code, void* data1, void* data2); };   #endif <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0435\u0445\u0438\u043b\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043a\u043b\u0430\u0441\u0441? \u041d\u0443 \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <i>CEvent.cpp<\/i>, \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">CEvent.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;CEvent.h&quot;   CEvent::CEvent() { }   CEvent::~CEvent() {     \/\/Do nothing }   void CEvent::OnEvent(SDL_Event* Event) {     switch(Event-&gt;type) {         case SDL_ACTIVEEVENT: {             switch(Event-&gt;active.state) {                 case SDL_APPMOUSEFOCUS: {                     if ( Event-&gt;active.gain )    OnMouseFocus();                     else                OnMouseBlur();                       break;                 }                 case SDL_APPINPUTFOCUS: {                     if ( Event-&gt;active.gain )    OnInputFocus();                     else                OnInputBlur();                       break;                 }                 case SDL_APPACTIVE:    {                     if ( Event-&gt;active.gain )    OnRestore();                     else                OnMinimize();                       break;                 }             }             break;         }           case SDL_KEYDOWN: {             OnKeyDown(Event-&gt;key.keysym.sym,Event-&gt;key.keysym.mod,Event-&gt;key.keysym.unicode);             break;         }           case SDL_KEYUP: {             OnKeyUp(Event-&gt;key.keysym.sym,Event-&gt;key.keysym.mod,Event-&gt;key.keysym.unicode);             break;         }           case SDL_MOUSEMOTION: {             OnMouseMove(Event-&gt;motion.x,Event-&gt;motion.y,Event-&gt;motion.xrel,Event-&gt;motion.yrel,(Event-&gt;motion.state&SDL_BUTTON(SDL_BUTTON_LEFT))!=0,(Event-&gt;motion.state&SDL_BUTTON(SDL_BUTTON_RIGHT))!=0,(Event-&gt;motion.state&SDL_BUTTON(SDL_BUTTON_MIDDLE))!=0);             break;         }           case SDL_MOUSEBUTTONDOWN: {             switch(Event-&gt;button.button) {                 case SDL_BUTTON_LEFT: {                     OnLButtonDown(Event-&gt;button.x,Event-&gt;button.y);                     break;                 }                 case SDL_BUTTON_RIGHT: {                     OnRButtonDown(Event-&gt;button.x,Event-&gt;button.y);                     break;                 }                 case SDL_BUTTON_MIDDLE: {                     OnMButtonDown(Event-&gt;button.x,Event-&gt;button.y);                     break;                 }             }             break;         }           case SDL_MOUSEBUTTONUP:    {             switch(Event-&gt;button.button) {                 case SDL_BUTTON_LEFT: {                     OnLButtonUp(Event-&gt;button.x,Event-&gt;button.y);                     break;                 }                 case SDL_BUTTON_RIGHT: {                     OnRButtonUp(Event-&gt;button.x,Event-&gt;button.y);                     break;                 }                 case SDL_BUTTON_MIDDLE: {                     OnMButtonUp(Event-&gt;button.x,Event-&gt;button.y);                     break;                 }             }             break;         }           case SDL_JOYAXISMOTION: {             OnJoyAxis(Event-&gt;jaxis.which,Event-&gt;jaxis.axis,Event-&gt;jaxis.value);             break;         }           case SDL_JOYBALLMOTION: {             OnJoyBall(Event-&gt;jball.which,Event-&gt;jball.ball,Event-&gt;jball.xrel,Event-&gt;jball.yrel);             break;         }           case SDL_JOYHATMOTION: {             OnJoyHat(Event-&gt;jhat.which,Event-&gt;jhat.hat,Event-&gt;jhat.value);             break;         }         case SDL_JOYBUTTONDOWN: {             OnJoyButtonDown(Event-&gt;jbutton.which,Event-&gt;jbutton.button);             break;         }           case SDL_JOYBUTTONUP: {             OnJoyButtonUp(Event-&gt;jbutton.which,Event-&gt;jbutton.button);             break;         }           case SDL_QUIT: {             OnExit();             break;         }           case SDL_SYSWMEVENT: {             \/\/Ignore             break;         }           case SDL_VIDEORESIZE: {             OnResize(Event-&gt;resize.w,Event-&gt;resize.h);             break;         }           case SDL_VIDEOEXPOSE: {             OnExpose();             break;         }           default: {             OnUser(Event-&gt;user.type,Event-&gt;user.code,Event-&gt;user.data1,Event-&gt;user.data2);             break;         }     } }   void CEvent::OnInputFocus() {     \/\/Pure virtual, do nothing }   void CEvent::OnInputBlur() {     \/\/Pure virtual, do nothing }   void CEvent::OnKeyDown(SDLKey sym, SDLMod mod, Uint16 unicode) {     \/\/Pure virtual, do nothing }   void CEvent::OnKeyUp(SDLKey sym, SDLMod mod, Uint16 unicode) {     \/\/Pure virtual, do nothing }   void CEvent::OnMouseFocus() {     \/\/Pure virtual, do nothing }   void CEvent::OnMouseBlur() {     \/\/Pure virtual, do nothing }   void CEvent::OnMouseMove(int mX, int mY, int relX, int relY, bool Left,bool Right,bool Middle) {     \/\/Pure virtual, do nothing }   void CEvent::OnMouseWheel(bool Up, bool Down) {     \/\/Pure virtual, do nothing }   void CEvent::OnLButtonDown(int mX, int mY) {     \/\/Pure virtual, do nothing }   void CEvent::OnLButtonUp(int mX, int mY) {     \/\/Pure virtual, do nothing }   void CEvent::OnRButtonDown(int mX, int mY) {     \/\/Pure virtual, do nothing }   void CEvent::OnRButtonUp(int mX, int mY) {     \/\/Pure virtual, do nothing }   void CEvent::OnMButtonDown(int mX, int mY) {     \/\/Pure virtual, do nothing }   void CEvent::OnMButtonUp(int mX, int mY) {     \/\/Pure virtual, do nothing }   void CEvent::OnJoyAxis(Uint8 which,Uint8 axis,Sint16 value) {     \/\/Pure virtual, do nothing }   void CEvent::OnJoyButtonDown(Uint8 which,Uint8 button) {     \/\/Pure virtual, do nothing }   void CEvent::OnJoyButtonUp(Uint8 which,Uint8 button) {     \/\/Pure virtual, do nothing }   void CEvent::OnJoyHat(Uint8 which,Uint8 hat,Uint8 value) {     \/\/Pure virtual, do nothing }   void CEvent::OnJoyBall(Uint8 which,Uint8 ball,Sint16 xrel,Sint16 yrel) {     \/\/Pure virtual, do nothing }   void CEvent::OnMinimize() {     \/\/Pure virtual, do nothing }   void CEvent::OnRestore() {     \/\/Pure virtual, do nothing }   void CEvent::OnResize(int w,int h) {     \/\/Pure virtual, do nothing }   void CEvent::OnExpose() {     \/\/Pure virtual, do nothing }   void CEvent::OnExit() {     \/\/Pure virtual, do nothing }   void CEvent::OnUser(Uint8 type, int code, void* data1, void* data2) {     \/\/Pure virtual, do nothing } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u0430\u2026 \u041e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u043e \u0432\u0441\u0435 <i>SDL<\/i> \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u044b (\u0442.\u0435. \u043a\u0430\u043a-\u0442\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f). \u0412 \u044d\u0442\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435, \u043c\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0442\u0438\u043f\u0430 <i>SDL_Event<\/i>, \u0430 \u0437\u0430\u0442\u0435\u043c, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0438\u0434\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f (\u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043c\u044b\u0448\u0438) \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u041d\u0435 \u043f\u0443\u0433\u0430\u0439\u0442\u0435\u0441\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 \u043a\u043e\u0434\u0430, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0442\u0443\u0442 \u0432\u0441\u0451 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0451 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 <i>CApp.h<\/i> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">CApp.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#ifndef _CAPP_H_     #define _CAPP_H_   #include &lt;SDL.h&gt;   #include &quot;CEvent.h&quot; #include &quot;CSurface.h&quot;   class CApp : public CEvent {     private:         bool            Running;           SDL_Surface*    Surf_Display;           SDL_Surface*    Surf_Test;       public:         CApp();           int OnExecute();       public:         bool OnInit();           void OnEvent(SDL_Event* Event);           void OnLoop();           void OnRender();           void OnCleanup(); };   #endif <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0435\u0433\u043e \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0438\u0433\u0440\u044b. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <i>CApp_OnEvent.cpp<\/i> \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">CApp_OnEvent.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;CApp.h&quot;   void CApp::OnEvent(SDL_Event* Event) {     CEvent::OnEvent(Event); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441 \u0438 \u0442\u0430\u043c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f. \u041d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430. \u041c\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u043e\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 <i>SDL_Quit<\/i>, \u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0421\u043d\u043e\u0432\u0430 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <i>CApp.h<\/i> \u0441\u043d\u043e\u0432\u0430, \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">CApp.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#ifndef _CAPP_H_     #define _CAPP_H_   #include &lt;SDL.h&gt;   #include &quot;CEvent.h&quot; #include &quot;CSurface.h&quot;   class CApp : public CEvent {     private:         bool            Running;           SDL_Surface*    Surf_Display;           SDL_Surface*    Surf_Test;       public:         CApp();           int OnExecute();       public:         bool OnInit();           void OnEvent(SDL_Event* Event);           void OnExit();            void OnLoop();           void OnRender();           void OnCleanup(); };   #endif <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <i>OnExit<\/i> \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 <i>SDL_Quit<\/i> (\u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043a\u0440\u0435\u0441\u0442\u0438\u043a\u0430). \u0418\u0442\u0430\u043a, \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <i>CApp_OnEvent.cpp<\/i>, \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">CApp_OnEvent.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;CApp.h&quot;   void CApp::OnEvent(SDL_Event* Event) {     CEvent::OnEvent(Event); }   void CApp::OnExit() {     Running = false; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0439\u0442\u0435, \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u0430\u043a \u0438 \u0440\u0430\u043d\u044c\u0448\u0435.<br \/>  \u042f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432\u0430\u043c \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0432\u0438\u0434\u0430\u043c\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043d\u0438\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u0445, \u043f\u043e\u0442\u043e\u043c\u0443-\u0447\u0442\u043e \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 \u043d\u0430\u0448\u0438\u0445 \u0438\u0433\u0440\u0430\u0445.<br \/>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0443\u0440\u043e\u043a\u0435 \u043d\u0430\u0441 \u0436\u0434\u0435\u0442 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435, \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430\u0448\u0443 \u043f\u0435\u0440\u0432\u0443\u044e \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u0433\u0440\u0443 \u2014 <i>Tic-Tac-Toe<\/i> (\u041a\u0440\u0435\u0441\u0442\u0438\u043a\u0438\/\u041d\u043e\u043b\u0438\u043a\u0438).<br \/>  \u041a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0443\u0440\u043e\u043a, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0435\u043c \u043a\u043e\u0434\u0430. \u0412\u0438\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043c\u043d\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043b\u0430\u0432\u0438\u0448 <i>UP<\/i>, <i>DOWN<\/i>, <i>RIGHT<\/i> \u0438 <i>LEFT<\/i> (\u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043a\u0438).<\/p>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <i>CEvent.cpp<\/i>, \u043d\u0430\u0439\u0434\u0438\u0442\u0435 \u0442\u0430\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>CEvent::OnKeyDown<\/i> \u0438 \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043d\u0435\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">CEvent.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0444\u0430\u0439\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435  <\/p>\n<pre><code class=\"cpp\">#include &lt;iostream&gt; using namespace std; <\/code><\/pre>\n<p>  \u0410 \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0438\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b <i>CEvent::OnKeyDown<\/i>  <\/p>\n<pre><code class=\"cpp\">void CEvent::OnKeyDown(SDLKey sym, SDLMod mod, Uint16 unicode) {     switch (sym)     {         case SDLK_ESCAPE:         {             cout &lt;&lt; &quot;Hey, HABR! Escape pressed by m0sk1t\\n&quot;;             break;         }         case SDLK_UP:         {             cout &lt;&lt; &quot;Hey, HABR! UP pressed by m0sk1t\\n&quot;;             break;         }         case SDLK_DOWN:         {             cout &lt;&lt; &quot;Hey, HABR! DOWN pressed by m0sk1t\\n&quot;;             break;         }         case SDLK_LEFT:         {             cout &lt;&lt; &quot;Hey, HABR! LEFT pressed by m0sk1t\\n&quot;;             break;         }         case SDLK_RIGHT:         {             cout &lt;&lt; &quot;Hey, HABR! RIGHT pressed by m0sk1t\\n&quot;;             break;         }         default: break;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0442\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u043d\u0430\u0436\u0438\u043c\u0430\u0439\u0442\u0435 \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043a\u0438 \u0438 \u0437\u0430\u043a\u0440\u043e\u0439\u0442\u0435 \u043e\u043a\u043d\u043e \u0438\u0433\u0440\u044b. \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u044d\u0442\u043e:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/e67\/079\/7d0\/e670797d0e1edcad1fe9646fa0004754.png\"\/><br \/>  \u0412\u0438\u0434\u0438\u0442\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434? \u041e\u043d \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>CEvent::OnKeyDown<\/i> \u043c\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u043c \u0444\u0430\u043a\u0442 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u0435\u043a \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a\u0430\u044f \u0438\u0437 \u043d\u0438\u0445 \u0431\u044b\u043b\u0430 \u043d\u0430\u0436\u0430\u0442\u0430 (\u043d\u0443 \u0438 \u043a\u043b\u0430\u0432\u0438\u0448\u0430 <i>Escape<\/i> \u0442\u0443\u0434\u0430 \u043f\u043e\u043f\u0430\u043b\u0430).<\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0432\u0441\u0435 \u0443\u0440\u043e\u043a\u0438:  <\/p>\n<ul>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/166875\/\">\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0444\u0440\u044d\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u0427\u0430\u0441\u0442\u044c 1 \u2014 \u041e\u0441\u043d\u043e\u0432\u044b SDL<\/a><\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/167035\/\">\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0444\u0440\u044d\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u0427\u0430\u0441\u0442\u044c 2 \u2014 \u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435<\/a><\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/167245\/\">\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0444\u0440\u044d\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u0427\u0430\u0441\u0442\u044c 3 \u2014 \u0421\u043e\u0431\u044b\u0442\u0438\u044f<\/a><\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/167245\/\"> http:\/\/habrahabr.ru\/post\/167245\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">       \u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0433\u0440 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (<i>Events<\/i>). \u0412\u0441\u0435 \u0432\u0438\u0434\u0435\u043e\u0438\u0433\u0440\u044b, \u043e\u0442 \u0442\u0435\u043d\u043d\u0438\u0441\u0430 \u0434\u043e \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0438\u0433\u0440 \u0434\u043b\u044f \u041f\u041a \u0438 \u043a\u043e\u043d\u0441\u043e\u043b\u0435\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0442.\u043d. \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0438\u0433\u0440\u043e\u043a\u043e\u043c. \u042d\u0442\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043e\u0442 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440, \u043c\u044b\u0448\u0435\u0439, \u0434\u0436\u043e\u0439\u0441\u0442\u0438\u043a\u043e\u0432, \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u043e\u0432, \u0438 \u0442.\u0434., \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442 \u0441\u0430\u043c\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u0438\u0433\u0440\u043e\u0439. \u041c\u044b \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u043a\u043d\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0433\u043b\u0443\u0431\u0436\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-167245","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/167245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=167245"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/167245\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=167245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=167245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=167245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}