diff options
Diffstat (limited to 'source/modules/asura-core/graphics/matrix_stack.cpp')
-rw-r--r-- | source/modules/asura-core/graphics/matrix_stack.cpp | 122 |
1 files changed, 60 insertions, 62 deletions
diff --git a/source/modules/asura-core/graphics/matrix_stack.cpp b/source/modules/asura-core/graphics/matrix_stack.cpp index 2211158..eaa686f 100644 --- a/source/modules/asura-core/graphics/matrix_stack.cpp +++ b/source/modules/asura-core/graphics/matrix_stack.cpp @@ -1,77 +1,75 @@ #include "matrix_stack.h" -namespace AsuraEngine -{ - namespace Graphics - { +namespace_begin(AsuraEngine) +namespace_begin(Graphics) - MatrixStack::MatrixStack() - : top(0) - { - // ջʼջô˱֤ջԶǿգȡֵ - m_Stack[top].SetIdentity(); - } +MatrixStack::MatrixStack() + : top(0) +{ + // ջʼջô˱֤ջԶǿգȡֵ + m_Stack[top].SetIdentity(); +} - MatrixStack::~MatrixStack() - { - } +MatrixStack::~MatrixStack() +{ +} - void MatrixStack::LoadIdentity() - { - m_Stack[top].SetIdentity(); - } +void MatrixStack::LoadIdentity() +{ + m_Stack[top].SetIdentity(); +} - bool MatrixStack::Push() - { - if (top == ASURA_MAX_MATRIX_STACK_DEPTH - 1) - return false; - ++top; - m_Stack[top] = m_Stack[top - 1]; - return true; - } +bool MatrixStack::Push() +{ + if (top == ASURA_MAX_MATRIX_STACK_DEPTH - 1) + return false; + ++top; + m_Stack[top] = m_Stack[top - 1]; + return true; +} - bool MatrixStack::Pop() - { - if (top == 0) - return false; - --top; - return true; - } +bool MatrixStack::Pop() +{ + if (top == 0) + return false; + --top; + return true; +} - AEMath::Matrix44& MatrixStack::GetTop() - { - return m_Stack[top]; - } +AEMath::Matrix44& MatrixStack::GetTop() +{ + return m_Stack[top]; +} - uint MatrixStack::GetTopIndex() - { - return top; - } +uint MatrixStack::GetTopIndex() +{ + return top; +} - uint MatrixStack::GetCapacity() - { - return ASURA_MAX_MATRIX_STACK_DEPTH; - } +uint MatrixStack::GetCapacity() +{ + return ASURA_MAX_MATRIX_STACK_DEPTH; +} - void MatrixStack::Ortho(float left, float right, float bottom, float top, float near, float far) - { - m_Stack[this->top].Ortho(left, right, bottom, top, near, far); - } +void MatrixStack::Ortho(float left, float right, float bottom, float top, float near, float far) +{ + m_Stack[this->top].Ortho(left, right, bottom, top, near, far); +} - void MatrixStack::Rotate(float angle) - { - m_Stack[top].Rotate(angle); - } +void MatrixStack::Rotate(float angle) +{ + m_Stack[top].Rotate(angle); +} - void MatrixStack::Translate(float x, float y) - { - m_Stack[top].Translate(x, y); - } +void MatrixStack::Translate(float x, float y) +{ + m_Stack[top].Translate(x, y); +} - void MatrixStack::Scale(float x, float y) - { - m_Stack[top].Scale(x, y); - } +void MatrixStack::Scale(float x, float y) +{ + m_Stack[top].Scale(x, y); +} - } -}
\ No newline at end of file +namespace_end +namespace_end
\ No newline at end of file |