我刚开始加载一些obj文件并用opengl渲染它.当我渲染这些网格时,我得到了这个结果(见图片).我认为它有某种深度问题,但我不能自己弄明白.这是渲染的参数:
// Dark blue background
glClearColor(0.0f, 0.0f, 0.4f, 0.0f);
// Enable depth test
glEnable( GL_DEPTH_TEST );
// Cull triangles which normal is not towards the camera
glEnable(GL_CULL_FACE);
Run Code Online (Sandbox Code Playgroud)
我使用这个教程代码作为模板.https://code.google.com/p/opengl-tutorial-org/source/browse/#hg%2Ftutorial08_basic_shading

我想知道是否有可能解决这个模糊的模板函数:
//function1
template<typename returnType>
returnType call()
{
//function with return type
}
//function2
template<typename var>
void call()
{
//function without return type
}
call<int>(); //call function1
call<void>(); //call function2
Run Code Online (Sandbox Code Playgroud)
我想阻止以下解决方案:
//function1
template<typename returnType>
returnType call()
{
//function with return type
}
//function2
void call()
{
//function without
}
call<int>(); //call function1
call(); //call function2
Run Code Online (Sandbox Code Playgroud)