Textures not working in OpenGL 3+

Started by
12 comments, last by arka80 10 years, 2 months ago

Are you using glGetError after every function when you say you're getting GL_INVALID_ENUM everywhere? The error doesn't clear until you call glGetError, so if you called 100 functions before calling glGetError the error could be for any one of the 100 functions. If so, it's probably only the first GL_INVALID_ENUM that matters since the others are likely just ripple effects.

The code you provided is way too long for me to try to debug without being able to compile and run it, so knowing which OpenGL call is the first one to generate an error would really help focus on a small enough amount of code to be manageable.

Also, it appears GL_RGB is a valid internal format for glTexImage2D since it's in table 1. People do normally use sized or compressed formats though.

Advertisement

What about using ARB_debug_output or KHR_debug to pinpoint the place where something is going wrong?

chaos, panic and disorder - my work here is finished

Is the value of icol (in your vertex shader) zero by any chance?

What are the values of attrib_v_pos, attrib_v_normal & attrib_v_tex?

You are loading a bmp, according to these tutorials bmp stores bytes in BGR format, not RGB: glTexCoord2d call should be:

glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB, width, height, 0, GL_BGR, GL_UNSIGNED_BYTE, data);

Maybe...

This topic is closed to new replies.

Advertisement