0%

extern “C”的作用

  • 1.指明函数是C函数
    C++支持函数重载,因此编译器编译函数的过程中会根据函数的名字和参数类型支持函数重载
    C语言不支持函数重载,编译C语言函数时函数名就足够了
    通过externc,C++编译器就知道此函数是C函数了,会只使用函数名,链接的时候就可以找到C函数了
  • 2.C头文件加上如下宏,C库可以正常编译,C库在C++项目中也可以使用了
1
2
3
4
5
6
7
#ifdef __cplusplus
extern "C"{
#endif
int add(int a,int b);
#ifdef __cplusplus
}
#endif
阅读全文 »

git clean -df

usage: git clean [-d] [-f] [-i] [-n] [-q] [-e ] [-x | -X] [—]

-q, --quiet           do not print names of files removed
-n, --dry-run         dry run
-f, --force           force
-i, --interactive     interactive cleaning
-d                    remove whole directories
-e, --exclude <pattern>
                      add <pattern> to ignore rules
-x                    remove ignored files, too
-X                    remove only ignored files

.gitignore

  • 1.touch .gitignore 创建.gitignore文件
  • 2.echo ‘filename’ >> .gitignore 要忽略的文件写入.gitignore中
阅读全文 »

PBR(基于物理的渲染)

Radiant Energy

Radiant Flux

Radiant Intensity

Solid Angle

Irradiance

Radiance

The Reflection Equation

The Rendering Equation

阅读全文 »

Texture Mapping(纹理映射)

Barycentric Coordinates (重心坐标)

Linear Interpolation(1D)

Bilinear Interpolation(双线性插值)

阅读全文 »