Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F130002
Viewport.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
Viewport.h
View Options
#ifndef _ECHOVIEWPORT_H_
#define _ECHOVIEWPORT_H_
#include
<echo/Types.h>
#include
<echo/Graphics/Colour.h>
namespace
Echo
{
//!\breif Viewport
class
Viewport
{
public
:
struct
AspectRatioOptions
{
enum
_
{
NONE
,
HORIZONTAL_FIXED
,
VERTICAL_FIXED
};
};
typedef
AspectRatioOptions
::
_
AspectRatioOption
;
Viewport
(
f32
left
=
0.0f
,
f32
top
=
0.0f
,
f32
right
=
1.0f
,
f32
bottom
=
1.0f
,
AspectRatioOption
aspectRatioOption
=
AspectRatioOptions
::
NONE
)
:
mAspectRatioOption
(
aspectRatioOption
)
{
SetViewport
(
left
,
top
,
right
,
bottom
);
}
~
Viewport
()
{
}
void
SetViewport
(
f32
left
=
0.0f
,
f32
top
=
0.0f
,
f32
right
=
1.0f
,
f32
bottom
=
1.0f
)
{
mLeft
=
left
;
mRight
=
right
;
mTop
=
top
;
mBottom
=
bottom
;
mAspectRatio
=
(
right
-
left
)
/
(
bottom
-
top
);
}
f32
GetLeft
()
const
;
f32
GetRight
()
const
;
f32
GetTop
()
const
;
f32
GetBottom
()
const
;
const
f32
&
GetAspectRatio
()
const
{
return
mAspectRatio
;}
private
:
f32
mLeft
;
f32
mRight
;
f32
mTop
;
f32
mBottom
;
f32
mAspectRatio
;
AspectRatioOption
mAspectRatioOption
;
};
}
#endif
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Mon, May 19, 12:07 PM (15 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
76857
Default Alt Text
Viewport.h (1 KB)
Attached To
Mode
rEE Echo 3
Attached
Detach File
Event Timeline
Log In to Comment