728x90
반응형
SMALL
gcc -o my_game my_game.c -lraylib -lopengl32 -lgdi32 -lwinmm
#include "raylib.h"
int main(void)
{
// Initialization
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib Sample");
SetTargetFPS(60); // Set the frames per second
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
// Draw
BeginDrawing();
ClearBackground(RAYWHITE); // Clear the background
// Draw a colored rectangle
DrawRectangle(screenWidth / 4, screenHeight / 4, screenWidth / 2, screenHeight / 2, RED);
DrawText("Hello, raylib!", 10, 10, 20, DARKGRAY);
EndDrawing();
}
// De-Initialization
CloseWindow(); // Close the window and OpenGL context
return 0;
}
Raylib를 사용하여 기본 창을 만들고 색상이 지정된 사각형을 그리는 간단한 샘플 코드
=============================
GCC를 사용한 컴파일 명령의 예
gcc -o my_game my_game.c -lraylib -lopengl32 -lgdi32 -lwinmm
728x90
LIST
'[ChatGPT] Sample Code 샘플 코드' 카테고리의 다른 글
[ChatGPT] Blu-ray Disc Java (BD-J) 게임을 Tiled로 게임 맵 생성 (1) | 2024.01.04 |
---|---|
[ChatGPT][Raylib + Tiled] Tiled를 활용한 Raylib 맵 만들기 기본 샘플 (1) | 2024.01.02 |
[ChatGPT][P5.js / Tiled] P5.js에 Tiled (.tmx) 파일을 적용하는 방법 예제 샘플 (0) | 2023.09.07 |
[ChatGPT][DxLib / Tiled] Android용 Tiled (.tmx)파일 적용한 DxLib 예제코드 (0) | 2023.08.10 |
[ChatGPT][DxLib / Tiled] Windows용 Tiled (.tmx)파일 적용한 DxLib 예제코드 (0) | 2023.08.10 |
댓글