Main repository of MikuMikuStudio
Révision | da676279e8881cb1d630f4663c23c75397b0d4b5 (tree) |
---|---|
l'heure | 2013-04-20 02:00:25 |
Auteur | ShAdOwIsLoRd <ShAdOwIsLoRd@75d0...> |
Commiter | ShAdOwIsLoRd |
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@10563 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
@@ -319,7 +319,7 @@ public class LwjglRenderer implements Renderer { | ||
319 | 319 | } |
320 | 320 | } |
321 | 321 | |
322 | - if (ctxCaps.GL_EXT_texture_array) { | |
322 | + if (ctxCaps.GL_EXT_texture_array || ctxCaps.OpenGL30) { | |
323 | 323 | caps.add(Caps.TextureArray); |
324 | 324 | } |
325 | 325 |
@@ -1753,6 +1753,7 @@ public class LwjglRenderer implements Renderer { | ||
1753 | 1753 | if (context.pointSprite) { |
1754 | 1754 | return; // Attempt to fix glTexParameter crash for some ATI GPUs |
1755 | 1755 | } |
1756 | + | |
1756 | 1757 | // repeat modes |
1757 | 1758 | switch (tex.getType()) { |
1758 | 1759 | case ThreeDimensional: |
@@ -1886,9 +1887,15 @@ public class LwjglRenderer implements Renderer { | ||
1886 | 1887 | TextureUtil.uploadTexture(img, GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, i, 0); |
1887 | 1888 | } |
1888 | 1889 | } else if (target == EXTTextureArray.GL_TEXTURE_2D_ARRAY_EXT) { |
1890 | + if (!caps.contains(Caps.TextureArray)) { | |
1891 | + throw new RendererException("Texture arrays not supported by graphics hardware"); | |
1892 | + } | |
1893 | + | |
1889 | 1894 | List<ByteBuffer> data = img.getData(); |
1895 | + | |
1890 | 1896 | // -1 index specifies prepare data for 2D Array |
1891 | 1897 | TextureUtil.uploadTexture(img, target, -1, 0); |
1898 | + | |
1892 | 1899 | for (int i = 0; i < data.size(); i++) { |
1893 | 1900 | // upload each slice of 2D array in turn |
1894 | 1901 | // this time with the appropriate index |