Sometimes when disconnecting external monitors from laptops, we have seen the following error.
DeveloperError: drawingBufferDimensions.x must be greater than zero.
Error
at new DeveloperError
Cesium.js:528:19
at PerspectiveOffCenterFrustum.getPixelSize
Cesium.js:1000508:39
at UniformStat.update
Cesium.js:88475:40
at Scene.render
Cesium.js:115270:12
at CesiumWidget.render
Cesium.js:124809:25
at render
Cesium.js:124345:28
Has anyone dealt with this before. Workarounds/easy fixes?
This has happened on the beta and also head of master as of August 26th 2014.
I haven’t seen that problem myself, but I can speculate that when disconnecting a monitor, the video card resets the GPU, which will cause the WebGL context to be lost. Cesium currently doesn’t handle that event, but if you are able to restart your application from scratch, you could investigate handling the event yourself.
I agree with Scott here that this is a context lost event. Cesium doesn’t support this event because (1) it is pretty rare, (2) it would require using A LOT of extra memory to basically save a copy of all the WebGL resources, and (3) can often be handled easier at the app level than at the Cesium engine level. In the future, we may provide an abstraction for the event, but in the meantime, handling it directly is a reasonable approach.
I'm sure you guys are correct. I will also add that this only happens with chrome. I have upgraded from an old beta build to the latest stable and used the render error hook to display an message instead.
I can believe this is Chrome-only since each browser may raise the event based on their implementation. The other case you may run into with Cesium is when a user opens or shuts a laptop cover or the laptop goes to sleep.