--- deliantra/Deliantra-Client/DC/Texture.pm 2007/12/26 21:03:21 1.31 +++ deliantra/Deliantra-Client/DC/Texture.pm 2007/12/27 20:38:49 1.32 @@ -326,8 +326,16 @@ } $DC::OpenGL::INIT_HOOK{"DC::Texture"} = sub { - for (values %TEXTURES) { - $_->upload if $_->{want_upload}; + for my $tex (values %TEXTURES) { + if (my $name = $tex->{want_upload}) { + $tex->upload; + + if ($tex->{loading} && $name > 0) { + # if loading is delayed we still have to allocate the texture name + glBindTexture GL_TEXTURE_2D, $name; + glTexImage2D GL_TEXTURE_2D, 0, GL_ALPHA, 0, 0, 0, GL_ALPHA, GL_UNSIGNED_BYTE; + } + } } };