게임/게임 엔진의 이해

[Handmade Hero] Intro to C on Windows - Day 4

한진희 2023. 8. 27. 06:44
반응형

1. Endian

- High Order Byte <- 0000 0000 0000 0000 -> Low Order Byte

- DIsk에 있는 데이터 (이미지 오디오 등)을 어떻게 불러오는지 (Endian 유형)을 알아두어야한다.

Little endian

- Memory Layout: Low Order Byte comes first

- Standard (x86, arm, x64)

Big endian

- Memory Layout: High Order Byte comes first

- powerpc, xbox, playstation

2. Padding Byte

struct projectilfe {
char unsigned IsThisOnFire;
int Damage;
int ParticlesPerSecond;
short HowManyCooks;
}

// 1 + 4 + 4+ 2 = 11 bytes expected
// but it reserves 16 bytes for cpu optimization

3. Hexadecimal

- 0 ~ F (0 ~ 15)

4. Array Indexing

- 우리가 코드로 만들어낸 어떠한 것 (객체)을 숫자로 index화 한 것

projectile Projectiles[40];

// ...
// Control flow code for projectilfe
//...

int WhichProjectilfe = 4;
Projectiles[WhichProjectile];

Resources

- Official Lesson

반응형