List of usage examples for com.badlogic.gdx.graphics.glutils ShaderProgram pedantic
boolean pedantic
To view the source code for com.badlogic.gdx.graphics.glutils ShaderProgram pedantic.
Click Source Link
From source file:airfoil.Main.java
License:Open Source License
@Override public void create() { Gdx.input.setInputProcessor(this); ShaderProgram.pedantic = false; this.bodyShader = new ShaderProgram(Gdx.files.internal("data/shaders/body.vert.glsl").readString(), Gdx.files.internal("data/shaders/body.frag.glsl").readString()); this.alive = this.bodyShader.isCompiled(); if (!this.alive) { Gdx.app.error(Main.Title, "Error compiling body shader " + this.bodyShader.getLog()); Gdx.app.exit();// www. j a v a 2 s . c om } else { this.axesShader = new ShaderProgram(Gdx.files.internal("data/shaders/axes.vert.glsl").readString(), Gdx.files.internal("data/shaders/axes.frag.glsl").readString()); this.alive = this.axesShader.isCompiled(); if (!this.alive) { Gdx.app.error(Main.Title, "Error compiling axes shader " + this.axesShader.getLog()); Gdx.app.exit(); } } }
From source file:com.bitfire.utils.ShaderLoader.java
License:Apache License
public static ShaderProgram fromString(String vertex, String fragment, String vertexName, String fragmentName, String defines) {//from w ww. j av a 2s .co m ShaderProgram.pedantic = ShaderLoader.Pedantic; ShaderProgram shader = new ShaderProgram(defines + "\n" + vertex, defines + "\n" + fragment); if (!shader.isCompiled()) { Gdx.app.error("ShaderLoader", shader.getLog()); Gdx.app.exit(); } else { if (defines != null && defines.length() > 0) { Gdx.app.log("ShaderLoader", vertexName + "/" + fragmentName + " compiled w/ (" + defines.replace("\n", ", ") + ")"); } else { Gdx.app.log("ShaderLoader", vertexName + "/" + fragmentName + " compiled!"); } } return shader; }
From source file:com.blastedstudios.ledge.ui.postprocessing.utils.ShaderLoader.java
License:Apache License
public static ShaderProgram fromString(String vertex, String fragment, String vertexName, String fragmentName, String defines) {// w w w.j a va 2 s . c o m ShaderProgram.pedantic = ShaderLoader.Pedantic; ShaderProgram shader = new ShaderProgram(defines + "\n" + vertex, defines + "\n" + fragment); if (!shader.isCompiled()) { Log.error("ShaderLoader", shader.getLog()); System.exit(-1); } return shader; }
From source file:com.gamejolt.mikykr5.ceidecpong.GameCore.java
License:Open Source License
@Override public void create() { AsyncAssetLoader loader = AsyncAssetLoader.getInstance(); // Set up rendering fields and settings. ShaderProgram.pedantic = false; // Not passing all variables to a shader will not close the game. batch = new SpriteBatch(); batch.enableBlending();//from w w w . ja va 2 s . c o m batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); pixelPerfectCamera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); // Prepare the fading effect. Pixmap pixmap = new Pixmap(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), Format.RGBA4444); pixmap.setColor(0, 0, 0, 1); pixmap.fill(); fadeTexture = new Texture(pixmap); pixmap.dispose(); // Create the initial interpolators and start with a fade in effect. alpha = new MutableFloat(1.0f); fadeOut = Tween.to(alpha, 0, 0.5f).target(1.0f).ease(TweenEquations.easeInQuint); fadeIn = Tween.to(alpha, 0, 2.5f).target(0.0f).ease(TweenEquations.easeInQuint); fadeIn.start(); fading = true; // Create application states. states = new BaseState[game_states_t.getNumStates()]; try { states[game_states_t.LOGO_SCREEN.getValue()] = new LogoScreenState(this); states[game_states_t.MAIN_MENU.getValue()] = new MainMenuState(this); states[game_states_t.IN_GAME.getValue()] = new InGameState(this); states[game_states_t.LOADING.getValue()] = new LoadingState(this); states[game_states_t.QUIT.getValue()] = null; } catch (IllegalArgumentException e) { Gdx.app.error(TAG, CLASS_NAME + ".create(): Illegal argument caught creating states: ", e); System.exit(1); return; } // Register every state as an AssetsLoadedListener if the state implements the interface. for (BaseState state : states) { if (state != null && state instanceof AssetsLoadedListener) loader.addListener((AssetsLoadedListener) state); } AsyncAssetLoader.freeInstance(); loader = null; // Set the initial current and next states. currState = game_states_t.LOGO_SCREEN; nextState = null; this.setScreen(states[currState.getValue()]); // Set log level if (ProjectConstants.DEBUG) { Gdx.app.setLogLevel(Application.LOG_DEBUG); } else { Gdx.app.setLogLevel(Application.LOG_NONE); } }
From source file:com.github.unluckyninja.mousekiller.MainMenu.java
License:Open Source License
public MainMenu(MouseKiller mk, SpriteBatch batch) { this.mk = mk; bgm = Gdx.audio.newMusic(Gdx.files.internal("HeyThere1.ogg")); bgm.setLooping(true);// w ww . java 2 s . co m camera = new OrthographicCamera(); stage = new Stage(MouseKiller.width, MouseKiller.height, true, mk.batch); bodyDef.position.set(20, 20); bodyDef.type = BodyDef.BodyType.KinematicBody; bodyDef.linearDamping = 0; box.setAsBox(2, 2); ShaderProgram.pedantic = false; }
From source file:com.kotcrab.vis.editor.module.project.ShaderCacheModule.java
License:Apache License
@Override public void init() { watcherModule.addListener(this); ShaderProgram.pedantic = false; reloadShaders(false); }
From source file:com.kotcrab.vis.runtime.util.ShaderLoader.java
License:Apache License
public ShaderLoader(FileHandleResolver resolver) { super(resolver); ShaderProgram.pedantic = false; }
From source file:com.kotcrab.vis.ui.widget.color.BasicColorPicker.java
License:Apache License
@Override public void draw(Batch batch, float parentAlpha) { boolean wasPedantic = ShaderProgram.pedantic; ShaderProgram.pedantic = false;//w w w .jav a 2 s . c o m super.draw(batch, parentAlpha); ShaderProgram.pedantic = wasPedantic; }
From source file:com.lum.scram.utils.ShaderLoader.java
License:Apache License
public static ShaderProgram fromString(String vertex, String fragment, String vertexName, String fragmentName, String defines) {/*from ww w . j ava 2 s .c om*/ ShaderProgram.pedantic = ShaderLoader.Pedantic; ShaderProgram shader = new ShaderProgram(defines + "\n" + vertex, defines + "\n" + fragment); if (!shader.isCompiled()) { Gdx.app.error("ShaderLoader", shader.getLog()); System.exit(-1); } return shader; }
From source file:com.lyeeedar.Roguelike3D.Graphics.Models.SkyBox.java
License:Open Source License
public SkyBox(String texture) { this.texture[0] = new Pixmap(Gdx.files.internal("data/textures/" + texture + "_px.png")); this.texture[1] = new Pixmap(Gdx.files.internal("data/textures/" + texture + "_nx.png")); this.texture[2] = new Pixmap(Gdx.files.internal("data/textures/" + texture + "_py.png")); this.texture[3] = new Pixmap(Gdx.files.internal("data/textures/" + texture + "_ny.png")); this.texture[4] = new Pixmap(Gdx.files.internal("data/textures/" + texture + "_pz.png")); this.texture[5] = new Pixmap(Gdx.files.internal("data/textures/" + texture + "_nz.png")); IntBuffer buffer = BufferUtils.newIntBuffer(1); buffer.position(0);//from www . ja v a 2 s .c om buffer.limit(buffer.capacity()); Gdx.gl20.glGenTextures(1, buffer); textureId = buffer.get(0); Gdx.gl20.glActiveTexture(SKYBOX_TEXTURE_ACTIVE_UNIT); Gdx.gl20.glBindTexture(GL20.GL_TEXTURE_CUBE_MAP, textureId); for (int i = 0; i < 6; i++) { glTexImage2D(GL20.GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, this.texture[i]); } float[] vertices = { -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, }; for (int i = 0; i < vertices.length; i++) { vertices[i] *= 10; } short[] indices = { 0, 1, 2, 3, 7, 1, 5, 4, 7, 6, 2, 4, 0, 1 }; mesh = new Mesh(true, 24, 14, new VertexAttribute(Usage.Position, 3, "a_position")); mesh.setVertices(vertices); mesh.setIndices(indices); final String vertexShader = Gdx.files.internal("data/shaders/model/skybox.vertex.glsl").readString(); final String fragmentShader = Gdx.files.internal("data/shaders/model/skybox.fragment.glsl").readString(); ShaderProgram.pedantic = true; shader = new ShaderProgram(vertexShader, fragmentShader); Gdx.gl20.glTexParameteri(GL20.GL_TEXTURE_CUBE_MAP, GL20.GL_TEXTURE_MIN_FILTER, GL20.GL_NEAREST); Gdx.gl20.glTexParameteri(GL20.GL_TEXTURE_CUBE_MAP, GL20.GL_TEXTURE_MAG_FILTER, GL20.GL_NEAREST); Gdx.gl20.glTexParameteri(GL20.GL_TEXTURE_CUBE_MAP, GL20.GL_TEXTURE_WRAP_S, GL20.GL_CLAMP_TO_EDGE); Gdx.gl20.glTexParameteri(GL20.GL_TEXTURE_CUBE_MAP, GL20.GL_TEXTURE_WRAP_T, GL20.GL_CLAMP_TO_EDGE); }