summaryrefslogtreecommitdiff
path: root/include/rvl/GXTransform.h
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-03-12 23:17:12 +0100
committerTreeki <treeki@gmail.com>2011-03-12 23:17:12 +0100
commit7d4e4c0b34a613dd3c0220475ae4e448197522c1 (patch)
tree4f5cee367de3fdef4f9a7c84af59ffe76a2bb1c3 /include/rvl/GXTransform.h
downloadkamek-7d4e4c0b34a613dd3c0220475ae4e448197522c1.tar.gz
kamek-7d4e4c0b34a613dd3c0220475ae4e448197522c1.zip
initial commit. now I can start playing with stuff!
Diffstat (limited to 'include/rvl/GXTransform.h')
-rwxr-xr-xinclude/rvl/GXTransform.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/include/rvl/GXTransform.h b/include/rvl/GXTransform.h
new file mode 100755
index 0000000..15c508a
--- /dev/null
+++ b/include/rvl/GXTransform.h
@@ -0,0 +1,71 @@
+#ifndef __GXTRANSFORM_H__
+#define __GXTRANSFORM_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*---------------------------------------------------------------------------*/
+
+#define GX_PROJECTION_SZ 7
+#define GX_VIEWPORT_SZ 6
+
+/*---------------------------------------------------------------------------*/
+void GXSetProjection ( const f32 mtx[4][4], GXProjectionType type );
+void GXSetProjectionv ( const f32 *ptr );
+void GXLoadPosMtxImm ( const f32 mtx[3][4], u32 id );
+void GXLoadPosMtxIndx ( u16 mtx_indx, u32 id );
+void GXLoadNrmMtxImm ( const f32 mtx[3][4], u32 id );
+void GXLoadNrmMtxImm3x3 ( const f32 mtx[3][3], u32 id );
+void GXLoadNrmMtxIndx3x3 ( u16 mtx_indx, u32 id );
+void GXSetCurrentMtx ( u32 id );
+void GXLoadTexMtxImm ( const f32 mtx[][4], u32 id, GXTexMtxType type );
+void GXLoadTexMtxIndx ( u16 mtx_indx, u32 id, GXTexMtxType type );
+
+void GXProject (
+ f32 x, // model coordinates
+ f32 y,
+ f32 z,
+ const f32 mtx[3][4], // model-view matrix
+ const f32* pm, // projection matrix, as returned by GXGetProjectionv
+ const f32* vp, // viewport, as returned by GXGetViewportv
+ f32* sx, // screen coordinates
+ f32* sy,
+ f32* sz );
+
+void GXSetViewport(
+ f32 left,
+ f32 top,
+ f32 wd,
+ f32 ht,
+ f32 nearz,
+ f32 farz );
+
+static inline void GXSetViewportv( const f32 *vp )
+{ // Note: doesn't check for NULL ptr
+ GXSetViewport(vp[0], vp[1], vp[2], vp[3], vp[4], vp[5]);
+}
+
+void GXSetViewportJitter(
+ f32 left,
+ f32 top,
+ f32 wd,
+ f32 ht,
+ f32 nearz,
+ f32 farz,
+ u32 field );
+
+void GXSetZScaleOffset ( f32 scale, f32 offset );
+
+#if ( GX_REV != 1 )
+void GXSetScissorBoxOffset( s32 x_off, s32 y_off );
+#endif
+
+void GXSetClipMode( GXClipMode mode );
+
+/*---------------------------------------------------------------------------*/
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __GXTRANSFORM_H__