Программерское
Mar. 15th, 2007 12:25 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
#ifdef DEBUG /* * Let's see if anyone finds this. If glTexImage2D() is called with * a NULL image pointer then load the texture image with something * interesting instead of leaving it indeterminate. */ if (data) { static const char message[8][32] = { " X X XXXXX XXX X ", " XX XX X X X X X ", " X X X X X X X ", " X X XXXX XXX XXXXX ", " X X X X X X ", " X X X X X X X ", " X X XXXXX XXX X X ", " " }; GLubyte *imgPtr = data; GLint h, i, j, k; for (h = 0; h < depth; h++) { for (i = 0; i < height; i++) { GLint srcRow = 7 - (i % 8); for (j = 0; j < width; j++) { GLint srcCol = j % 32; GLubyte texel = (message[srcRow][srcCol]=='X') ? 255 : 70; for (k = 0; k < components; k++) { *imgPtr++ = texel; } } } } } #endif
Совершенно случайно найдено в Mesa/src/mesa/main/teximage.c по причинам, о которых я уже писал
no subject
Date: 2007-03-14 09:47 pm (UTC)no subject
Date: 2007-03-15 05:51 am (UTC)no subject
Date: 2007-03-15 08:48 am (UTC)no subject
Date: 2007-03-15 02:38 pm (UTC)no subject
Date: 2007-03-15 02:56 pm (UTC)Твоя версия получше однако, глюков нету)