quasar098 / midi-playground

square bounce
GNU General Public License v3.0
198 stars 56 forks source link

Update shaders to modern OpenGL API #118

Closed zetlen closed 2 months ago

zetlen commented 2 months ago

I'm on an M1 Mac and I noticed that the alternative shaders weren't working--they were throwing errors about unknown identifiers like gl_FragColor and texture2D. Looks like OpenGL 3.30 deprecated texture2D and the predefined gl_FragColor variable.

I replaced texture2D with texture, because the APIs appear drop-in compatible. As for gl_FragColor, it looks like most of these shaders were built with those new APIs in mind, because they had declared an out variable f_color. I just used that instead. All of the shaders work now, at least on the few machines I tested.

quasar098 commented 2 months ago

lgtm