User Tools

Site Tools


en:tutorials:community:sergeig:empty-scroll-project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorials:community:sergeig:scroll0 [2017/12/17 16:50 (6 years ago)] – [MyOrxScrollGame.cpp] sausageen: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 2: Line 2:
  
 <WRAP center round box 60%> <WRAP center round box 60%>
-Please note that soon, the [[tutorials:creating_your_own_project|Init project script]] will allow you to create empty Scroll projects for you.+No longer required.The [[en:tutorials:projects:creating_your_own_project|Init project script]] will allow you to create empty Scroll projects for you.
 </WRAP> </WRAP>
- 
- 
-Don't skip on [[tutorials:community:acksys:scroll0|An Introduction to Scroll]] and on [[tutorials:community:acksys:scroll1|The Binding of Objects]]. 
- 
-The following code represents minimalistic Scroll based application that can be used as a template. 
- 
-===== MyOrxScrollGame.h ===== 
- 
-MyOrxScrollGame.h must have Init and Run methods: 
- 
-<code cpp> 
-#ifndef __GameName__OrxScroll__ 
-#define __GameName__OrxScroll__ 
- 
-#define __NO_SCROLLED__ 
-#include "Scroll.h" 
- 
-class MyOrxScrollGame : public Scroll<MyOrxScrollGame> 
-{ 
-private: 
-    //! Initialize the program 
-    virtual orxSTATUS Init (); 
-    //! Callback called every frame 
-    virtual orxSTATUS Run (); 
- 
-}; 
- 
-#endif /* defined(__GameName__OrxScroll__) */ 
-</code> 
- 
-===== MyOrxScrollGame.cpp ===== 
- 
-Due to inline code in headers, it is difficult to separate main function into its own file. So it is part of MyOrxScrollGame.cpp. 
- 
-<code cpp> 
-#define __SCROLL_IMPL__ 
-#include "MyOrxScrollGame.h" 
-#undef __SCROLL_IMPL__ 
- 
-orxSTATUS MyOrxScrollGame::Init () 
-{ 
-    orxSTATUS result = orxSTATUS_SUCCESS; 
-    return result; 
-} 
- 
-orxSTATUS MyOrxScrollGame::Run () 
-{ 
-    orxSTATUS result = orxSTATUS_SUCCESS; 
-     
-    return result; 
-} 
- 
-int main (int argc, char **argv) 
-{ 
-    // Executes game 
-    MyOrxScrollGame::GetInstance().Execute (argc, argv); 
-     
-    // Done! 
-    return EXIT_SUCCESS; 
-} 
- 
-#ifdef __orxWINDOWS__ 
- 
-#include "windows.h" 
- 
-int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) 
-{ 
-    // Executes game 
-    MyOrxScrollGame::GetInstance().Execute (); 
-     
-    // Done! 
-    return EXIT_SUCCESS; 
-} 
- 
-#endif // __orxWINDOWS__ 
-</code> 
- 
-===== INI File ===== 
- 
-INI file must have MainViewport section: 
- 
-<code ini> 
-[Display] 
-ScreenWidth   = 1024 
-ScreenHeight  = 768 
-Title         = Game Name 
- 
-[Input] 
-SetList = MainInput 
- 
-[MainInput] 
-KEY_ESCAPE = Quit 
- 
-[MainViewport] 
-Camera            = Camera 
- 
-[Camera] 
-; We use the same size for the camera than our display on screen so as to obtain a 1:1 ratio 
-FrustumWidth  = @Display.ScreenWidth 
-FrustumHeight = @Display.ScreenHeight 
-FrustumFar    = 1.0 
-FrustumNear  = 0.0 
-Position      = (0.0, 0.0, -1.0) 
-</code> 
- 
-===== Additional Information ===== 
- 
-See [[tutorials:community:sergeig:compile_and_build|Compiling and Building ORX]] for XCode configuration with Scroll. 
en/tutorials/community/sergeig/empty-scroll-project.1513558202.txt.gz · Last modified: 2017/12/17 20:50 (6 years ago) (external edit)