@@ -14,7 +14,6 @@ int main()
1414 debug_init_usblog ();
1515
1616 display_init (RESOLUTION_320x240 , DEPTH_16_BPP , 3 , GAMMA_NONE , FILTERS_RESAMPLE );
17- surface_t depthBuffer = surface_alloc (FMT_RGBA16 , display_get_width (), display_get_height ());
1817 rdpq_init ();
1918
2019 t3d_init ((T3DInitParams ){}); // Init library itself, use empty params for default settings
@@ -23,7 +22,6 @@ int main()
2322 t3d_mat4_identity (& modelMat );
2423 // Now allocate a fixed-point matrix, this is what t3d uses internally.
2524 T3DMat4FP * modelMatFP = malloc_uncached (sizeof (T3DMat4FP ));
26- T3DMat4FP * modelMatScale = malloc_uncached (sizeof (T3DMat4FP ));
2725
2826 const T3DVec3 camPos = {{0 ,0 ,-18 }};
2927 const T3DVec3 camTarget = {{0 ,0 ,0 }};
@@ -74,7 +72,7 @@ int main()
7472 t3d_mat4_to_fixed (modelMatFP , & modelMat );
7573
7674 // ======== Draw (3D) ======== //
77- rdpq_attach (display_get (), & depthBuffer ); // set the target to draw to
75+ rdpq_attach (display_get (), display_get_zbuf () ); // set the target to draw to
7876 t3d_frame_start (); // call this once per frame at the beginning of your draw function
7977
8078 t3d_viewport_attach (& viewport ); // now use the viewport, this applies proj/view matrices and sets scissoring
0 commit comments