コード例 #1
0
ファイル: Texture.cpp プロジェクト: timgurto/mmo
Texture::Texture(const std::string &filename, const Color &colorKey) {
  if (filename.empty()) return;
  assert(renderer);

  _surface = {filename, colorKey};
  createFromSurface();
}
コード例 #2
0
ファイル: Texture.cpp プロジェクト: timgurto/mmo
Texture::Texture(TTF_Font *font, const std::string &text, const Color &color) {
  assert(renderer);

  if (!font) return;

  _surface = {font, text, color};
  createFromSurface();
}
コード例 #3
0
ファイル: ATexture.cpp プロジェクト: Awcmon/AwcUtility
ATexture::ATexture(SDL_Surface *sourceSurface)
{
	mTexture = NULL;
	width = 0;
	height = 0;

	createFromSurface(sourceSurface);
}
コード例 #4
0
bool Cursor::loadFromFile(const std::string &path, const Point &p)
{
    Surface surface;
    if (!surface.loadFromFile(path))
    {
        Error() << "could not load cursor image";
    }
    else
    {
        return createFromSurface(surface, p);
    }
    return false;
}
コード例 #5
0
ファイル: Texture.cpp プロジェクト: skryabiin/core
	bool Texture::createImpl() {

		if (_fileSource.compare("")) {
			auto sdlSurface = IMG_Load(_fileSource.c_str());
			sdlSurface = (sdlSurface != NULL) ? sdlSurface : nullptr;

			if (sdlSurface == nullptr) return false;
			_sdlSurface = sdlSurface;

				
		}	
		return createFromSurface();

	}
コード例 #6
0
ファイル: Texture.cpp プロジェクト: timgurto/mmo
Texture::Texture(const Surface &surface) {
  _surface = surface;
  createFromSurface();
}