Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/Processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3628,9 +3628,16 @@ void PApplet::run(){
});
glfwMakeContextCurrent(gWindow);
glewExperimental = GL_TRUE;
glewExperimental = GL_TRUE;
GLenum glewErr = glewInit();
if(glewErr != GLEW_OK){
bool glewOk = (glewErr == GLEW_OK);
#if defined(__linux__) && defined(GLEW_ERROR_NO_GLX_DISPLAY)
// A GLX-built GLEW reports NO_GLX_DISPLAY under native Wayland (GLFW uses EGL there),
// but the core GL functions are already loaded by then, so it's safe to carry on.
if (!glewOk && glewErr == GLEW_ERROR_NO_GLX_DISPLAY && getenv("WAYLAND_DISPLAY") != nullptr)
glewOk = true;
#endif
if(!glewOk){

#ifdef _WIN32
char msg[256]; snprintf(msg,sizeof(msg),"glewInit() failed: %s", glewGetErrorString(glewErr));
MessageBoxA(NULL, msg, "processing-cpp Error", MB_OK|MB_ICONERROR);
Expand Down