From af94d707c0e230fdbad0b8b85df6c3dbbffdab84 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Wed, 28 Oct 2009 09:05:13 +0000 Subject: [PATCH] Renamed dds textures to not contain strange characters that confuse Prebuild. Added checks for extension support to SwizzledParallax sample. --- .../{Earth CubeMap.dds => earth-cubemap.dds} | Bin ...t.DDS => swizzled-rock-diffuse-height.dds} | Bin ...oss.DDS => swizzled-rock-normal-gloss.dds} | Bin Source/Examples/OpenGL/GLSL/DDSCubeMap.cs | 2 +- .../Examples/OpenGL/GLSL/SwizzledParallax.cs | 23 +++++++----------- 5 files changed, 10 insertions(+), 15 deletions(-) rename Source/Examples/Data/Textures/{Earth CubeMap.dds => earth-cubemap.dds} (100%) rename Source/Examples/Data/Textures/{Swizzled Rock Diffuse&Height.DDS => swizzled-rock-diffuse-height.dds} (100%) rename Source/Examples/Data/Textures/{Swizzled Rock Normal&Gloss.DDS => swizzled-rock-normal-gloss.dds} (100%) diff --git a/Source/Examples/Data/Textures/Earth CubeMap.dds b/Source/Examples/Data/Textures/earth-cubemap.dds similarity index 100% rename from Source/Examples/Data/Textures/Earth CubeMap.dds rename to Source/Examples/Data/Textures/earth-cubemap.dds diff --git a/Source/Examples/Data/Textures/Swizzled Rock Diffuse&Height.DDS b/Source/Examples/Data/Textures/swizzled-rock-diffuse-height.dds similarity index 100% rename from Source/Examples/Data/Textures/Swizzled Rock Diffuse&Height.DDS rename to Source/Examples/Data/Textures/swizzled-rock-diffuse-height.dds diff --git a/Source/Examples/Data/Textures/Swizzled Rock Normal&Gloss.DDS b/Source/Examples/Data/Textures/swizzled-rock-normal-gloss.dds similarity index 100% rename from Source/Examples/Data/Textures/Swizzled Rock Normal&Gloss.DDS rename to Source/Examples/Data/Textures/swizzled-rock-normal-gloss.dds diff --git a/Source/Examples/OpenGL/GLSL/DDSCubeMap.cs b/Source/Examples/OpenGL/GLSL/DDSCubeMap.cs index 5cd968b0..77ca65d6 100644 --- a/Source/Examples/OpenGL/GLSL/DDSCubeMap.cs +++ b/Source/Examples/OpenGL/GLSL/DDSCubeMap.cs @@ -41,7 +41,7 @@ namespace Examples.Tutorial // Textures const TextureUnit TMU0_Unit = TextureUnit.Texture0; const int TMU0_UnitInteger = 0; - const string TMU0_Filename = "Data/Textures/Earth CubeMap.dds"; + const string TMU0_Filename = "Data/Textures/earth-cubemap.dds"; uint TMU0_Handle; TextureTarget TMU0_Target; diff --git a/Source/Examples/OpenGL/GLSL/SwizzledParallax.cs b/Source/Examples/OpenGL/GLSL/SwizzledParallax.cs index 7ab31500..214d5e09 100644 --- a/Source/Examples/OpenGL/GLSL/SwizzledParallax.cs +++ b/Source/Examples/OpenGL/GLSL/SwizzledParallax.cs @@ -48,15 +48,13 @@ namespace Examples.Tutorial // Textures const TextureUnit TMU0_Unit = TextureUnit.Texture0; const int TMU0_UnitInteger = 0; - //const string TMU0_Filename = "Data/Textures/Swizzled Metal Diffuse&Height.dds"; - const string TMU0_Filename = "Data/Textures/Swizzled Rock Diffuse&Height.dds"; + const string TMU0_Filename = "Data/Textures/swizzled-rock-diffuse-height.dds"; uint TMU0_Handle; TextureTarget TMU0_Target; const TextureUnit TMU1_Unit = TextureUnit.Texture1; const int TMU1_UnitInteger = 1; - //const string TMU1_Filename = "Data/Textures/Swizzled Metal Normal&Gloss.dds"; - const string TMU1_Filename = "Data/Textures/Swizzled Rock Normal&Gloss.dds"; + const string TMU1_Filename = "Data/Textures/swizzled-rock-normal-gloss.dds"; uint TMU1_Handle; TextureTarget TMU1_Target; @@ -76,22 +74,19 @@ namespace Examples.Tutorial { this.VSync = VSyncMode.Off; - /* // Check for necessary capabilities: - if ( !GL.SupportsExtension( "VERSION_2_0" ) ) + string extensions = GL.GetString(StringName.Extensions); + if ( !GL.GetString(StringName.Extensions).Contains("GL_ARB_shading_language")) { - MessageBox.Show( "You need at least OpenGL 2.0 to run this example. Aborting.", - "GLSL not supported", MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); - this.Exit( ); + throw new NotSupportedException(String.Format("This example requires OpenGL 2.0. Found {0}. Aborting.", + GL.GetString(StringName.Version).Substring(0, 3))); } - if ( !GL.SupportsExtension( "GL_ARB_texture_compression" ) || - !GL.SupportsExtension( "GL_EXT_texture_compression_s3tc" ) ) + if (!extensions.Contains("GL_ARB_texture_compression") || + !extensions.Contains("GL_EXT_texture_compression_s3tc")) { - MessageBox.Show( "Texture compression extensions not found. Trying to run anyways.", - "Possible problem", MessageBoxButtons.OK, MessageBoxIcon.Warning ); + throw new NotSupportedException("This example requires support for texture compression. Aborting."); } - */ int[] temp = new int[1]; GL.GetInteger( GetPName.MaxTextureImageUnits, out temp[0] );