-
-
- /* ya encore de la place dans le tableau de context ? */
- if (textab[ID].context_count == textab[ID].context_size)
- {
-#ifdef PRINT
- printf("InstallTextureInContext::allocation dans le context\n");
-#endif
- textab[ID].context_size += GROW_CONTEXT;
-#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)
- textab[ID].number =
- (GLuint*)realloc(textab[ID].number, textab[ID].context_size*sizeof(GLuint));
- textab[ID].context =
- (GLCONTEXT*)realloc(textab[ID].context, textab[ID].context_size*sizeof(GLCONTEXT));
- textab[ID].drawable =
- (GLDRAWABLE*)realloc(textab[ID].drawable, textab[ID].context_size*sizeof(GLDRAWABLE));
- textab[ID].use_bind_texture =
- (char*)realloc(textab[ID].use_bind_texture, textab[ID].context_size);
-#else
- textab[ID].number =
- cmn_resizemem<GLuint>(textab[ID].number, textab[ID].context_size);
- textab[ID].context =
- cmn_resizemem<GLCONTEXT>(textab[ID].context, textab[ID].context_size);
- textab[ID].drawable =
- cmn_resizemem<GLDRAWABLE>(textab[ID].drawable, textab[ID].context_size);
- textab[ID].use_bind_texture =
- cmn_resizemem<char>(textab[ID].use_bind_texture, textab[ID].context_size);
-#endif
- if ( (textab[ID].number == NULL) ||
- (textab[ID].context == NULL) ||
- (textab[ID].drawable == NULL) ||
- (textab[ID].use_bind_texture == NULL) )
- {
- /* erreur => libere tout */
- free(textab[ID].number);
- free(textab[ID].context);
- free(textab[ID].drawable);
- free(textab[ID].use_bind_texture);
- textab[ID].context_size = 0;
-
- return TEXTUREBOX_ERROR;
- }
- }
-