game/sdlpp/sdlpp_common.hpp

39 lines
953 B
C++
Raw Normal View History

2020-11-21 19:57:40 +00:00
#ifndef SDLPP_HPP_COMMON
#define SDLPP_HPP_COMMON
#ifdef _WIN32
#include "SDL2/SDL.h"
#include "SDL2/SDL_image.h"
#include "SDL2/SDL_ttf.h"
#else
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_ttf.h>
#endif // UNIX
#include <cstdint>
#include <string>
#include <tuple>
#define SDLPP_TEXT_LEFT 0x0001
#define SDLPP_TEXT_RIGHT 0x0002
#define SDLPP_TEXT_CENTER 0x0004
#define SDLPP_TEXT_TOP 0x0008
#define SDLPP_TEXT_BOTTOM 0x0010
namespace SDLPP {
int hex2num( char c );
bool init();
bool init( uint32_t SDL_OPTIONS );
bool init( uint32_t SDL_OPTIONS, int IMAGE_OPTIONS );
std::tuple< int, int, int, int > getColorsHEX( const std::string &color );
SDL_Color getSDLColorHEX( const std::string &color );
std::tuple< int, int, int, int > getColorsSDLColor( const SDL_Color &color );
SDL_Color getSDLColorTuple( const std::tuple< int, int, int, int > &tuple );
bool getSDLEvent( SDL_Event &e );
} // end of namespace SDLPP
#endif