This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:orx:tutorials:community:sergeig:scroll0 [2013/05/23 01:32 (11 years ago)] – sergeig | en:tutorials:community:sergeig:empty-scroll-project [2020/08/31 07:00 (4 years ago)] (current) – ↷ Page name changed from en:tutorials:community:sergeig:scroll0 to en:tutorials:community:sergeig:empty-scroll-project sausage | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Empty Scroll Project ====== | ====== Empty Scroll Project ====== | ||
- | Don't skip on [[en:orx:tutorials:community:acksys: | + | <WRAP center round box 60%> |
- | + | No longer required.The | |
- | The following code represents minimalistic Scroll based application that can be used as a template. | + | </WRAP> |
- | + | ||
- | ===== main.cpp ===== | + | |
- | + | ||
- | main.cpp must have %%__SCROLL_IMPL__%% defined in main.cpp. If it is defined outside of main.cpp, then XCode generates linker errors. | + | |
- | + | ||
- | <code c++> | + | |
- | #define __SCROLL_IMPL__ | + | |
- | #include " | + | |
- | #undef __SCROLL_IMPL__ | + | |
- | + | ||
- | int main (int argc, char **argv) | + | |
- | { | + | |
- | // Executes game | + | |
- | OrxScroll:: | + | |
- | + | ||
- | // Done! | + | |
- | return EXIT_SUCCESS; | + | |
- | } | + | |
- | + | ||
- | #ifdef __orxWINDOWS__ | + | |
- | + | ||
- | #include " | + | |
- | + | ||
- | int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, | + | |
- | { | + | |
- | // Executes game | + | |
- | OrxScroll:: | + | |
- | + | ||
- | // Done! | + | |
- | return EXIT_SUCCESS; | + | |
- | } | + | |
- | + | ||
- | #endif // __orxWINDOWS__ | + | |
- | </ | + | |
- | + | ||
- | ===== OrxScroll.h ===== | + | |
- | + | ||
- | OrxScroll.h must have Init and Run methods: | + | |
- | + | ||
- | <code c++> | + | |
- | #ifndef __GameName__OrxScroll__ | + | |
- | #define __GameName__OrxScroll__ | + | |
- | + | ||
- | #define __NO_SCROLLED__ | + | |
- | #include " | + | |
- | + | ||
- | class OrxScroll : public Scroll< | + | |
- | { | + | |
- | private: | + | |
- | //! Initialize the program | + | |
- | virtual orxSTATUS Init (); | + | |
- | //! Callback called every frame | + | |
- | virtual orxSTATUS Run (); | + | |
- | + | ||
- | }; | + | |
- | + | ||
- | #endif /* defined(__GameName__OrxScroll__) */ | + | |
- | </ | + | |
- | + | ||
- | ===== OrxScroll.cpp ===== | + | |
- | + | ||
- | <code c++> | + | |
- | #include " | + | |
- | + | ||
- | orxSTATUS OrxScroll:: | + | |
- | { | + | |
- | orxSTATUS result = orxSTATUS_SUCCESS; | + | |
- | return result; | + | |
- | } | + | |
- | + | ||
- | orxSTATUS OrxScroll:: | + | |
- | { | + | |
- | orxSTATUS result = orxSTATUS_SUCCESS; | + | |
- | return result; | + | |
- | } | + | |
- | </ | + | |
- | + | ||
- | ===== INI File ===== | + | |
- | + | ||
- | INI file must have MainViewport section: | + | |
- | + | ||
- | <code ini> | + | |
- | [Display] | + | |
- | ScreenWidth | + | |
- | ScreenHeight | + | |
- | Title = Game Name | + | |
- | + | ||
- | [Input] | + | |
- | SetList = MainInput | + | |
- | + | ||
- | [MainInput] | + | |
- | KEY_ESCAPE = Quit | + | |
- | + | ||
- | [MainViewport] | + | |
- | Camera | + | |
- | + | ||
- | [Camera] | + | |
- | ; We use the same size for the camera than our display on screen so as to obtain a 1:1 ratio | + | |
- | FrustumWidth | + | |
- | FrustumHeight = @Display.ScreenHeight | + | |
- | FrustumFar | + | |
- | FrustumNear | + | |
- | Position | + | |
- | </ | + | |
- | + | ||
- | ===== XCode 4 Build Configuration ===== | + | |
- | + | ||
- | If all ORX projects | + | |
- | + | ||
- | < | + | |
- | ./GameName/ contains game project | + | |
- | ./orx/ contains orx clone | + | |
- | ./scroll/ contains Scroll clone | + | |
- | </code> | + | |
- | + | ||
- | then the following search paths have to be set: | + | |
- | + | ||
- | 1. Header Search Paths (HEADER_SEARCH_PATHS): | + | |
- | ../ | + | |
- | ../ | + | |
- | 2. Library search paths (LIBRARY_SEARCH_PATHS): | + | |
- | $(inherited) | + | |
- | " | + |