[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Addition to WebGLContextLostEvent wrt extensions

On 09/04/2010, at 7:22 PM, Gregg Tavares wrote:
By the time the code gets to runMainLoop everything seems fine but it's not. Every resource created before WebGLContextLost is bad. They won't check for errors during the main loop because that's bad form for GL programs. So, their app has a few textures missing or a few something else is not setup correctly but because behind the scenes the lost context was auto restored they have no idea what happened.

I must say that I don't like the file analogy for WebGLContext. File I/ O is sufficiently unreliable that the reality intrudes into the abstraction, however we don't check for errors while writing to variables or using CPU registers or any number of other things. As much as possible, we have an artificial world where we can do things and expect them to work.

It sounds like some persistent error flag needs to be set, so that any error in the main loop can be checked after the main loop has terminated. It would be up to the developer to check as frequently as they want, perhaps in response to a system event or some other higher- level system.

The problem here is that in theory, the error could be detected the nanosecond it happens in the middle of drawing a triangle. In practice, we really don't want to know until we're programming things like "when the window changes, reload the context".


----------------------------------------------------------- You are currently subscribe to public_webgl@khronos.org. To unsubscribe, send an email to majordomo@khronos.org with the following command in the body of your email: