Cob50nm
Cob50nm

Reputation: 961

opengl glProgramUniform___() causes program to crash

I'm trying to apply transforms within my vertex shader in VisualStudio2012 using visual c++ but when I try to use

glProgramUniform1f()

or any other variant of the glProgramUniform function it just crashes and gives me this error Unhandled exception at 0x7513C9F5 in Lab1.exe: 0xC0000005: Access violation executing location 0x00000000.

I tried running the code on a different machine and it runs fine, is there anything obvious that could be causing this?

I can't imagine that it's my computer not being able to handle the graphics manipulation as I have a nvidia 650m

Upvotes: 0

Views: 739

Answers (1)

Cob50nm
Cob50nm

Reputation: 961

I found the problem, there are two ways this can be done

glProgramUniform1f()

which didn't work for me, and

glUseProgram(shaderProgramID);

glUniform1f(transformLoc, 0.5);

which did work

Upvotes: 0

Related Questions