Sfoglia il codice sorgente

macos/linux shaders now use #version 120

Mark Sibly 8 anni fa
parent
commit
85f8d311c4
1 ha cambiato i file con 10 aggiunte e 2 eliminazioni
  1. 10 2
      modules/mojo/graphics/glutil.monkey2

+ 10 - 2
modules/mojo/graphics/glutil.monkey2

@@ -136,7 +136,7 @@ End
 #end
 Function glCompile:Int( type:Int,source:String )
 	
-	#If __TARGET__="windows" Or __MOBILE_TARGET__ Or __WEB_TARGET__
+#If __TARGET__="windows" Or __MOBILE_TARGET__ Or __WEB_TARGET__
 
 		Const prefix:="
 #ifdef GL_ES
@@ -150,7 +150,15 @@ precision mediump float;
 		source=prefix+source
 		
 		If glexts.GL_draw_buffers source="#extension GL_EXT_draw_buffers : require~n"+source
-	#endif
+			
+#ElseIf __TARGET__="macos" or __TARGET__="linux"
+	
+		Const prefix:="
+#version 120
+"
+		source=prefix+source
+		 
+#EndIf
 	
 	Local shader:=glCreateShader( type )
 	glShaderSourceEx( shader,source )