Solved LibGDX white Image?!?!?!?! Drives ME CRAZY!!!

package com.mygdx.game;

import java.awt.Rectangle;
import java.nio.IntBuffer;

import box2dLight.PointLight;
import box2dLight.RayHandler;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.GL30;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.physics.box2d.CircleShape;
import com.badlogic.gdx.physics.box2d.Fixture;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;
import com.badlogic.gdx.utils.BufferUtils;

public class MyGdxGame extends ApplicationAdapter {
	
	SpriteBatch batch;
	RayHandler rayhandler;
	World world;
	OrthographicCamera camera;
	private PointLight light;

	private static Texture texture;
	
	@Override
	public void create () {

		texture = new Texture(Gdx.files.internal("backround.png"));
		batch = new SpriteBatch();
		
		camera = new OrthographicCamera(1280, 720);

		world = new World(new Vector2(0, 1), true);
		rayhandler = new RayHandler(world);
	
		light = new PointLight(rayhandler, 1000, new Color(0,140,150,255), 32*30, 0, 20);
		
	}

	@Override
	public void render () {
		Gdx.gl20.glClearColor(1, 0, 0, 0);
		Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT);
		batch.setTransformMatrix(camera.combined);
		
		batch.begin();
		batch.draw(texture, 0, 0);
		
		rayhandler.setCombinedMatrix(camera);
		rayhandler.updateAndRender();
		
		batch.end();
	}
	@Override
	public void dispose() {
		texture.dispose();
		batch.dispose();
		world.dispose();
		rayhandler.dispose();
	}
	

}

i have looked on google and can not find anything but the f**king image just keeps on being white it works perfect if i start new project and use there image but why does not this one work?


      Gdx.gl20.glClearColor(1, 0, 0, 0);

This line shouldn’t be supposed to be


      Gdx.gl20.glClearColor(0, 0, 0, 1);

?

I don’t know libgdx well but isn’t the last value transparency?

Also did you try clearing color before this line instead of after this?

dident do any difference any idea why it does this?

I don’t know how your lighting works, but maybe try to disable it while debugging.

Another reason could be that the texture isn’t loaded correctly or GL_TEXTURE_2D
isn’t enabled.

Maybe give me a screenshot?

shows me normaly

http://s7.postimg.org/hkxi43qsb/DAMIT_PICTURE.png

then if i remove
rayhandler.setCombinedMatrix(camera);
rayhandler.updateAndRender();

it just shows black =P

Well that’s because of


Gdx.gl20.glClearColor(0, 0, 0, 1);

And what about this line:


      texture = new Texture(Gdx.files.internal("backround.png"));

Is it really supposed to be “backround.png”? :o

going to try make it jpg and see if it works

I was pointing out the spelling mistake. “back>G<round.png” instead of “backround.png”?

no checkt that as well does not seam to work either

it was named backround by mistake

it disepears completly when i change its location as well defuq

Maybe you could try to enable blending with glEnable(GL_BLEND); and use glBlendFunc(SRC_ALPHA, ONE_MINUS_SRC_ALPHA);

still white :frowning: funny to start a new library i have heard so much about and it literally takes a shit on me! cant display images is like drawing a line over the screen and naming the game
“the line of shit stains”

Maybe you should call batch.end(); right after you have drawn the texture and not after the rayhandler’s render.

now it does not show up at all, the image

Did you try disable lighting at all? When you debug you should start at the basics,
by disabling everything unnecessary

i think what i did was

batch.setTransformMatrix(camera.combined);

instead off

batch.setProjectionMatrix(camera.combined);

then moved

		rayhandler.setCombinedMatrix(camera);
		rayhandler.updateAndRender();

uder the drawed image so now it works

now it looks sexy as shit

http://s24.postimg.org/6cdr03ml1/DAMIT_PICTURE.png