commit
410a2be616
|
|
@ -106,25 +106,21 @@ public:
|
||||||
|
|
||||||
inline pointer_type operator->()
|
inline pointer_type operator->()
|
||||||
{
|
{
|
||||||
KGE_ASSERT(ptr_ != nullptr && "Invalid pointer");
|
|
||||||
return ptr_;
|
return ptr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const_pointer_type operator->() const
|
inline const_pointer_type operator->() const
|
||||||
{
|
{
|
||||||
KGE_ASSERT(ptr_ != nullptr && "Invalid pointer");
|
|
||||||
return ptr_;
|
return ptr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline reference_type operator*()
|
inline reference_type operator*()
|
||||||
{
|
{
|
||||||
KGE_ASSERT(ptr_ != nullptr && "Invalid pointer");
|
|
||||||
return *ptr_;
|
return *ptr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const_reference_type operator*() const
|
inline const_reference_type operator*() const
|
||||||
{
|
{
|
||||||
KGE_ASSERT(ptr_ != nullptr && "Invalid pointer");
|
|
||||||
return *ptr_;
|
return *ptr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,8 @@ public:
|
||||||
|
|
||||||
void ResetNative();
|
void ResetNative();
|
||||||
|
|
||||||
|
bool IsValid() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Any native_;
|
Any native_;
|
||||||
};
|
};
|
||||||
|
|
@ -86,4 +88,9 @@ inline void NativeObject::ResetNative()
|
||||||
native_.Clear();
|
native_.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool NativeObject::IsValid() const
|
||||||
|
{
|
||||||
|
return native_.HasValue() && ObjectBase::IsValid();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace kiwano
|
} // namespace kiwano
|
||||||
|
|
|
||||||
|
|
@ -341,7 +341,9 @@ void RendererImpl::CreateTexture(Texture& texture, const PixelSize& size, const
|
||||||
|
|
||||||
hr = d2d_res_->GetDeviceContext()->CreateBitmap(
|
hr = d2d_res_->GetDeviceContext()->CreateBitmap(
|
||||||
DX::ConvertToSizeU(size), data.buffer, UINT(size.x) * pitch,
|
DX::ConvertToSizeU(size), data.buffer, UINT(size.x) * pitch,
|
||||||
D2D1::BitmapProperties1(D2D1_BITMAP_OPTIONS_TARGET, D2D1::PixelFormat(dxgi_format)), &output);
|
D2D1::BitmapProperties1(D2D1_BITMAP_OPTIONS_TARGET,
|
||||||
|
D2D1::PixelFormat(dxgi_format, D2D1_ALPHA_MODE_PREMULTIPLIED)),
|
||||||
|
&output);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
ComPolicy::Set(texture, output);
|
ComPolicy::Set(texture, output);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue