Permalink
Browse files

GLES 2.0 does not support Texture3D... removing it from Android and i…

…OS projects.
  • Loading branch information...
1 parent ac99b6c commit 6f811a20c8910186b03cef3562a64bb83ddad7c5 @tomspilman tomspilman committed Feb 13, 2013
@@ -217,11 +217,15 @@ public Texture2D GetValueTexture2D ()
return (Texture2D)Data;
}
- // TODO: Add Texture3D support!
- // public Texture3D GetValueTexture3D ()
- // {
- // return new Texture3D ();
- // }
+#if !GLES
+ public Texture3D GetValueTexture3D ()
+ {
+ if (ParameterClass != EffectParameterClass.Object || ParameterType != EffectParameterType.Texture3D)
+ throw new InvalidCastException();
+
+ return (Texture3D)Data;
+ }
+#endif
public TextureCube GetValueTextureCube ()
{
@@ -535,11 +539,13 @@ public void SetValue (Texture value)
ParameterType != EffectParameterType.Texture2D)
throw new InvalidCastException();
}
+#if !GLES
else if (value is Texture3D)
{
if (ParameterType != EffectParameterType.Texture3D)
throw new InvalidCastException();
}
+#endif
else
{
if (!(value is TextureCube) || ParameterType != EffectParameterType.TextureCube)
@@ -6,12 +6,6 @@
using MonoMac.OpenGL;
#elif WINDOWS || LINUX
using OpenTK.Graphics.OpenGL;
-#elif GLES
-using OpenTK.Graphics.ES20;
-using TextureTarget = OpenTK.Graphics.ES20.All;
-using PixelFormat = OpenTK.Graphics.ES20.All;
-using PixelInternalFormat = OpenTK.Graphics.ES20.All;
-using PixelType = OpenTK.Graphics.ES20.All;
#endif
#elif DIRECTX
// TODO!
@@ -44,11 +38,7 @@ public Texture3D (GraphicsDevice graphicsDevice, int width, int height, int dept
#if OPENGL
this.glTarget = TextureTarget.Texture3D;
-#if IOS || ANDROID
- GL.GenTextures(1, ref this.glTexture);
-#else
- GL.GenTextures(1, out this.glTexture);
-#endif
+ GL.GenTextures(1, out this.glTexture);
GraphicsExtensions.CheckGLError();
GL.BindTexture (glTarget, glTexture);
@@ -127,7 +127,6 @@
<Compile Include="Graphics\PresentInterval.cs" />
<Compile Include="Graphics\States\SamplerState.cs" />
<Compile Include="Graphics\Texture2D.cs" />
- <Compile Include="Graphics\Texture3D.cs" />
<Compile Include="Graphics\TextureCube.cs" />
<Compile Include="Microsoft\Devices\Sensors\AccelerometerFailedException.cs" />
<Compile Include="Microsoft\Devices\Sensors\AccelerometerReading.cs" />
@@ -354,7 +354,6 @@
<Compile Include="Graphics\ModelMeshPartCollection.cs" />
<Compile Include="Graphics\CubeMapFace.cs" />
<Compile Include="Graphics\Texture2D.cs" />
- <Compile Include="Graphics\Texture3D.cs" />
<Compile Include="Graphics\PackedVector\IPackedVector.cs" />
<Compile Include="Graphics\PackedVector\Short2.cs" />
<Compile Include="Graphics\PackedVector\Short4.cs" />

0 comments on commit 6f811a2

Please sign in to comment.