unmarshalFogDistanceMode :: GLint -> FogDistanceMode
unmarshalFogDistanceMode x
   -- TODO: Use EYE_RADIAL_NV from NV_fog_distance extension
   | y == 0x855b = EyeRadial
   | y == gl_EYE_PLANE = EyePlaneSigned
   -- TODO: Use EYE_PLANE_ABSOLUTE_NV from NV_fog_distance extension
   | y == 0x855c = EyePlaneAbsolute
   | otherwise = error ("unmarshalFogDistanceMode: illegal value " ++ show x)
   where y = fromIntegral x

--------------------------------------------------------------------------------
unmarshalFogDistanceMode :: GLint -> FogDistanceMode
unmarshalFogDistanceMode x
   -- TODO: Use EYE_RADIAL_NV from NV_fog_distance extension
   | y == 0x855b = EyeRadial
   | y == gl_EYE_PLANE = EyePlaneSigned
   -- TODO: Use EYE_PLANE_ABSOLUTE_NV from NV_fog_distance extension
   | y == 0x855c = EyePlaneAbsolute
   | otherwise = error ("unmarshalFogDistanceMode: illegal value " ++ show x)
   where y = fromIntegral x

--------------------------------------------------------------------------------
unmarshalFogDistanceMode x
   -- TODO: Use EYE_RADIAL_NV from NV_fog_distance extension
   | y == 0x855b = EyeRadial
   | y == gl_EYE_PLANE = EyePlaneSigned
   -- TODO: Use EYE_PLANE_ABSOLUTE_NV from NV_fog_distance extension
   | y == 0x855c = EyePlaneAbsolute
   | otherwise = error ("unmarshalFogDistanceMode: illegal value " ++ show x)
   where y = fromIntegral x

--------------------------------------------------------------------------------