Ridiculous Image Loading/Shader/OpenGL "Error"

I am using Slick Utils to load an image in LWJGL, however when I start the program it crashes with the “error”

4.2.12217 Compatibility Profile Context 12.104
Sun Aug 18 22:25:31 EDT 2013 INFO:Use Java PNG Loader = true

This is my code for getting the image:


			int id = TextureLoader.getTexture(ext, new FileInputStream(new File("./res/textures/" + fileName))).getTextureID();

If anyone could point me in the right direction that would be great. This ridiculous “error” is making me nuts.

Update: I have removed the image loading and now I just receive a

4.2.12217 Compatibility Profile Context 12.104

I am using a shader. Would this be because of the shader? I was always able to run this with the shader, but as soon as I added the image loading it errored out. Now I have removed the image loading and it is still doing it! What should I do??

That’s not an error.

Cas :slight_smile:

Hahaha yeah that’s definitely not an error. Have you made sure the code works and something renders in the first place before wondering what the print-outs mean?

Well yes it completely worked, I was rendering a cube in from a model and/or from a Mesh class. Then one time I tried to run it and boom it crashes with that… Is it because of my shader? Here:

Vert:


#version 330

out vec3 fragColor;

in vec2 texCoord0;

uniform sampler2D sampler;

void main(){
	gl_FragColor = texture2d(sampler, texCoord0.xy);
}

Frag:


#version 330

layout (location = 0) in vec3 position;
layout (location = 1) in vec2 texCoord;

out vec2 texCoord0;

uniform mat4 transform;

void main(){
	gl_Position = transform * vec4(position, 1.0);
	texCoord0 = texCoord0;
}


AHA! It WAS the shader! Fixed and running now, sorry about this thread, if an admin wants to delete it feel free :slight_smile:

Your switched your shaders, vertex is actually the fragment shader and vice versa. Also check line 12 of your “frag” (the actual vertex shader), you are assigning texCoord0 to itself.

I hate GLSL.
So easy to make a simple mistake, but it takes anywhere up to 20 minutes to find it.

Yeah we need an IDE just for GLSL :wink:

No IDEs as such AFAIK, but some handy tools that I’ve used after finding this: http://stackoverflow.com/questions/5593274/tools-for-glsl-editing

EDIT: gah, beaten to it by cylab ::slight_smile:

Shameful self promotion … ;D

Praxis LIVE has a live GLSL component that allows you to try stuff out on the fly. The editor has syntax highlighting, though not autocomplete as yet. Fragment shader only at the moment - vertex editing coming hopefully in the next release.

The OpenGL pipeline is LWJGL based, so works much better than the WebGL stuff for me (which brings my laptop to its knees).

Must do a proper thread on here about Praxis LIVE, and uses like this at some point …