JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
sprite.hpp File Reference

Contains jngl::Sprite class and related functions. More...

#include "Drawable.hpp"
#include "Rgb.hpp"
#include "Rgba.hpp"
#include "ShaderProgram.hpp"
#include "Vec2.hpp"
#include <future>
#include <optional>
#include <vector>
Include dependency graph for sprite.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Sprite
 Higher-level representation of an image. More...
 
class  Sprite::Loader
 Use this class to load a Sprite asynchronously. More...
 
class  Sprite::Batch
 While this object is alive, don't do any other draw calls. Should never outlive its Sprite. More...
 

Namespaces

namespace  jngl
 JNGL's main namespace.
 

Functions

void draw (const std::string &filename, double x, double y)
 
template<class Vect >
void draw (const std::string &filename, Vect pos)
 
Finally load (const std::string &filename)
 Starts a thread to load filename and returns a Finally which will join it.
 
void unload (const std::string &filename)
 
void unloadAll ()
 
void drawClipped (const std::string &filename, double xposition, double yposition, float xstart, float xend, float ystart, float yend)
 
void setSpriteColor (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
 
void setSpriteColor (unsigned char red, unsigned char green, unsigned char blue)
 
void setSpriteColor (Rgb)
 Sets the global color used for drawing Sprites, leaves the alpha value untouched.
 
void setSpriteColor (Rgba)
 Sets the global color used for drawing Sprites.
 
void setSpriteAlpha (unsigned char alpha)
 
void pushSpriteAlpha (unsigned char alpha=255)
 
void popSpriteAlpha ()
 
int getWidth (const std::string &filename)
 
int getHeight (const std::string &filename)
 
Finally disableBlending ()
 

Detailed Description

Contains jngl::Sprite class and related functions.

Definition in file sprite.hpp.