Postrediori / OceanSimulation

Ocean Simulation Based on a Model By Keith Lantz (https://www.keithlantz.net/)
MIT License
23 stars 3 forks source link

Support for OSX #1

Closed cpwfx closed 6 years ago

cpwfx commented 6 years ago

I was just checking Nick Lantz's work and bumped in to you version. Nice one! Running and compiling on OSX will try to load the vertex_src_1_30, fragment_src_1_30 shaders by default and fails since the created OpenGL context is 2.1. With GLFW+Glad it seems to be easier to choose context on OSX, however not sure if GLFW is ported as widely as FreeGlut, so probably no Mobile Intel 965 support there 😄

Freetype.cpp:182

#ifdef __APPLE__
    vertex_src = vertex_src_1_10;
    fragment_src = fragment_src_1_10;
#else
    if (GLEW_VERSION_3_0) {
        vertex_src = vertex_src_1_30;
        fragment_src = fragment_src_1_30;
    } else {
        vertex_src = vertex_src_1_10;
        fragment_src = fragment_src_1_10;
    }
#endif
Postrediori commented 6 years ago

Hi! Thank you for your feedback! From the description it looks like GLEW isn't very great at detecting supported OpenGL versions. I've uploaded the fix that just uses brute force to select the supported version of shaders. Moving to GLFW+glad is something to be done since the performance is also smoother with Mesa3D drivers;)

Postrediori commented 6 years ago

The fix for OSX is now in the master branch;-)

Postrediori commented 6 years ago

Added OSX workaround in #2

cpwfx commented 6 years ago

Thank you on behalf of all us OSXians!

Postrediori commented 6 years ago

Created issue for new libraries #3