Skip to content

Commit e29ef59

Browse files
committed
Windows cache: use GLEW 2.3.1 headers to match bundled DLL
1 parent 5e70a0a commit e29ef59

2 files changed

Lines changed: 26 additions & 6 deletions

File tree

.github/workflows/build-cache.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@ jobs:
2727
- name: Build cache
2828
run: |
2929
mkdir -p cache/linux-x64
30+
# Download GLEW 2.3.1 headers to match bundled DLL
31+
curl -L https://github.com/nigels-com/glew/releases/download/glew-2.3.1/glew-2.3.1.tgz -o glew.tgz
32+
tar xf glew.tgz
3033
CFLAGS="-std=c++2c -O2 -march=x86-64"
3134
LFLAGS="-static-libgcc -static-libstdc++"
3235
DEFS="-DPROCESSING_HAS_STB_IMAGE -DPROCESSING_HAS_STB_TRUETYPE"
33-
INC="-I src"
36+
INC="-I src -I glew-2.3.1/include"
3437
3538
echo "Building Processing.h.gch..."
3639
g++ $CFLAGS $DEFS $INC -x c++-header src/Processing.h -o cache/linux-x64/Processing.h.gch
@@ -64,10 +67,13 @@ jobs:
6467
shell: msys2 {0}
6568
run: |
6669
mkdir -p cache/windows-x64
70+
# Download GLEW 2.3.1 headers to match bundled DLL
71+
curl -L https://github.com/nigels-com/glew/releases/download/glew-2.3.1/glew-2.3.1.tgz -o glew.tgz
72+
tar xf glew.tgz
6773
CFLAGS="-std=c++2c -O2 -march=x86-64"
6874
LFLAGS="-static-libgcc -static-libstdc++"
6975
DEFS="-DPROCESSING_HAS_STB_IMAGE -DPROCESSING_HAS_STB_TRUETYPE"
70-
INC="-I src"
76+
INC="-I src -I glew-2.3.1/include"
7177
7278
echo "Building Processing.h.gch..."
7379
g++ $CFLAGS $DEFS $INC -x c++-header src/Processing.h -o cache/windows-x64/Processing.h.gch

src/Processing.cpp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ void PApplet::smooth(int level) {
684684
smoothLevel = level;
685685
#ifndef __EMSCRIPTEN__
686686
glEnable(GL_LINE_SMOOTH);glHint(GL_LINE_SMOOTH_HINT,GL_NICEST);
687-
glEnable(GL_POINT_SMOOTH);glHint(GL_POINT_SMOOTH_HINT,GL_NICEST);
687+
// GL_POINT_SMOOTH removed in OpenGL 3.2+ core -- skip to avoid crash
688688
glEnable(GL_MULTISAMPLE);
689689
#endif
690690
}
@@ -3436,21 +3436,35 @@ void PApplet::run(){
34363436
#ifdef _WIN32
34373437
MessageBoxA(NULL, "After GL enable calls", "Debug3", MB_OK);
34383438
#endif
3439-
smooth();
34403439
#ifdef _WIN32
3441-
MessageBoxA(NULL, "After smooth()", "Debug4", MB_OK);
3440+
MessageBoxA(NULL, "Before getFramebufferSize", "Debug4x", MB_OK);
34423441
#endif
34433442
// Don't call setProjection here -- let size() in this->setup() do it
34443443
// with the correct dimensions. Calling it now with winWidth=640,winHeight=480
34453444
// (defaults) would set the wrong ortho before this->setup() changes the size.
34463445
{int fw,fh;glfwGetFramebufferSize(gWindow,&fw,&fh);pixelWidth=fw;pixelHeight=fh;fbW=fw>0?fw:logicalW;fbH=fh>0?fh:logicalH;}
3446+
#ifdef _WIN32
3447+
MessageBoxA(NULL, "After getFramebufferSize", "Debug4y", MB_OK);
3448+
#endif
34473449

34483450
// Enable sticky keys/buttons: GLFW will keep state as PRESSED until polled,
34493451
// Clear both buffers once at startup so the sketch starts with
34503452
// a known clean state (no GPU garbage in either buffer).
3451-
glClearColor(0.8f,0.8f,0.8f,1); // Java Processing default grey
3453+
#ifdef _WIN32
3454+
MessageBoxA(NULL, "Before glClearColor", "Debug4a", MB_OK);
3455+
#endif
3456+
glClearColor(0.8f,0.8f,0.8f,1);
3457+
#ifdef _WIN32
3458+
MessageBoxA(NULL, "Before first glClear", "Debug4b", MB_OK);
3459+
#endif
34523460
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
3461+
#ifdef _WIN32
3462+
MessageBoxA(NULL, "Before glfwSwapBuffers", "Debug4c", MB_OK);
3463+
#endif
34533464
glfwSwapBuffers(gWindow);
3465+
#ifdef _WIN32
3466+
MessageBoxA(NULL, "Before second glClear", "Debug4d", MB_OK);
3467+
#endif
34543468
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
34553469

34563470
// preventing missed inputs on Windows where events can arrive between polls.

0 commit comments

Comments
 (0)