Cg关键字(keywords)

本文详细介绍了Cg (NVIDIA C for graphics) 编程语言中的保留关键字列表,并提供了关于标识符保留规则的说明。文章特别指出了一些常用的数据类型如矩阵(matrix)和向量类型(vectortypes)虽然未被正式列为保留字,但仍建议将其视为保留字使用以避免混淆。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

保留标识符

除了下面列出的,任何以两个的下划线作为前缀(例如,__ newType)的标识符被保留。

注意,矩阵(matrix)和向量类型(vector types)(如half2x3float4)不在该列表中,因为它们可以被用作标识符。不过,我们建议你把矩阵和向量类型的保留字,从而避免混淆

Cg 关键字

下方是Cg(NVIDIA C for graphics)保留字列表,标有星号不区分大小写

asm*              explicit           pixelfragment*       template

asm_fragment      extern             pixelshader*         texture*

auto              FALSE              private              texture1D

bool              fixed              protected            texture2D

break             float*             public               texture3D

case              for                register             textureCUBE

catch             friend             reinterpret_cast     textureRECT

char              get                return               this

class             goto               row_major            throw

column_major      half               sampler              TRUE

compile           if                 sampler_state        try

const             in                 sampler1D            typedef

const_cast        inline             sampler2D            typeid

continue          inout              sampler3D            typename

decl*             int                samplerCUBE          uniform

default           interface          shared               union

delete            long               short                unsigned

discard           matrix*            signed               using

do                mutable            sizeof               vector*

double            namespace          static               vertexfragment*

dword*            new                static_cast          vertexshader*

dynamic_cast      operator           string*              virtual

else              out                struct               void

emit              packed             switch               volatile

enum              pass*              technique*           while

 

说明

版权归 NVIDIA公司:http://http.developer.nvidia.com/CgTutorial/cg_tutorial_appendix_d.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值