User Tools

Site Tools


Empty Scroll Project

Please note that soon, the Init project script will allow you to create empty Scroll projects for you.

Don't skip on An Introduction to Scroll and on The Binding of Objects.

The following code represents minimalistic Scroll based application that can be used as a template.


MyOrxScrollGame.h must have Init and Run methods:

#ifndef __GameName__OrxScroll__
#define __GameName__OrxScroll__
#define __NO_SCROLLED__
#include "Scroll.h"
class MyOrxScrollGame : public Scroll<MyOrxScrollGame>
    //! Initialize the program
    virtual orxSTATUS Init ();
    //! Callback called every frame
    virtual orxSTATUS Run ();
#endif /* defined(__GameName__OrxScroll__) */


Due to inline code in headers, it is difficult to separate main function into its own file. So it is part of MyOrxScrollGame.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;

INI File

INI file must have MainViewport section:

ScreenWidth   = 1024
ScreenHeight  = 768
Title         = Game Name
SetList = MainInput
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)

en/tutorials/community/sergeig/scroll0.txt · Last modified: 2018/07/17 14:12 (2 years ago) (external edit)