xerpi / sftdlib

Simple and Fast Text Drawing library for the Nintendo 3DS
MIT License
30 stars 6 forks source link

Calling sftd_init() causes graphics to display on both screens if drawing only on GFX_TOP and not GFX_BOTTOM #16

Open dragos240 opened 8 years ago

dragos240 commented 8 years ago

This occurs on the old 3ds. Not sure about other models. This is also when a .3dsx file is run. Not sure about .cia

Steps to reproduce:

  1. Include 3ds.h, sf2d.h, and sftd.h
  2. Insert the following into main()
sf2d_init();
sftd_init();

while(aptMainLoop()){
   hidScanInput();
   if(hidKeysDown() & KEY_START) break;
   sf2d_start_frame(GFX_TOP, GFX_LEFT);
      sf2d_draw_rectangle(0, 0, 30, 30, RGBA8(0xFF, 0x00, 0x00, 0xFF));
   sf2d_end_frame();
   sf2d_swapbuffers();
}

sftd_fini();
sf2d_fini();

return 0;
  1. Compile and send to 3ds
  2. Result should be a red square in the top left hand corner against a black background in both screens.

Quick and dirty fix:

  1. Put the following after the sf2d_end_frame() that follows sf2d_start_frame(GFX_TOP, GFX_LEFT)
sf2d_start_frame(GFX_BOTTOM, GFX_LEFT);
sf2d_end_frame();