- for(int i = 0; i < shader_ids.total; i++)
- {
- if(shader_ids.values[i]->window_id == current_window->get_id() &&
- !strcmp(shader_ids.values[i]->source, source))
- {
- unsigned int result = shader_ids.values[i]->handle;
- table_lock->unlock();
- *got_it = 1;
- return result;
+ for( int i=0; !ret && i<shader_ids.size(); ++i ) {
+ ShaderID &sp = *shader_ids[i];
+ if( sp.window_id == current_window->get_id() &&
+ !strcmp(sp.vert, vert) && !strcmp(sp.frag, frag) ) {
+ shader = shader_ids.values[i]->handle;
+ ret = 1;