Skip to content

Commit

Permalink
Fix makefile
Browse files Browse the repository at this point in the history
Add note on attrib.material_ids.
  • Loading branch information
syoyo committed Apr 27, 2020
1 parent 3bf694f commit 1fa6cd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/viewer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ endif
all: viewer

viewer: viewer.o trackball.o glad.o
$(CC) -o $@ $? $(LDFLAGS)

viewer.o: viewer.c ../../tinyobj_loader_c.h trackball.h glad.h
$(CC) -c -o $@ $(CFLAGS) $<

trackball.o: trackball.c trackball.h
$(CC) -c -o $@ $(CFLAGS) $<

glad.o: glad.c glad.h khrplatform.h
$(CC) -c -o $@ $(CFLAGS) $<

clean:
@rm -rf viewer viewer.o trackball.o glad.o
2 changes: 2 additions & 0 deletions examples/viewer/viewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ static int LoadObjAndConvert(float bmin[3], float bmax[3],
vb[(3 * i + k) * stride + 8] = (c[2] * 0.5f + 0.5f);
}
}
/* You can access per-face material through attrib.material_ids[i] */

face_offset += (size_t)attrib.face_num_verts[i];
}

Expand Down

0 comments on commit 1fa6cd7

Please sign in to comment.