#ifndef IPL_GRAPHICS_H #define IPL_GRAPHICS_H #include #include #include #include #include "iplMath.h" namespace ipl { namespace utility { class Graphics { public: class Arg { private: Arg(); nw4r::math::MTX44 mProjMtx; // 0x00 nw4r::math::MTX34 mViewMtx; // 0x40 math::VEC3 mOrthoTrans; // 0x70 math::VEC2 mOrthoScale; // 0x7C friend class Graphics; }; typedef enum Orientation { ORI_NONE = 0, ORI_90CW, ORI_90CCW } Orientation; static nw4r::math::MTX34& getViewMtx() { return mArg.mViewMtx; } static void setOrtho(u32 ortho = GX_PNMTX0); static void setDefaultOrtho(u32 ortho = GX_PNMTX0); static void setOrthoProjection(const math::VEC3& translate, const math::VEC2& scale); static void setOrthoProjection(u32 id); static void calcOrthoCamera(); static void setCamera(u32 id = 0); static void drawPolygon(const nw4r::ut::Rect& rect, GXColor color); static void drawTexture(const nw4r::ut::Rect& rect, const GXTexObj& texObj, GXColor color, u8 texScale, Orientation ori = ORI_NONE); static void setOrthoTransAndScale(const math::VEC3& translate, const math::VEC2& scale) { mArg.mOrthoTrans = translate; mArg.mOrthoScale = scale; } static void setOrthoTrans(const math::VEC3& translate) { mArg.mOrthoTrans = translate; } static void setOrthoScale(const math::VEC2& scale) NO_INLINE { mArg.mOrthoScale.x = scale.x; mArg.mOrthoScale.y = scale.y; } private: static Arg mArg; }; } // namespace utility } // namespace ipl #endif // IPL_GRAPHICS_H