예제 #1
0
bool
SurfaceSWPacked::assign_vfunc(const rendering::Surface &surface)
{
	std::vector<Color> pixels(get_pixels_count());
	surface.get_pixels(&pixels.front());
	this->surface.set_pixels(&pixels.front(), get_width(), get_height());
	return true;
}
예제 #2
0
void
DebugSurface::save_to_file(const rendering::Surface &surface, const String &filename, bool overwrite)
{
	if (surface.is_created())
	{
		std::vector<Color> buffer(surface.get_pixels_count());
		surface.get_pixels(&buffer.front());
		save_to_file(&buffer.front(), surface.get_width(), surface.get_height(), 0, filename, overwrite);
	}
	else
		save_to_file(NULL, 0, 0, 0, filename, overwrite);
}