This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
en:guides:beginners:viewport_and_camera [2024/11/17 02:31 (10 months ago)] – Fixes and alignment to newer orx. sausage | en:guides:beginners:viewport_and_camera [2025/08/20 09:40 (3 weeks ago)] (current) – updated the example to reflect the current template lattay | ||
---|---|---|---|
Line 53: | Line 53: | ||
</ | </ | ||
- | The viewport needs to be created when our game runs, so let's take a look at the MyGame.cpp code: | + | The viewport needs to be created when our game runs, so let's take a look at the MyGame.c code (for a C++ project, look for '' |
- | <code=cpp> | + | <code=c> |
orxSTATUS orxFASTCALL Init() | orxSTATUS orxFASTCALL Init() | ||
{ | { | ||
- | | + | ... |
+ | orxConfig_PushSection(" | ||
+ | |||
+ | for(orxS32 i = 0, iCount = orxConfig_GetListCount(" | ||
+ | { | ||
+ | | ||
+ | } | ||
</ | </ | ||
- | Nice and simple. Our project already has this added. The Init() | + | Here the ''" |
+ | <code ini> | ||
+ | [Main] | ||
+ | ViewportList | ||
+ | </ | ||
+ | |||
+ | You could also called '' | ||
+ | < | ||
+ | orxSTATUS orxFASTCALL | ||
+ | { | ||
+ | |||
+ | ... | ||
+ | |||
+ | orxViewport_CreateFromConfig(" | ||
+ | |||
+ | </ | ||
+ | The Init() function runs once when your game first executes, and this is where the viewport is created. | ||
The " | The " |