API/DF.project
header.h & header.cpp
猫猫
2014. 10. 9. 17:31
반응형
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #pragma once //모든 것들이 공통적으로 쓸수 있는 헤더 #include <tchar.h> #include <Windows.h> #pragma comment (lib, "WINMM.lib") enum {STAND, WALK, JUMP, JUMP_IDLE, JUMP_UP, JUMP_DOWN, JUMP_END, ATTACK, FIRE}; //좌표에 대한 구조체가 필요하다. struct CGPoint { float x, y; }; CGPoint MakePoint (float x, float y); //헤더는 구조체 선언만, 구현 ㄴㄴ #define ccp(___x, ___y) MakePoint(___x, ___y) //하면 전처리에서 ccp로 선언되어있는 장소가 makepoint로 변경된다. 함수 같이 사용 가능 /* while(1) { getpositon으로 가져오고-> 변경-> set으로 세팅 } */ struct CGSize { float width, height; }; CGSize MakeSize (float w, float h); #define cgs(___w,___h) MakeSize(___w, ___h) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #include "Header.h" CGPoint MakePoint (float x, float y) { CGPoint p; p.x = x; p.y = y; return p;//p를 리턴해야 x,y 좌표를 넘긴다. }; CGSize MakeSize(float w, float h) { CGSize s; s.width = w; s.height = h; return s; } |
반응형