I have a problem to load more than one file. Obj in OpenGL. I try to load the cmd file, but only the last file is load.
for(int i=0; i<2; i++){
if(!load_object(argv[i], OBJECT_LIST))){
printf("Error with file %s", argv[i]);
}}
OBJECT_LIST- is GLuint
Where is problem?
It looks like
OBJECT_LISTis being overwritten each time the loop iterates. I would imagine making use of an array is what you want:Another note: is there a reason you’re starting at
argv[0]? That contains your application’s filename, not the first argument.