diff --git a/modules/gfx/src/gfx_object.cc b/modules/gfx/src/gfx_object.cc
index 0938781ac087e73e54c7f53b6cd4870c325eef3a..c205e6a1ccc772ee9c575e000acf4a857eff599f 100644
--- a/modules/gfx/src/gfx_object.cc
+++ b/modules/gfx/src/gfx_object.cc
@@ -166,8 +166,8 @@ void GfxObj::RenderGL(RenderPass pass)
     */
   
     if(clip_flag_) {
-      glEnable(GL_CLIP_DISTANCE0);
 #if OST_SHADER_SUPPORT_ENABLED
+      glEnable(GL_CLIP_DISTANCE0);
       GLuint cp = Shader::Instance().GetCurrentProgram();
       if(cp>0) {
         glUniform1i(glGetUniformLocation(cp,"clip_flag"),1);
@@ -214,7 +214,9 @@ void GfxObj::RenderGL(RenderPass pass)
     }
 
     if(clip_flag_) {
+#if OST_SHADER_SUPPORT_ENABLED
       glDisable(GL_CLIP_DISTANCE0);
+#endif
     }
 
     glPopMatrix();    
diff --git a/modules/gfx/src/scene.cc b/modules/gfx/src/scene.cc
index f61b0ed1edd96d165615ac7a7e25b7f8435ef75f..b3fd78bc235f3c90d6a3f41a8ef9463f58a518eb 100644
--- a/modules/gfx/src/scene.cc
+++ b/modules/gfx/src/scene.cc
@@ -1677,9 +1677,11 @@ void Scene::Export(const String& fname, unsigned int width,
   if(of_flag) {
     if(max_samples<0) {
       int msamples=0;
+#if OST_SHADER_SUPPORT_ENABLED
       if(OST_GL_VERSION_2_0) {
         glGetIntegerv(GL_SAMPLES, &msamples);
       }
+#endif
       max_samples=msamples;
     }
     if(!StartOffscreenMode(width,height, max_samples)) {