Alessandro De Laurenzis. That pull request cleaned up the vast
majority of compiler warnings. However, that cleanup exposed a
few additional warnings pointing to errors in the code that needed
fixing. The code now compiles cleanly except for one warning
about redefined CAD_DIR that I have not looked into.
This commit makes the code (mostly) C99-compatible, enabling to compile
it without the -Wno-error=implicit-function-declaration flag. This
way, Magic becomes usable on arm64 architectures, specifically on Apple
computers with M1/M2 SoC.
frame buffers and render buffers, and use fast frame buffer bit
block transfers to do copies to and from backing store. Also found
a long-standing problem where multiple windows fail to refresh
properly in OpenGL and Cairo interfaces due to a lack of calling
GrLock() and GrUnlock() around the call to fetch backing store
after an expose event. The use of the general purpose frame
buffer allows magic to avoid calling any indirect rendering methods
and should now (finally) allow magic to run in OpenGL mode over a
VNC. Use of direct rendering methods only also means that magic
does not need to be compiled with the ad hoc switch to have Cairo
handle drawing into pixmaps for the icons (this remains to be
tested).
Cairo works perfectly for the off-screen rendering and that OpenGL
works perfectly for the on-screen rendering, make a compile-time
option to use both in their respective areas of perfection.
by using a Pbuffer instead of a GLXPixmap, which is too often not
supported for direct rendering. The only way I found to make this
work was to do a (very) slow pixel-by-pixel copy from the Pbuffer
into the pixmap. However, this only needs to be done once for each
toolbar icon, and the icons are small, so it is not really a problem.