This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://msdn.microsoft.com/en-us/magazine/mt763237.aspx | |
#include <Windows.h> | |
std::wstring ansiToUtf16(const std::string& ansi) | |
{ | |
const int utf16Length = MultiByteToWideChar(CP_ACP, MB_COMPOSITE, ansi.data(), ansi.length(), nullptr, 0); | |
std::wstring utf16(utf16Length, L'\0'); | |
MultiByteToWideChar(CP_ACP, MB_COMPOSITE, ansi.data(), ansi.length(), &utf16[0], utf16Length); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: drag and drop files on the executable | |
#include <string> | |
#include <algorithm> // replace | |
#include <fstream> | |
#include <iomanip> | |
int main(int argc, char* argv[]) | |
{ | |
for (int i = 1; i < argc; ++i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://en.wikipedia.org/wiki/HSL_and_HSV | |
#include <SFML/Graphics/Color.hpp> | |
#include <tuple> | |
#include <algorithm> // min, max | |
// HSL/HSV | |
// H Hue component, range: [0.f, 360.f) | |
// S Saturation component, range: [0.f, 1.f) |