Setup
這一章節(jié)會(huì)把之前的所有內(nèi)容進(jìn)行整合。我們將會(huì)編寫drawFrame函數(shù),通過主循環(huán)main loop將三角形繪制到屏幕。在mainLoop函數(shù)調(diào)用:
void mainLoop() { while (!glfwWindowShouldClose(window)) { glfwPollEvents(); drawFrame(); } glfwDestroyWindow(window); } ...void drawFrame() { }
Synchronization
drawFrame函數(shù)將會(huì)執(zhí)行如下操作: