본문 바로가기

전체 글

(11)
Git Bash command line
화면 좌표계와 NDC 좌표계간 변환 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 #include #include float width{ 1920.f }; float height{ 1080.f }; std::pair ScreenCoordToNDC(float x, float y) { const float XTransform = (2.f / width); const float YTransform = -(2.f / height); x = x * XTransform - 1.f; y = y * YTransform + 1.f; return std::pair{ x,y }; }; std::pair NDCToScreenCoord(float x, f..
MSVC++ 메모리 릭 탐지 메모리 릭 탐지 메모리 릭을 발견했을시 BreakAlloc 함수로 번호를 파라미터로 패스해 추적가능 Example...
Game Loop Frame Limit DeltaSec Control 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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 namespace setup::time { using MiliSec = std::chrono::duration; static constexpr float_t FPS = 60.f; template static constexpr TimeTy TimeUnit = TimeTy(1000.f); static constexpr float_t Milisec = TimeUnit.count(); static const MiliSec Fr..
Screen->직교 Screen->직교 X = (X - 2/W) ; Y = (Y - 2/W) * -1 ;
Modern C++ 정리잘된곳 https://leesangwon0114.github.io/ Leesangwon blog Leesangwon blog leesangwon0114.github.io https://www.slideshare.net/LusainKim/template-at-c?from_m_app=ios https://gamedevforever.com/338?category=387043
Window API 입문 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM TParam) { switch (msg) { case WM_DESTROY: PostQuitMessage(0); break; default : break; }; return DefWindowProc(hWnd, msg, wParam, TParam); }; Colored by Color Scripter cs WndProc 윈도우 프로시저 함수 윈도우에서 이벤트가 발생할때마다 호출되며 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..
C++ Object Alignment 객체 메모리 정렬 1. 클래스,구조체의 데이터 멤버는 해당 데이터 멤버의 데이터 크기의 배수의 바이트 위치에서 시작한다. Example int A4,int A4,double D8 이라는 데이터 멤버가 있다고 가정했을시 integer32 는 4 , 8 , 12 , 16 바이트 위치의 시작번지에만 자리 잡을수 있고 해당 시작번지에 자리잡을수 없다면 그 메모리 크기 만큼 패딩이 들어가는 것이다. double64 는 8 , 16 , 24 바이트 위치의 시작번지에만 자리 잡을수 있다. 2. 클래스,구조체의 데이터의 사이즈는 해당 구조체의 가장 큰 데이터 멤버의 배수에서 끝난다. Example 위의 예시에서는 double 타입 8 바이트가 가장큰 데이터 멤버이기 때문에 데이터사이즈의 끝이 8의 배수가 아니라면 8의 배수만큼 패딩이 ..