-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ofScopedMatrix #7946
ofScopedMatrix #7946
Conversation
this pretty cool! This is fine from my perspective to merge. |
@ofTheo FYI single @2bbb whoa you went all-in! my proposal here was with ~10 lines of code simplify visually the weight of PushMatrix/PopMatrix (and not, for instance nt attempting to "refine" the push/pop behaviour as discussed here #1493). your ofxScope is a whole other level! one question: for the lambda version, I am simply calling the std::function with the captured reference to the object — I take for granted that with optimisations the overhead all but disappears, but do you have considerations on that effect? |
@artificiel |
Yes my intent is about safety and making it impossible to get lost between braces. However if we're not sure the lambda has no overhead i prefer removing the option -- in any case I personally got very happy with the scoped anon objects (and it's a pattern getting more frequent). The lambda syntax is a bit clunky (above I wrote "for the hardcore" haha), is not an established pattern in OF, and not such a great gain for end users. Maybe keep the lambda for specific advanced cases where it's required and not a form of sugar. |
@artificiel |
OK based on the discussion above the lambda-versions are removed, and some docs are added |
…leedingmacOS * commit '7f37e70f65e9e022ba8868fb555570ce2c78a6ba': (37 commits) Allows Retina hi res enabled via App or Project.xcconfig (openframeworks#7971) actions changes (openframeworks#7968) Changing exr to hdr files for compatability with windows (openframeworks#7964) ofMesh - newfaces push_back to insert a list (openframeworks#7772) restore default-copy-constructibility of ofEvent (openframeworks#7969) [actions] ccache update (openframeworks#7967) Core small changes (openframeworks#7952) config.emscripten.default.mk for Emscripten >= 3.1.52 (openframeworks#7909) Fix edge case in findDelimiter (openframeworks#7911) oscpack / udpSocket: invert the "break_" semaphore (openframeworks#7963) ofxOscMessage: extra implicit adds [fixes something noted through openframeworks#7938 debugging] (openframeworks#7953) #changelog #ofxOsc ofThreadChannel::clear() to clear the channel (openframeworks#7921) #changelog #threadChannel OfxOscReceiver: from detach() to join() (openframeworks#7949) Update ofMathConstants.h (openframeworks#7958) [actions] update ubuntu 24.04 (openframeworks#7955) ofScopedMatrix (openframeworks#7946) [actions] - testing one action with multiple jobs for tests (openframeworks#7860) adding of.entitlements and vscode files to gitignore (openframeworks#7031) Make - use relative paths (openframeworks#7519) FPS timing with chrono (openframeworks#7867) ... # Conflicts: # libs/openFrameworks/sound/ofAVEngineSoundPlayer.mm
makes use of the lifetime of an object to frame push and pop matrix and style.
OLD-SCHOOL FLAT
ARTISANAL BRACING — TRYING TO UNDERSTAND WHAT’S GOING ON
INTRODUCING SCOPED MATRIX BRACING-AWARE OBJECT
FOR THE HARDCORE: LAMBDA IN ANONYMOUS OBJECT ENFORCES STRUCTUREA TYPICAL CASE