My program creates numerous small windows, each containing an opengl draw area. When first created, each draw area, at some point, calls glxmakecurrent. On some systems (on SGI, but less frequently/never on NT !), the program crashes after a certain number of windows are drawn. The crash occurs at glxmakecurrent.
This is the error message I get on SGI:
GL: Warning: failed to create context X Error of failed request: BadAlloc (insufficient resources for operation)
Major opcode of failed request: 147 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 0
Current serial number in output stream: 3976
This is some additional information I found:
BadAlloc may be generated if the server has delayed allocation of ancillary buffers until glXMakeCurrent is called, only to find that it has insufficient resources to complete the allocation. allocation of ancillary buffers
My question is …
Is there a way to allocate the necessary resources ahead of time, to properly create the draw area, or at least be able to detect a problem to avoid a crash ?