openFrameworks icon indicating copy to clipboard operation
openFrameworks copied to clipboard

Cairo functions from ofGraphics separated in different files.

Open dimitre opened this issue 3 years ago • 7 comments

So in near future we can build OF without Cairo.a, optionally, as discussed here

  • https://github.com/openframeworks/openFrameworks/issues/6947

dimitre avatar May 18 '22 04:05 dimitre

The idea itself was upvoted in the thread by @roymacdonald and @danoli3 If anybody has the time to proofread this PR it would be great!

dimitre avatar May 21 '22 21:05 dimitre

@dimitre cool. Is it just that you moved the Cairo stuff from ofGraphics.* Into ofGraphicsCairo.* ? Why are you putting the include to ofGraphicsCairo.h in ofMain.h instead of ofGraphics.h? I think that that include should go in the place that the code was extracted so not to beeak the dependecies in projects. Say, someone has a project and they use #include "ofGraphics.h" to use some of the cairo related functions, with what you are proposing it will not compile and that would suck. Figuring out what was making it not to compile might take some time yet it wont harm if you put #include "ofGraphicsCairo.h" in ofGraphics.h

roymacdonald avatar May 21 '22 23:05 roymacdonald

Thanks @roymacdonald! it does make sense. For me it is the same, as it is or as you suggest. I'll make this change if others agree.

Personally I think it is a very remote possibility and I prefer this way because we can use preprocessor definitions to customize the OF to compile "Cairoless" soon.

I mean, most of the projects includes ofMain.h and lots of addons does the same. and for 0.12 we can break theoretically compatibility a little :)

dimitre avatar May 21 '22 23:05 dimitre

Any opinion on this one @openframeworks/core ?

dimitre avatar May 25 '22 12:05 dimitre

Hey @ofTheo, finally it is passing all tests and ready to review. Share your opinion on this

dimitre avatar Jun 27 '22 18:06 dimitre

Reason behind this change: Sometimes we want to compile faster, or build a smaller binary file, have less time spent validating in app store, so it makes sense to aim for a modular OF where we can left out some unused functionality. I love Cairo but I don't use it in 80% of my projects, so it is great to be able to left it out, as well as freeimage, fmod, etc.

Some related threads https://forum.openframeworks.cc/t/of-lite/5170 https://forum.openframeworks.cc/t/openframeworks-lite/37256 https://forum.openframeworks.cc/t/bundling-osx-app-without-glut-and-without-fmodex-nasty/23503/4

I think there was some similar ideas shared in Denver conference in 2019 as posted here too: https://github.com/openframeworks/openFrameworks/issues/6866#issuecomment-1053783484

dimitre avatar Jul 22 '22 04:07 dimitre

Definitely let’s add some macros to define stuff out where not needed, fmod, curl/ssl, Cairo. Will make future maintenance easier too

On Fri, 22 Jul 2022 at 2:18 pm, Dimitre @.***> wrote:

Reason behind this change: Sometimes we want to compile faster, or build a smaller binary file, have less time spent validating in app store, so it makes sense to aim for a modular OF where we can left out some unused functionality. I love Cairo but I don't use it in 80% of my projects, so it is great to be able to left it out, as well as freeimage, fmod, etc.

Some related threads https://forum.openframeworks.cc/t/of-lite/5170 https://forum.openframeworks.cc/t/openframeworks-lite/37256

https://forum.openframeworks.cc/t/bundling-osx-app-without-glut-and-without-fmodex-nasty/23503/4

I think there was some similar ideas shared in Denver conference in 2019 as posted here too: #6866 (comment) https://github.com/openframeworks/openFrameworks/issues/6866#issuecomment-1053783484

— Reply to this email directly, view it on GitHub https://github.com/openframeworks/openFrameworks/pull/6985#issuecomment-1192163943, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGK2HDAA3UCFEOCMX5JJFDVVIOJLANCNFSM5WHACNCA . You are receiving this because you were mentioned.Message ID: @.***>

danoli3 avatar Jul 22 '22 07:07 danoli3

Finally, good to go @ofTheo

dimitre avatar Oct 04 '22 23:10 dimitre

Hello @ofTheo I've updated this branch to work well with latest. I've tested with project generator and it seems good to go. Any observations or objections on this one?

dimitre avatar Oct 18 '22 18:10 dimitre

Thanks @dimitre - is the idea to do another PR later which will selectively include cairo based on MACRO / #defines? If that's the case it looks good to me.

ofTheo avatar Oct 18 '22 21:10 ofTheo

Yes, the idea is merge this one, and work on another which involves more decisions to uniformize defines. here is the complete proposal for this one https://github.com/openframeworks/openFrameworks/issues/6947

and here a proposition of changing the way ofConstants.h is organized which we can discuss soon https://github.com/openframeworks/openFrameworks/issues/6948

dimitre avatar Oct 19 '22 00:10 dimitre