D2d offscreen rendering finish up.

This commit is contained in:
jmsgrogan 2023-01-12 09:18:16 +00:00
parent 8c814ce89f
commit c63138c455
32 changed files with 288 additions and 64 deletions

View file

@ -9,6 +9,18 @@ Color::Color(unsigned r, unsigned g, unsigned b, double a)
}
Color::Color(Name name)
{
if (name == Name::WHITE)
{
Color(255, 255, 255);
}
else
{
Color(255, 255, 255);
}
}
std::shared_ptr<Color> Color::CreateShared(unsigned r, unsigned g, unsigned b,
double a )
{

View file

@ -7,8 +7,16 @@
class Color
{
public:
enum class Name
{
WHITE
};
Color(unsigned r = 0, unsigned g = 0, unsigned b = 0, double a = 1.0);
Color(Name name);
static std::shared_ptr<Color> CreateShared(unsigned r, unsigned g, unsigned b, double a = 1.0);
static std::unique_ptr<Color> Create(unsigned r, unsigned g, unsigned b, double a = 1.0);
static std::unique_ptr<Color> Create(const Color& color);
@ -41,6 +49,11 @@ public:
return mB + (mG<<8) + (mR<<16);
}
static Color White()
{
return { 255, 255, 255, 1 };
}
private:
unsigned mR{0};
unsigned mG{0};

View file

@ -161,12 +161,10 @@ std::string StringUtils::convert(const std::wstring& input)
}
#ifdef _WIN32
const auto size = ::WideCharToMultiByte(CP_UTF8, 0, &input[0],
(int)input.size(), nullptr, 0, nullptr, nullptr);
const auto size = ::WideCharToMultiByte(CP_UTF8, 0, &input[0], (int)input.size(), nullptr, 0, nullptr, nullptr);
std::string result(size, 0);
::WideCharToMultiByte(CP_UTF8, 0, &input[0], (int)input.size(),
&result[0], size, nullptr, nullptr);
::WideCharToMultiByte(CP_UTF8, 0, &input[0], (int)input.size(), &result[0], size, nullptr, nullptr);
return result;
#else
throw std::logic_error("Not implemented");