Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F96976
RenderTarget.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
RenderTarget.cpp
View Options
#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
Details
Attached
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)
Attached To
Mode
rEE Echo 3
Attached
Detach File
Event Timeline
Log In to Comment