Nintendo 3DS >> C/C++

Input (CPad)


參考資訊:
1. libctru doc
2. 3ds-examples

說明:

API
void hidCircleRead(circlePosition *pos)
void consoleClear(void)

main.c

#include <3ds.h>
#include <stdio.h>

int main(void)
{
    circlePosition pos;

    gfxInitDefault();
    consoleInit(GFX_TOP, NULL);
    while (aptMainLoop()) {
        hidScanInput();
        hidCircleRead(&pos);

        consoleClear();
        printf("circle pad, x:%d, y:%d\n", pos.dx, pos.dy);

        gfxFlushBuffers();
        gfxSwapBuffers();
        gspWaitForVBlank();
    }
    gfxExit();
    return 0;
}

完成


返回上一頁