Refactor viewport to have X/Y separate members instead of TopLeft[2]

This commit is contained in:
baldurk
2017-04-18 14:57:38 +01:00
parent f1df7423e2
commit 8262bd2770
5 changed files with 23 additions and 28 deletions
+9 -9
View File
@@ -191,20 +191,20 @@ struct SO
struct Viewport
{
Viewport() : Width(0.0f), Height(0.0f), MinDepth(0.0f), MaxDepth(0.0f), Enabled(false)
Viewport()
: X(0.0f), Y(0.0f), Width(0.0f), Height(0.0f), MinDepth(0.0f), MaxDepth(0.0f), Enabled(false)
{
TopLeft[0] = 0.0f;
TopLeft[1] = 0.0f;
}
Viewport(float TX, float TY, float W, float H, float MN, float MX, bool en)
: Width(W), Height(H), MinDepth(MN), MaxDepth(MX), Enabled(en)
: X(TX), Y(TY), Width(W), Height(H), MinDepth(MN), MaxDepth(MX), Enabled(en)
{
TopLeft[0] = TX;
TopLeft[1] = TY;
}
float TopLeft[2];
float Width, Height;
float MinDepth, MaxDepth;
float X;
float Y;
float Width;
float Height;
float MinDepth;
float MaxDepth;
bool32 Enabled;
};
+8 -11
View File
@@ -220,20 +220,17 @@ struct Streamout
struct Viewport
{
Viewport() : Width(0.0f), Height(0.0f), MinDepth(0.0f), MaxDepth(0.0f)
{
TopLeft[0] = 0.0f;
TopLeft[1] = 0.0f;
}
Viewport() : X(0.0f), Y(0.0f), Width(0.0f), Height(0.0f), MinDepth(0.0f), MaxDepth(0.0f) {}
Viewport(float TX, float TY, float W, float H, float MN, float MX)
: Width(W), Height(H), MinDepth(MN), MaxDepth(MX)
: X(TX), Y(TY), Width(W), Height(H), MinDepth(MN), MaxDepth(MX)
{
TopLeft[0] = TX;
TopLeft[1] = TY;
}
float TopLeft[2];
float Width, Height;
float MinDepth, MaxDepth;
float X;
float Y;
float Width;
float Height;
float MinDepth;
float MaxDepth;
};
struct Scissor