1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-25 21:09:43 +00:00

Validate near and far clip distances

This commit is contained in:
AnyOldName3 2022-08-20 16:14:22 +01:00
parent 9f26d6023b
commit 17c1053777

View file

@ -1276,6 +1276,11 @@ namespace MWRender
void RenderingManager::updateProjectionMatrix()
{
if (mNearClip < 0.0f)
throw std::runtime_error("Near clip is less than zero");
if (mViewDistance < mNearClip)
throw std::runtime_error("Viewing distance is less than near clip");
double width = Settings::Manager::getInt("resolution x", "Video");
double height = Settings::Manager::getInt("resolution y", "Video");