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f),
FVWITHZ(-1.0f, -1.0f,-1.0f,1.0f,0.0f, 1.0f, 0.0f, 1.0f,0.0f),
FVWITHZ(-1.0f, -1.0f,-2.0f,1.0f,0.0f, 1.0f, 0.0f, 1.0f,1.0f),
};
编译时,我收到错误“错误:'TextureVertexWithZ'没有命名类型”
任何帮助将不胜感激
答案 0 :(得分:3)
很简单,这意味着编译器不知道TextureVertexWithZ
是什么。大概你忘了包含声明它的头文件。