Add 'brushed metal' texture

master
Peter Nelson 2013-02-06 19:49:57 +00:00
parent 857b4a40c5
commit 57e181ba3f
2 changed files with 21 additions and 0 deletions

View File

@ -49,6 +49,26 @@ void PTextures::InitTextures()
}
BindTexture(TEX_BACKTILE, size, size, buffer, GL_LUMINANCE);
/* Create brushed background tile */
for (int i = 0; i < size * size; i++) {
buffer[i] = (rand() & 0x3F) + 0x80;
// buffer[i] += 0x20 * sin(((i + 0 / size) % size) * M_PI / size);
}
for (int i = 0; i < size; i++) {
uint8_t *row = &buffer[i * size];
uint8_t tmp[size];
for (int j = 0; j < size; j++) {
uint16_t t = 0;
for (int k = 0; k < 19; k++) {
t += row[(j + k) % size];
}
tmp[j] = t / 19;
}
memcpy(row, tmp, size);
}
BindTexture(TEX_BACKTILE2, size, size, buffer, GL_LUMINANCE);
/* Create glow, focused at 1/3 down the window */
int cx = size / 2;
int cy = size / 3;

View File

@ -3,6 +3,7 @@
enum {
TEX_BACKTILE,
TEX_BACKTILE2,
TEX_BACKGLOW,
TEX_SLIDER1,