raylib:tetris:gettingstarted
gettingstarted
문서의 이전 판입니다!
목차
시작하기
테트리스 만들기를 시작하려고 한다.
아예 스크래치 상태부터 만들려고 한다.
따라서 아주 간단한 상태부터 시작할 예정이다. 조금씩 만들어 보자
시작 파일
1. main.cpp
윈도우 창에 텍스트만 나오게 하는 간단한 Hello world 파일을 시작파일로 하자
Raylib에서 윈도우 창을 만들고 드로잉을 하는 간단한 보일러플레이트는 다음과 같다. 이를 시작파일로 할 것이다.
- "main.cpp"
#include "raylib.h" /* This is created by Dongkun Lee. Korean Attorney in Law. First Created at 12/28/2025 */ /* ------------------------------------------------------------- // Program main entry point --------------------------------------------------------------- */ int main(void) { // Initialization const int screenWidth = 500; const int screenHeight = 600; // Cell Size is 30px. and There are 20 grid horizontally. InitWindow(screenWidth, screenHeight, "Tetris - Hello!"); Image icon = LoadImage("icon/seodang.png"); SetWindowIcon(icon); SetTargetFPS(60); // Main game loop while (WindowShouldClose() == false) // Detect window close button or ESC key { // Draw //---------------------------------------- BeginDrawing(); ClearBackground(RAYWHITE); DrawText("Hello There", 190, 200, 20, MAROON); EndDrawing(); //--------------------------------------- } // De-Initialization CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- return 0; }
raylib/tetris/gettingstarted.1766927164.txt.gz · 마지막으로 수정됨: 저자 이거니맨

로그인