title: glUseProgramObjectARB invalid operation error
body: <p>I'm getting an "invalid operation" error when trying to use <code>glUseProgramObjectARB</code> and I have no idea why.</p>
  
  <p>The shader programs are loading correctly, I'm fairly sure. This is shown on <code>glGetInfoLogARB</code>:</p>
  
  <ul>
  <li>Vertex shader was successfully compiled to run on hardware.</li>
  <li>Fragment shader was successfully compiled to run on this hardware.</li>
  </ul>
  
  <p>There are no previous openGL errors before this command. So something with this specific command definitely appears to be the issue.</p>
  
  <p>I'm using glew with SDL. I was using GLee before, and getting the same problem.</p>
  
  <p>Reading the <a href="http://www.opengl-doc.com/Addison.Wesley-OpenGL.Shading1/0321197895/app02lev1sec24.html" rel="nofollow noreferrer">documentation</a> I assume it is this error:</p>
  
  <blockquote>
    <p>GL_INVALID_OPERATION is generated if program could not be made part of current state.</p>
  </blockquote>
  
  <p>but I'm not sure exactly what could cause such a thing. The command is issued in a working openGL context, as all the previous shader commands work fine. It is not between a "begin" and "end" block.</p>
  
  <p>Really I am stumped as to what it could mean. Perhaps there is some more specific case when the command can't be issued. If anyone knows anything more that would be great.</p>
  
  <p>EDIT:</p>
  
  <p>Solved: oh jesus that was retarded, I was missing a return on one of my function calls elsewhere and so wasn't passing back the program I'd constructed.</p>