game/sdlpp/sdlpp_common.hpp

57 lines
1.2 KiB
C++
Raw Normal View History

2020-11-22 22:37:55 +00:00
#ifndef SDLPPSCOPE
#ifdef _WIN32
#ifdef DLLEXPORT
#define SDLPPSCOPE __declspec( dllexport )
#else
#define SDLPPSCOPE __declspec( dllimport )
#endif
#else
2020-11-22 22:48:45 +00:00
#define SDLPPSCOPE
2020-11-22 22:37:55 +00:00
#endif
#endif
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 {
2020-11-22 22:37:55 +00:00
SDLPPSCOPE int hex2num( char c );
2020-11-21 19:57:40 +00:00
2020-11-22 22:37:55 +00:00
SDLPPSCOPE bool init();
SDLPPSCOPE bool init( uint32_t SDL_OPTIONS );
SDLPPSCOPE bool init( uint32_t SDL_OPTIONS, int IMAGE_OPTIONS );
2020-11-21 19:57:40 +00:00
2020-11-22 22:48:45 +00:00
SDLPPSCOPE std::tuple< int, int, int, int >
getColorsHEX( const std::string &color );
2020-11-22 22:37:55 +00:00
SDLPPSCOPE SDL_Color getSDLColorHEX( const std::string &color );
2020-11-22 22:48:45 +00:00
SDLPPSCOPE std::tuple< int, int, int, int >
getColorsSDLColor( const SDL_Color &color );
SDLPPSCOPE SDL_Color
getSDLColorTuple( const std::tuple< int, int, int, int > &tuple );
2020-11-21 19:57:40 +00:00
2020-11-22 22:37:55 +00:00
SDLPPSCOPE bool getSDLEvent( SDL_Event &e );
2020-11-21 19:57:40 +00:00
} // end of namespace SDLPP
#endif