<commit_before>package net.mgsx.game.core.helpers;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com.badlogic.gdx.utils.GdxRuntimeException;

public class ShaderProgramHelper {

	public static boolean verbose = true;
	public static boolean enableCrossCompilation = true;
	
	public static String shaderVersion = "#version 100";
	
	private static String prependVert;
	private static String prependFrag;
	private static boolean inited = false;
	
	private static void init(){
		if(!inited){
			
			prependVert = shaderVersion + "\n" + Gdx.files.classpath("shaders/header.vert").readString() + "\n";
			prependFrag = shaderVersion + "\n" + Gdx.files.classpath("shaders/header.frag").readString() + "\n";
			
			inited = true;
		}
	}
	
	/**
	 * Load or reload a shader program, useful for debugging.
	 * in case of loading, if shader is not compiling a runtime exception is thrown<commit_msg>fix GLSL version for MacOSX<commit_after>package net.mgsx.game.core.helpers;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com.badlogic.gdx.utils.GdxRuntimeException;

public class ShaderProgramHelper {

	public static boolean verbose = true;
	public static boolean enableCrossCompilation = true;
	
	/** version 120 is necessary for MacOSX */
	public static String shaderVersion = "#version 120";
	
	private static String prependVert;
	private static String prependFrag;
	private static boolean inited = false;
	
	private static void init(){
		if(!inited){
			
			prependVert = shaderVersion + "\n" + Gdx.files.classpath("shaders/header.vert").readString() + "\n";
			prependFrag = shaderVersion + "\n" + Gdx.files.classpath("shaders/header.frag").readString() + "\n";
			
			inited = true;
		}
	}
	
	/**
	 * Load or reload a shader program, useful for debugging.
	 * in case of loading, if shader is not compiling a runtime exception is thrown
{'fraction_non_alphanumeric': 0.10707171314741036, 'fraction_numerical': 0.004482071713147411, 'mean_word_length': 4.314814814814815, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2140817', 'n_tokens_mistral': 683, 'n_tokens_neox': 599, 'n_words': 173}