Skip to content

Commit b714520

Browse files
committed
ready for release
1 parent 607f700 commit b714520

10 files changed

Lines changed: 42 additions & 1 deletion

File tree

libs/windows-x64/glew32.dll

472 KB
Binary file not shown.

libs/windows-x64/glfw3.dll

286 KB
Binary file not shown.
147 KB
Binary file not shown.

libs/windows-x64/libstdc++-6.dll

2.39 MB
Binary file not shown.
60 KB
Binary file not shown.

mode/CppMode.jar

25.9 KB
Binary file not shown.

src/Processing.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ void (*_wireCallbacksFn)() = nullptr;
148148
void (*_staticSketchSetup)() = nullptr; // set by static sketches for i3 redraw
149149

150150
static GLFWwindow* gWindow=nullptr;
151+
std::string g_sketchName = "Sketch";
152+
153+
// Read sketch name from environment (set by CppRunner at runtime)
154+
static struct _SketchNameInit {
155+
_SketchNameInit() {
156+
const char* env = std::getenv("PROCESSING_SKETCH_NAME");
157+
if (env && env[0]) g_sketchName = env;
158+
}
159+
} _sketchNameInit;
151160
static bool is3DMode=false;
152161
static int sphereRes=48;
153162
static int curveDetailVal=20;
@@ -2838,7 +2847,7 @@ void run(){
28382847
glfwWindowHint(GLFW_RESIZABLE,isResizable?GLFW_TRUE:GLFW_FALSE);
28392848
glfwWindowHint(GLFW_SAMPLES,4); // 4x MSAA for crisp P3D rendering; 2D noSmooth() disables at runtime
28402849
glfwWindowHint(GLFW_STENCIL_BITS,8); // needed for concave shape fill
2841-
gWindow=glfwCreateWindow(winWidth,winHeight,"processing-cpp",nullptr,nullptr);
2850+
gWindow=glfwCreateWindow(winWidth,winHeight,g_sketchName.c_str(),nullptr,nullptr);
28422851
if(!gWindow){
28432852
#ifdef _WIN32
28442853
MessageBoxA(NULL, "Window creation failed.\nCheck that your GPU supports OpenGL 2.0+", "processing-cpp Error", MB_OK|MB_ICONERROR);

src/Processing.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,3 +2348,5 @@ inline void link(const std::string& url) {
23482348
#endif
23492349
}
23502350
inline void link(const char* url){link(std::string(url));}
2351+
2352+
extern std::string g_sketchName;

src/main.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,40 @@
11
#include "Processing.h"
22
#include <string>
3+
#include <cstdlib>
34

5+
extern std::string g_sketchName;
6+
7+
#ifdef _WIN32
8+
#include <windows.h>
9+
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) {
10+
// Get sketch name from env var (set by launcher) or compile-time define
11+
const char* envName = std::getenv("PROCESSING_SKETCH_NAME");
12+
if (envName && envName[0]) {
13+
g_sketchName = envName;
14+
}
15+
#ifdef PROCESSING_SKETCH_NAME
16+
else {
17+
g_sketchName = PROCESSING_SKETCH_NAME;
18+
}
19+
#endif
20+
Processing::run();
21+
return 0;
22+
}
23+
#else
424
int main(int argc, char** argv) {
25+
const char* envName = std::getenv("PROCESSING_SKETCH_NAME");
26+
if (envName && envName[0]) {
27+
g_sketchName = envName;
28+
}
29+
#ifdef PROCESSING_SKETCH_NAME
30+
else {
31+
g_sketchName = PROCESSING_SKETCH_NAME;
32+
}
33+
#endif
534
for (int i = 1; i < argc; i++)
635
if (std::string(argv[i]) == "--debug")
736
Processing::enableDebugConsole();
837
Processing::run();
938
return 0;
1039
}
40+
#endif

tools/appimagetool-x86_64.AppImage

14.4 MB
Binary file not shown.

0 commit comments

Comments
 (0)