我写下面的代码是为了解释我的问题.如果我注释第11行(使用关键字"using"),编译器不会编译该文件并显示以下错误:invalid conversion from 'char' to 'const char*'.它似乎没有void action(char)在Parent类中看到Son类的方法.
为什么编译器会以这种方式运行?或者我做错了什么?
class Parent
{
public:
virtual void action( const char how ){ this->action( &how ); }
virtual void action( const char * how ) = 0;
};
class Son : public Parent
{
public:
using Parent::action; // Why should i write this line?
void action( const char * how ){ printf( "Action: %c\n", *how ); }
};
int main( int argc, char** argv ) …Run Code Online (Sandbox Code Playgroud) 我应该在切换到使用较少(或不同位置)属性的程序着色器时禁用着色器属性吗?
我使用glEnableVertexAttribArray()/ glDisableVertexAttribArray()启用和禁用这些属性.
是否有任何性能影响,或者它是否会带来一些错误,或者启用/禁用将比激活所有属性慢并让它们激活?