惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
S
Security @ Cisco Blogs
S
Secure Thoughts
Attack and Defense Labs
Attack and Defense Labs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Hacker News: Front Page
博客园 - 叶小钗
H
Heimdal Security Blog
Microsoft Security Blog
Microsoft Security Blog
Forbes - Security
Forbes - Security
AI
AI
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Troy Hunt's Blog
罗磊的独立博客
Application and Cybersecurity Blog
Application and Cybersecurity Blog
爱范儿
爱范儿
GbyAI
GbyAI
The Last Watchdog
The Last Watchdog
TaoSecurity Blog
TaoSecurity Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
D
DataBreaches.Net
Recent Announcements
Recent Announcements
Schneier on Security
Schneier on Security
C
Cisco Blogs
美团技术团队
D
Docker
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
月光博客
月光博客
雷峰网
雷峰网
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
H
Hackread – Cybersecurity News, Data Breaches, AI and More
A
Arctic Wolf
B
Blog RSS Feed
Cisco Talos Blog
Cisco Talos Blog
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
V2EX - 技术
V2EX - 技术
Y
Y Combinator Blog
N
News and Events Feed by Topic
www.infosecurity-magazine.com
www.infosecurity-magazine.com
W
WeLiveSecurity
Security Archives - TechRepublic
Security Archives - TechRepublic
G
GRAHAM CLULEY
Jina AI
Jina AI
Hugging Face - Blog
Hugging Face - Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Hacker News
The Hacker News

博客园 - HenryRead

OpenGL 像素在内存中的排列方式 Unreal Engine 4 一些小技巧或提示 介绍Unreal Engine 4中的接口(Interface)使用C++和蓝图 Project Euler Problem 17 [翻译]进化游戏的层次结构 - 用组件来重构你的游戏实体 [转载]Netmsg 局域网聊天程序 [转载]使用 WSAAsyncSelect 的 Winsock 编程模型 [转载]Singleton的一个基类实现 [转载] VC6 STLport-5.1.4 /STLport-4.6.2 编译,安装 [转载] 跨平台C++程序开发系列文章 计算机科学数学理论浅谈 (转载) 致初学作曲的业余音乐爱好者 (转载) 搜集的优良OpenGL教程 (转载) OpenGL教程 "Top Ten" (转载) fltk2更新简介 FLTK简介 开发者:我们应该在哪个层次编写代码? [Linux 书籍合集] Linux eBooks collection CodeLite可以媲美Code::Blocks 不指定
一种简单定义FourCC常量的方法 (C/C++)
HenryRead · 2012-09-13 · via 博客园 - HenryRead

FourCC实际上在C/C++表示一般是4个字节的整数。百度百科里的方法是

  #define MAKE_FOURCC(a,b,c,d) \   ( ((uint32_t)d) | ( ((uint32_t)c) << 8 ) | ( ((uint32_t)b) << 16 ) | ( ((uint32_t)a) << 24 ) )

有一种更简单的方法,直接使用字符来表示FourCC。

int fourCC = 'abcd';

0x 61 62 63 64

     'a' 'b' 'c'  'd'

在枚举中也可以使用

enum PlayerAction

{

     PA_Move = 'move',

     PA_Jump = 'jump',

}

比较的时候也可以直接使用

switch (val)

{

   case 'move':

      //do move action

     break;

   case 'jump':

     // do jump action

     break;

}