这是我正在开发的游戏引擎代码的一部分。当我构建/调试代码时,它会因编译器错误而停止:“Camera.cpp(70): error C2059: syntax error: '=='” 并且第 70 行是
if ( near == far )
线。它也发生在第 75 行:
(if near == NULL || far == NULL)
bool Camera::SetClippingPlanes( float near, float far )
{
if (near == far) //Line 70(First Error)
{
MessageBox(NULL, L"ERROR: The far and near clipping planes cannot be equal!", L"Error", MB_OK | MB_ICONERROR);
return false;
}
else
{
if (near == NULL || far == NULL) //Line 75(Second Error)
{
MessageBox(NULL, L"ERROR: Near and/or Far clipping planes are null!", L"Error", MB_OK | MB_ICONERROR);
return false;
}
else
{
nearPane = near;
farPane = far;
return true;
}
}
}
我还有其他以相同方式使用 == 运算符的函数,但它们没有收到错误。谢谢,如果你有任何建议...