JNGL
Public Member Functions | Static Public Member Functions | List of all members
App Class Reference

There can only be one instance of this class which will be created before the window is shown. More...

#include <jngl/App.hpp>

Public Member Functions

 App (std::string displayName)
 
 App (const App &)=delete
 
Appoperator= (const App &)=delete
 
 App (App &&)=delete
 
Appoperator= (App &&)=delete
 
std::string getDisplayName () const
 The display name of the app is used by jngl::writeConfig() for example.
 
void setDisplayName (const std::string &)
 
void mainLoop ()
 Starts the main loop, which calls jngl::Work::step and jngl::Work::draw.
 
void setPixelArt (bool)
 Activates pixel-perfect magnifying of textures (nearest-neighbor interpolation) More...
 
void updateProjectionMatrix () const
 

Static Public Member Functions

static Appinstance ()
 Access the instance, creates it if it doesn't exist.
 
static bool isPixelArt ()
 If pixel-perfect magnifying is activated (see setPixelArt)
 

Detailed Description

There can only be one instance of this class which will be created before the window is shown.

Example:

#include <jngl/App.hpp>
#include <jngl/main.hpp>
JNGL_MAIN_BEGIN {
jngl::App::instance().setDisplayName("Awesome Game Name");
// ...
} JNGL_MAIN_END
Contains jngl::App class.
void mainLoop()
Starts the main loop, which calls jngl::Work::step and jngl::Work::draw.
static App & instance()
Access the instance, creates it if it doesn't exist.
Defines macros for the main entry point.

Definition at line 26 of file App.hpp.

Member Function Documentation

◆ setPixelArt()

void setPixelArt ( bool  )

Activates pixel-perfect magnifying of textures (nearest-neighbor interpolation)

It's important to call this before textures are loaded. Defaults to false.


The documentation for this class was generated from the following file: