arc13 f7b74f445e Removed MP3 to avoid dependency problems | 7 years ago | |
---|---|---|
external | 7 years ago | |
res | 7 years ago | |
src | 7 years ago | |
test | 7 years ago | |
.gitignore | 7 years ago | |
.gitmodules | 7 years ago | |
CMakeLists.txt | 7 years ago | |
README.md | 7 years ago |
An updated and more complete template to get started with cpp3ds. Don't forget to check the cpp3ds's documentation.
You will need at first the cpp3ds library, whose location must be defined in the environment variable CPP3DS.
To build from source on a Linux/UNIX-based system, run the following commands:
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_EMULATOR=ON -DBUILD_TESTS=ON ..
make -j4
-DCMAKE_BUILD_TYPE can be set to either "Release" or "Debug" (without the quotes):
Release is the mode chosen when you are about to release/update your app, the debugging console on the bottom screen and the FPS counter on the top screen will not be drawn in this mode.
Debug is the mode chosen when you are developing your application, this mode will allow you to see the debugging console and the FPS counter, useful to debug your application.
3DS: The files [project-name].3dsx and [project-name].cia are usable by the 3DS to test your application on the real hardware.
Computer: The file [project-name]-emu is usable to test your application without the needs of install the app on the 3DS.
Note: The emulator can't run libctru's functions.
You can start to dev your app in the States/DefaultState.cpp file, some examples are in this file.
#include <cpp3ds/Graphics/Sprite.hpp>
##ifndef EMULATION
// 3ds.h must ALWAYS be included between ifndef EMULATION too
#include <3ds.h>
##endif
RandomClass::RandomClass()
{
// Random things
cpp3ds::Sprite randomSprite;
randomSprite.setPosition(5.f, 5.f);
cpp3ds::Uint8 systemLanguage = 0;
##ifndef EMULATION
// Here, the code will NOT be compiled for the emulator
// Calling the libctru's function CFGU_GetSystemLanguage
CFGU_GetSystemLanguage(&systemLanguage);
##endif
// Other things
}
L7: project("project-name") - Enter your project name here without space or special characters
L9: APP_TITLE - The title of your app that will appear on the HOME Menu and on other places
L10: APP_DESCRIPTION - The description of your app that will appear on the HOME Menu and on other places
L11: APP_AUTHOR - The author(s) of your app that will appear on the HOME Menu and on other places
L15: APP_VERSION - The version of your app, each update of your app have to see this number incremented, checkout my converter for Linux
L18: APP_UNIQUE_ID - The product ID of your app, must be an hexadecimal value