Example: Calls functions from libnds.
#define MY_TEXTURE_VRAMOFFSET (0) N3DDEVICE device; // Load texture to video memory. // pTexture is a pointer to the texture in main memory. // textureSizeInBytes equals the size of the texture in bytes. unsigned vramMapping = vramSetMainBanks(VRAM_A_LCD,VRAM_B_LCD,VRAM_C_LCD,VRAM_D_LCD); swiCopy(pTexture, VRAM_A + MY_TEXTURE_VRAMOFFSET, (textureSizeInBytes >> 2) | COPY_MODE_WORD); vramRestoreMainBanks(vramMapping); // Init device, setup view and projection matrix. for(;;) { // Clear and begin scene device.SetTexture(MY_TEXTURE_VRAMOFFSET, 64, 64, N3DFMT_A1B5G5R5); device.SetTextureState(N3DTST_ADDRESSU, N3DTADDRESS_MIRROR); device.SetTextureState(N3DTST_ADDRESSV, N3DTADDRESS_MIRROR); device.SetTextureState(N3DTST_COLOROP, N3DTOP_MODULATE); // Transform and draw textured object. // End and present scene, then wait to vblank. }