→ xpride:glutDisplayFunc 可以接受有參數的 function嗎? 02/18 15:23
→ xpride:很多人從來不去看錯誤訊息,直接就點掉了 02/18 15:24
→ Hack:冏 那請問有任何替代方案嗎? 還是OpenGL只能寫死呢 02/18 15:36
→ Feis:Global variable 或替代品們 02/18 15:54
推 Bencrie:把畫圖的部份從 DisplayFunc 拉出去獨立成另一個函數 02/18 17:17
→ iamstudent:有點擔心你是不是理解錯誤了,display是被glut呼叫 02/18 21:04
→ iamstudent:而不是被使用者直接呼叫,你怎麼會想要放參數在那邊? 02/18 21:05
→ iamstudent:難不成你想要呼叫那個display很多次來畫出一堆點? 02/18 21:05
→ iamstudent:glutDisplayFunc會記住你給他的func point 02/18 21:08
→ iamstudent:需要重畫畫面時,就照你寫的display執行工作 02/18 21:09
→ iamstudent:你可以準備一個global資料結構放置要畫出的點 02/18 21:11
→ iamstudent:然後display就只畫出資料內容 02/18 21:11
→ iamstudent:如果動態變化了資料,就下glutPostRedisplay重畫 02/18 21:12
→ iamstudent:display就會被glut再次呼叫,然後展現出更新後的畫面 02/18 21:13
→ Hack:感謝樓上前輩們的回覆~!! 03/02 15:51