개발/프로젝트

[콘솔 게임 SDK 개발 #8] Hello World!

-=HaeJuK=- 2024. 8. 23. 10:44
Console Platforms - Hello, World! Examples

Console Platforms - Hello, World! Examples

Below are examples of how to print "Hello, World!" on various console platforms such as PlayStation, Nintendo Switch, and Xbox. Each platform requires its own SDK and development environment, which are accessible only to registered developers.

1. PlayStation (PS4/PS5)

PlayStation development requires the PlayStation SDK, which is only available through the PlayStation Partners Program. Here's a conceptual example:

// PlayStation SDK example (conceptual)
#include <graphics.h>

int main() {
    graphics_init();
    graphics_draw_text(100, 100, "Hello, World!");

    while (true) {
        graphics_swap_buffers();
    }

    return 0;
}
    

2. Nintendo Switch

Nintendo Switch development is done using the Nintendo Switch SDK, accessible via the Nintendo Developer Portal. The following example is for a Homebrew environment:

#include <switch.h>

int main(int argc, char* argv[]) {
    consoleInit(NULL);
    printf("Hello, World!\n");

    while (appletMainLoop()) {
        hidScanInput();
        u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO);
        
        if (kDown & KEY_PLUS) break;
        
        consoleUpdate(NULL);
    }

    consoleExit(NULL);
    return 0;
}
    

3. Xbox (Xbox One/Series X/S)

Xbox development uses the Xbox Development Kit (XDK) or Game Core Development Kit (GDK). Below is a simple example using DirectX in the Xbox environment:

#include <iostream>
#include <Windows.h>
#include <d3d11.h>

int main() {
    // Direct3D initialization code omitted
    
    std::cout << "Hello, World!" << std::endl;

    while (true) {
        // Render loop
    }

    return 0;
}
    

Conclusion

PlayStation, Nintendo Switch, and Xbox consoles each require their own development kits and environments. These tools are provided through the respective developer programs. The examples shown here are conceptual and for reference purposes.

반응형