Jump to content
  • Advertisement
Sign in to follow this  
Tasaq

glGetUniformLocation crash

This topic is 2520 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok so i am getting the location of my uniform sampler2D from my shader but i got the "program stop working" thing. I am 99% sure that glGetUniformLocation is my problem here, but when i set breakpoint there and run it with debuger the function returned normal number(by normal i mean not -1). Also if I run w/o breakpoints it stops me at free.c file, at the line:

retval = HeapFree(_crtheap, 0, pBlock);

Someone know what happened?

Share this post


Link to post
Share on other sites
Advertisement
Any kind of error in free.c is usually some kind of problem with your code and not free.c

could you post the code in whi[font=arial,helvetica,sans-serif]ch you call [/font]glGetUniformLocation()

the proper use should be something like this:







unsigned int texture_location = glGetUniformLocation(shaderID, "color_texture");

and when you bind a texture:


glUniform1i(texture_location, 0);
glBindTexture(GL_TEXTURE_2D, texture);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!