46 [[deprecated(
"Not really intuitive or robust, use your own calculations instead")]]
double getFPS();
void cancelQuit()
Undo quit() or ignore a quit event caused by the user closing the main window.
double getFPS()
Calculates FPS if called once per frame.
bool getVerticalSync()
Returns whether V-SYNC is enabled. Many devices always enable V-SYNC with no way to turn it off.
std::string getBinaryPath()
Returns the directory of the currently running binary.
bool canQuit()
Some platforms (e.g.
void setAntiAliasing(bool enabled)
Toggles MSAA.
void clearBackBuffer()
Clears the back buffer and resets the ModelView matrix, see jngl::reset()
std::string getPreferredLanguage()
Returns user preferred language, i.e. "en" for English, "de" for German.
void updateInput()
Updates the input state.
void quit()
Emit a quit event which will exit App::mainLoop() and set running() to false.
void setVerticalSync(bool enabled)
Toggles V-SYNC.
void setPrefix(const std::string &path)
Sets a global prefix which will be prepended whenever images or sounds are loaded.
bool getAntiAliasing()
Returns whether MSAA is enabled. If the device doesn't support it, it will always return false.
std::stringstream readAsset(const std::string &filename)
Returns a stringstream containing the whole file. This will read from the .apk on Android.
void setIcon(const std::string &filename)
Sets the icon for the window (Desktop-only)
unsigned int getStepsPerSecond()
How many times Work::step is called per second (default: 60)
void openURL(const std::string &)
Opens a link (e.g. https://bixense.com) in the browser.
void swapBuffers()
Swaps back and front buffer.
bool running()
Returns true until the main window is closed or quit() has been called.
std::vector< std::string > getArgs()
Returns the command line arguments passed to the executable.
std::string readConfig(const std::string &key)
Read in a configuration value which has been saved under key.
void writeConfig(const std::string &key, const std::string &value)
Write value into the persistent storage which can be read in again using jngl::readConfig(key)
std::string getPrefix()
Returns the global prefix set by jngl::setPrefix.
std::string getConfigPath()
void setStepsPerSecond(unsigned int)
How many times Work::step should be called per second (default: 60)