Repository navigation
C++ Mode v0.6.0
What's new in 0.6.0
This is a big one. Lots of API gaps filled in, several platform bugs fixed, and a bunch of internal cleanup.
Bug fixes
- macOS:
ld: library 'glfw' not foundis fixed. The bundled dylibs now includelibglfw.dylibalongsidelibglfw.3.dylibso the linker can find it. If you were getting this error, delete your CppMode folder and reinstall fresh. - macOS: bundled dylibs are now copied next to the sketch binary so they're found at runtime without needing Homebrew on PATH.
- Fixed ambiguous
width/height/keyerrors when a sketch class explicitly inheritsPAppletdirectly (e.g. in a multi-class sketch). The transpiler now skips injecting_PSketchproxies into classes that already inheritPApplet. deltaTimenow works in all contexts, including hoisted classes and multi-class sketches.- Fixed
Processing_api.hcorruption that causedexpected unqualified-id before '/' tokenerrors. - Fixed
random()clashing with the C stdlibrandom(). - Fixed
filter()withPOSTERIZEbeing unreachable. - Fixed
strokeCap/strokeJoin—ROUNDnow enablesGL_LINE_SMOOTH. - Fixed several constants that didn't match Processing Java's values (
ROUND,POINTS,LINES,TRIANGLES, etc.).
New free functions
These now work anywhere in your sketch, including in helper classes:
- Math:
sq,mag,abs,floor,ceil,round,sqrt,pow,exp,log,norm,min/max(2 and 3 argument versions) - Trig:
sin,cos,tan,asin,acos,atan,atan2,degrees,radians - Color:
red,green,blue,alpha,hue,saturation,brightness,lerpColor,blendColor - String:
toUpperCase,toLowerCase,parseInt,parseFloat,parseBoolean - Array:
append,expand,shorten,subset,concat,reverse,sort,arrayCopy - Other:
randomGaussian,sketchPath,dataPath,sketchFile,dataFile,deltaTime
New geometry
rect(x, y, w, h, tl, tr, br, bl)— four independent corner radiibezierVertex(x2, y2, z2, x3, y3, z3, x4, y4, z4)— 3D versioncurveVertex(x, y, z)— 3D versionquadraticVertex(cx, cy, cz, x, y, z)— 3D version
Java API additions
StringBuilder,Random,HashSet,LinkedList,TreeMap,TreeSet- Exception classes:
RuntimeException,IllegalArgumentException, and the rest of the standard hierarchy HashMap:getOrDefault,putAll,putIfAbsent,entrySetArrayList:toArray()PShape:beginShape/endShape,createShape(kind, x, y, w, h),paramsfieldJSONValueandXML: additional Processing Java interface methodsPFont:getSize(),getName(),isSmooth(),getWidth()PImage:isLoaded(),getWidth(),getHeight(),formatfieldcreateImagenow sets theformatfield correctly
Other
deltaTimefield — seconds since last frame, updated every frame (like p5.js)image(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2)— nine-argument form for sprite sheet croppingloadPixels()was declared but never implemented — fixed- Added
OPEN/CHORD/PIEarc mode constants - Added
splitTokens(s)with no delimiter argument, defaulting to whitespace