Page MenuHomePhorge

RenderTarget.cpp
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

RenderTarget.cpp

#include <echo/Graphics/RenderTarget.h>
namespace Echo
{
RenderTarget::RenderTarget()
{
mCurrentViewport = 0;
mIsPrimary = false;
mIsFullScreen = false;
mDisplayXDPI = 0.f; //Display X DPI, 0 if unknown
mDisplayYDPI = 0.f; //Display Y DPI, 0 if unknown
}
RenderTarget::~RenderTarget()
{
}
f32 RenderTarget::GetAspectRatio() const
{
return (static_cast<f32>(GetWidth()) / static_cast<f32>(GetHeight()));
}
Metre RenderTarget::GetDisplayPhysicalWidth() const
{
u32 widthInPixels = GetWidth();
if(mDisplayXDPI == 0.f || widthInPixels==0)
{
//We don't know.
return Metre(0);
}
return Inch(widthInPixels / mDisplayXDPI);
}
Metre RenderTarget::GetDisplayPhysicalHeight() const
{
u32 heightInPixels = GetHeight();
if(mDisplayYDPI == 0.f || heightInPixels==0)
{
//We don't know.
return Metre(0);
}
return Inch(heightInPixels / mDisplayYDPI);
}
Metre RenderTarget::GetDisplayPhysicalDiagonalSize() const
{
Metre width = GetDisplayPhysicalWidth();
Metre height = GetDisplayPhysicalHeight();
if(width==Metre(0) || height==Metre(0))
{
return Metre(0);
}
return Metre(Maths::Hypotenuse(width.Count(),height.Count()));
}
}

File Metadata

Mime Type
text/x-c++
Expires
Thu, Dec 5, 2:19 AM (7 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
63574
Default Alt Text
RenderTarget.cpp (1 KB)

Event Timeline