Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 908 vs 909 for /trunk/Source Code/Platform/Video/OpenGL/Textures/glTexture.cpp

Diff revisions: vs.
  @@ -24,7 +24,7 @@
24 24 const TextureDescriptor& texDescriptor)
25 25
26 26 : Texture(context, descriptorHash, name, resourceName, resourceLocation, isFlipped, asyncLoad, texDescriptor),
27 - glObject(glObjectType::TYPE_TEXTURE),
27 + glObject(glObjectType::TYPE_TEXTURE, context),
28 28 _lockManager(MemoryManager_NEW glLockManager())
29 29 {
30 30 GL_API::getOrCreateSamplerObject(_descriptor.getSampler());
  @@ -62,7 +62,7 @@
62 62
63 63 void glTexture::threadedLoad(DELEGATE_CBK<void, CachedResource_wptr> onLoadCallback) {
64 64 if (_asyncLoad) {
65 - GL_API::createOrValidateContextForCurrentThread();
65 + GL_API::createOrValidateContextForCurrentThread(_context);
66 66 }
67 67
68 68 Texture::threadedLoad(onLoadCallback);
  @@ -85,8 +85,8 @@
85 85 }
86 86
87 87 void glTexture::resize(const bufferPtr ptr,
88 - const vec2<U16>& dimensions,
89 - const vec2<U16>& mipLevels) {
88 + const vec2<U16>& dimensions) {
89 +
90 90 U32 textureID = _textureData.getHandleHigh();
91 91 if (textureID > 0 && _allocatedStorage) {
92 92 // Immutable storage requires us to create a new texture object
  @@ -98,6 +98,10 @@
98 98 textureID = tempHandle;
99 99 }
100 100
101 + vec2<U16> mipLevels(0, _descriptor.getSampler().generateMipMaps()
102 + ? 1 + Texture::computeMipCount(_width, _height)
103 + : 1);
104 +
101 105 _textureData.setHandleHigh(textureID);
102 106 _allocatedStorage = false;
103 107 _descriptor._mipLevels.set(mipLevels);