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 should 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
 Returns the name set by the constructor. More...
 
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...
 

Static Public Member Functions

static const Appinstance ()
 Access the instance, throws std::runtime_error 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 should be created before the window is shown.

Example:

#include <jngl/App.hpp>
#include <jngl/main.hpp>
JNGL_MAIN_BEGIN {
jngl::App app("Awesome Game Name");
// ...
app.mainLoop();
} JNGL_MAIN_END

Definition at line 24 of file App.hpp.

Member Function Documentation

◆ getDisplayName()

std::string getDisplayName ( ) const

Returns the name set by the constructor.

This cannot be changed later and is used by jngl::getConfigPath() for example.

◆ 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:
jngl::App
There can only be one instance of this class which should be created before the window is shown.
Definition: App.hpp:24
App.hpp