Commits

Tobias Bohnen committed 999083b

Comments (0)

Files changed (18)

ExampleBrowser/Examples/OpenTK/Advanced/GsShrinky.cs

             var x = CgContext.LastListing;
 
             vertexProfile = ProfileType.GlslV;
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                Program.CreateFromFile(
                  null);                    /* No extra compiler options */
 
             fragmentProfile = ProfileType.GlslF;
-             CgGL.SetOptimalOptions(fragmentProfile);
+             fragmentProfile.SetOptimalOptions();
 
             fragmentProgram =
               Program.CreateFromFile(

ExampleBrowser/Examples/OpenTK/Advanced/GsSimple.cs

                 GeometryProgramName,      /* Entry function name */
                 null);                      /* No extra compiler options */
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
             if (geometryProfile == ProfileType.GlslG)
             {
                 vertexProfile = ProfileType.GlslV;
             }
 
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                Program.CreateFromFile(
                  VertexProgramName,      /* Entry function name */
                  null);                    /* No extra compiler options */
 
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
             if (geometryProfile == ProfileType.GlslG)
             {
                 fragmentProfile = ProfileType.GlslF;
             }
 
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile.SetOptimalOptions();
 
             fragmentProgram =
               Program.CreateFromFile(

ExampleBrowser/Examples/OpenTK/Advanced/IncludeString.cs

             CgGL.SetDebugMode(false);
             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             this.CgContext.SetCompilerIncludeString("shader/output.cg",
             @"

ExampleBrowser/Examples/OpenTK/Basic/Bulge.cs

             CgGL.SetDebugMode(false);
             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 this.CgContext.CreateProgramFromFile(
             this.vertexParamFrequency.Set(2.4f);
             this.vertexParamShininess.Set(35f);
 
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
+            fragmentProfile.SetOptimalOptions();
 
             fragmentProgram =
                 this.CgContext.CreateProgram(

ExampleBrowser/Examples/OpenTK/Basic/BumpMapWall.cs

             CgGL.SetDebugMode(false);
             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 this.CgContext.CreateProgramFromFile(
             this.vertexParamModelViewProj =
                 vertexProgram.GetNamedParameter("modelViewProj");
 
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
+            fragmentProfile.SetOptimalOptions();
 
             fragmentProgram =
                 this.CgContext.CreateProgramFromFile(

ExampleBrowser/Examples/OpenTK/Basic/FragmentLighting.cs

             CgGL.SetDebugMode(false);
             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 this.CgContext.CreateProgramFromFile(
 
             this.myCgVertexParam_modelViewProj = vertexProgram.GetNamedParameter("modelViewProj");
 
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
+            fragmentProfile.SetOptimalOptions();
 
             /* Specify "color passthrough" fragment program with a string. */
             fragmentProgram =

ExampleBrowser/Examples/OpenTK/Basic/ParticleSystem.cs

             this.CgContext = CgNet.Context.Create();
             CgGL.SetDebugMode(false);
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 this.CgContext.CreateProgramFromFile(
             this.vertexParamModelViewProj =
                 vertexProgram.GetNamedParameter("modelViewProj");
 
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
+            fragmentProfile.SetOptimalOptions();
 
             fragmentProgram =
                 this.CgContext.CreateProgramFromFile(

ExampleBrowser/Examples/OpenTK/Basic/ProjectiveTexturing.cs

             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
             this.CgContext.SetManageTextureParameters(true);
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 this.CgContext.CreateProgramFromFile(
             /* Set light source color parameters once. */
             this.myCgVertexParamKd.Set(this.kd);
 
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
+            fragmentProfile.SetOptimalOptions();
 
             /* Specify "color passthrough" fragment program with a string. */
             fragmentProgram =

ExampleBrowser/Examples/OpenTK/Basic/SpecularBumpMap.cs

             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
             this.CgContext.SetManageTextureParameters(true);
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 this.CgContext.CreateProgramFromFile(
             this.myCgVertexParam_modelViewProj =
                 vertexProgram.GetNamedParameter("modelViewProj");
 
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
+            fragmentProfile.SetOptimalOptions();
 
             fragmentProgram =
                 this.CgContext.CreateProgramFromFile(

ExampleBrowser/Examples/OpenTK/Basic/TextureSampling.cs

             CgGL.SetDebugMode(false);
             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 this.CgContext.CreateProgramFromFile(
             vertexProgram.Load();
 
             /* No uniform vertex program parameters expected. */
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
+            fragmentProfile.SetOptimalOptions();
 
             fragmentProgram =
                 this.CgContext.CreateProgramFromFile(

ExampleBrowser/Examples/OpenTK/Basic/TwoTextureAccesses.cs

             CgGL.SetDebugMode(false);
             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 this.CgContext.CreateProgramFromFile(
             this.vertexParamRightSeparation =
                 vertexProgram.GetNamedParameter("rightSeparation");
 
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
+            fragmentProfile.SetOptimalOptions();
 
             fragmentProgram =
                 this.CgContext.CreateProgramFromFile(

ExampleBrowser/Examples/OpenTK/Basic/UniformParameter.cs

             CgGL.SetDebugMode(false);
             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 this.CgContext.CreateProgramFromFile(
 
             this.vertexParamConstantColor = vertexProgram.GetNamedParameter("constantColor");
 
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
+            fragmentProfile.SetOptimalOptions();
 
             fragmentProgram =
                 this.CgContext.CreateProgramFromFile(

ExampleBrowser/Examples/OpenTK/Basic/VaryingParameter.cs

             CgGL.SetDebugMode(false);
             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 this.CgContext.CreateProgramFromFile(
                     null); /* No extra compiler options */
             vertexProgram.Load();
 
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
+            fragmentProfile.SetOptimalOptions();
 
             fragmentProgram =
                 this.CgContext.CreateProgramFromFile(

ExampleBrowser/Examples/OpenTK/Basic/VertexAndFragmentProgram.cs

             CgGL.SetDebugMode(false);
             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 this.CgContext.CreateProgramFromFile(
                     null); /* No extra compiler options */
             vertexProgram.Load();
 
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
+            fragmentProfile.SetOptimalOptions();
 
             fragmentProgram =
                 this.CgContext.CreateProgramFromFile(

ExampleBrowser/Examples/OpenTK/Basic/VertexLighting.cs

             CgGL.SetDebugMode(false);
             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 CgContext.CreateProgramFromFile(
             myCgVertexParam_globalAmbient.Set(myGlobalAmbient);
             myCgVertexParam_lightColor.Set(myLightColor);
 
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
+            fragmentProfile.SetOptimalOptions();
 
             /* Specify "color passthrough" fragment program with a string. */
             fragmentProgram =

ExampleBrowser/Examples/OpenTK/Basic/VertexProgram.cs

             CgGL.SetDebugMode(false);
             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 this.CgContext.CreateProgramFromFile(

ExampleBrowser/Examples/OpenTK/Basic/VertexTransform.cs

             GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
 
             vertexProgram.Bind();
-
             vertexProfile.Enable();
 
             fragmentProgram.Bind();
-
             fragmentProfile.Enable();
 
             /* modelView = rotateMatrix * translateMatrix */
             CgGL.SetDebugMode(false);
             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 this.CgContext.CreateProgramFromFile(
 
             this.vertexParamModelViewProj = vertexProgram.GetNamedParameter("modelViewProj");
 
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
+            fragmentProfile.SetOptimalOptions();
 
             /* Specify fragment program with a string. */
             fragmentProgram =

ExampleBrowser/Examples/OpenTK/Basic/VertexTwisting.cs

             CgGL.SetDebugMode(false);
             this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
 
-            vertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
-            CgGL.SetOptimalOptions(vertexProfile);
+            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
+            vertexProfile.SetOptimalOptions();
 
             vertexProgram =
                 this.CgContext.CreateProgramFromFile(
 
             vertexParam_twisting = vertexProgram.GetNamedParameter("twisting");
 
-            fragmentProfile = CgGL.GetLatestProfile(ProfileClass.Fragment);
-            CgGL.SetOptimalOptions(fragmentProfile);
+            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
+            fragmentProfile.SetOptimalOptions();
 
             fragmentProgram =
                 this.CgContext.CreateProgramFromFile(