사용자 도구

사이트 도구


raylib:tetris:gettingstarted
gettingstarted

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판이전 판
다음 판
이전 판
raylib:tetris:gettingstarted [2025/12/28 22:06] – main파일 이거니맨raylib:tetris:gettingstarted [2025/12/28 22:19] (현재) 이거니맨
줄 19: 줄 19:
 #include "raylib.h" #include "raylib.h"
  
-/* This is created by Dongkun Lee. Korean Attorney in Law. +/* This is created by Dongkun Lee. Korean Attorney at Law. 
 First Created at 12/28/2025 First Created at 12/28/2025
 */ */
줄 63: 줄 63:
 </file> </file>
  
 +
 +==== 2. Makefile ==== 
 +
 +Makefile은 다음과 같이 만들었다. 
 +
 +
 +<file Make "Makefile>
 +#Project Name
 +PROJECT ?= tetris
 +# Define required raylib variables
 +RAYLIB_PATH        ?= ./lib
 +
 +# Define include path 
 +INCLUDE_PATH        ?= ./include
 +
 +# Define compiler path on Windows
 +COMPILER_PATH      ?= C:/raylib/w64devkit/bin
 +# Build mode for project: DEBUG or RELEASE
 +BUILD_MODE            ?= RELEASE
 +
 +# Define default C compiler: gcc
 +# NOTE: define g++ compiler if using C++
 +CC = g++
 +
 +# Define default make program: Mingw32-make
 +MAKE = mingw32-make $(PROJECT)
 +# Compile option
 +CFLAGS += -Wall -std=c++14 -D_DEFAULT_SOURCE -Wno-missing-braces 
 +
 +ifeq ($(BUILD_MODE),DEBUG)
 +    CFLAGS += -g -O0
 +else
 +    CFLAGS += -s -O1
 +endif
 +
 +# Define include paths for required headers
 +# NOTE: Several external required libraries (stb and others)
 +INCLUDE_PATHS = -I. -I$(INCLUDE_PATH) 
 +
 +# Define library paths containing required libs.
 +LDFLAGS = -L. -L$(RAYLIB_PATH)  
 +
 +# Define any libraries required on linking
 +# if you want to link libraries (libname.so or libname.a), use the -lname
 +LDLIBS = -lraylib -lgdi32 -lwinmm 
 +
 +# Define all source files required
 +SRC_DIR = .
 +OBJ_DIR = obj
 +
 +
 +# Default target entry
 +# NOTE: We call this Makefile target or Makefile.Android target
 +all:
 + $(MAKE)
 +
 +$(OBJ_DIR)/main.o : main.cpp
 + @mkdir -p obj
 + $(CC)  -c main.cpp $(CFLAGS) $(INCLUDE_PATHS) -o $@
 +
 +
 +#Icon file path
 +ICON += icon/seodang_res.o
 +
 +
 +#목적 파일 만들기
 +OBJS =  $(OBJ_DIR)/main.o
 +
 +
 +#컴파일
 +tetris : $(OBJS)
 + $(CC) $(CFLAGS)  $(OBJS) -o $(PROJECT) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) $(ICON)
 +</file> 
 +
 +앞으로 배우면서 모든 의존성을 확인하기 위하여 라이브러리(lib)와 헤더파일(include)을 프로젝트 폴더 하단에 위치했음을 눈여겨 보자. 
 +
 +또한 [[:raylib:install:실행파일_아이콘_및_윈도우창_아이콘_설정하기|윈도우 실행파일의 아이콘]]도 같이 컴파일하게 했음을 눈여겨 보자.
 +
 +
 +다음 번에는 그리드 개념을 배우도록 할 것이다. 
 +
 +
 +===== 참고 ====== 
 +
 +==== 1. 시작 파일 ==== 
 +
 +전체 시작파일은 다음 첨부파일과 같다.  
 +
 +{{ :raylib:tetris:tetris1_gettingstart.zip |Tetris Getting Started 파일}} 
 +
 +
 +==== 2. 아이콘 만들기 ==== 
 +
 +[[:raylib:install:실행파일_아이콘_및_윈도우창_아이콘_설정하기|실행파일 아이콘 만들기 및 윈도우 창 아이콘 설정하기]]도 읽어보자 
 +
 +==== 3. VS Code 설정파일 ==== 
 +
 +너무 편하게 하면 코딩 실력이 늘지 않을 것이다. 또한 Makefile을 만드는데에 익숙해질 필요도 있다.
 +
 +따라서 VS Code 설정파일은 위의 첨부파일에는 없다. VS Code 설정파일을 만드는 방법은 [[:raylib:raylib_를_cpp로_vs_code_에서_사용하기|Raylib를 위한 VS Code 설정하기]]를 참고하자 
raylib/tetris/gettingstarted.1766927164.txt.gz · 마지막으로 수정됨: 저자 이거니맨