Fix misuse of glTexImage2D (again).

This was originally changed in 74aa80b6, but the fix broke stipping
because it incorrectly changed the logic. Revert that, and just make
the textures smaller instead.
pull/507/head
whitequark 2019-11-23 15:56:57 +00:00
parent 2fe17a46c2
commit e74137dc67
1 changed files with 4 additions and 3 deletions

View File

@ -388,9 +388,10 @@ GLuint Generate(const std::vector<double> &pattern) {
GLint size;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size);
RgbaColor *textureData = new RgbaColor[size];
size /= 2;
int mipCount = (int)log2(size);
RgbaColor *textureData = new RgbaColor[size];
int mipCount = (int)log2(size) + 1;
for(int mip = 0; mip < mipCount; mip++) {
int dashI = 0;
double dashT = 0.0;
@ -423,8 +424,8 @@ GLuint Generate(const std::vector<double> &pattern) {
textureData);
size /= 2;
}
delete []textureData;
return texture;
}