Commit Graph

766 Commits (52af72560616b754564ebf3ba8a85ab5849a982d)

Author SHA1 Message Date
whitequark d76d59ea64 Build Mac OS X dmg installation image. 2015-07-10 15:59:12 +03:00
whitequark 95ab80d0ee Implement OS X port. 2015-07-10 15:59:12 +03:00
whitequark 5d7a5bf3a7 Pack everything into `namespace SolveSpace`.
This is required to avoid name conflicts with the Cocoa libraries
on OS X.

I renamed the `class SolveSpace` to `class SolveSpaceUI`, because
that's what it does, and because otherwise the namespace would
have to be called something else than `namespace SolveSpace`.
2015-07-10 15:59:12 +03:00
whitequark 0807c2fdfe Add a native Debian package. 2015-07-10 15:59:12 +03:00
whitequark d3dbf23725 Add a desktop file in the format understandable by Ubuntu. 2015-07-10 15:59:12 +03:00
whitequark 2ce12155bf Add bug compatibility with Chromium GL (VirtualBox).
I question the life choices that led me here.
2015-07-10 15:59:12 +03:00
whitequark 88e4163970 Use the extension version of FBO extension instead of core.
This will allow solvespace to run on pre-OpenGL 3.0 implementations,
such as VirtualBox (and possibly others).

However, VirtualBox's handling of framebuffer objects is buggy;
it tries to draw over our X window and fails to do either.

I hate OpenGL.
2015-07-10 15:59:12 +03:00
whitequark e27c6b56c3 Implement offscreen rendering using GL framebuffer objects.
Apparently pbuffers are also a deprecated and unportable
way of offscreen rendering. They're not supported by
Chromium OpenGL implementation, which is what 3D-accelerated
VirtualBox uses.

This would also help a future OS X port.
2015-07-10 15:59:12 +03:00
whitequark 622c9efadb Use GL pbuffers instead of GLX pixmaps.
Apparently GLX pixmaps are an antiquated and unsupported method
for offscreen rendering in OpenGL. Specifically this broke
software and VirtualBox accelerated rendering in Ubuntu trusty
and who knows which other systems.

This commit switches the rendering to use pbuffers instead,
while retaining all other logic. The pbuffers are fixed-size,
because reallocating pbuffers during a resize sometimes results
in segfaults in glXMakeCurrent despite apparently correct
API usage.
2015-07-10 15:59:12 +03:00
whitequark 2c39f259db Add a GTK2/3 port.
In principle, GTK3 is the way forward, and GTK2 is officially
deprecated, though still maintained. In practice however, GTK3
is often unbearably buggy; e.g. on my system, combo boxes
don't ever roll up in GTK3 windows. So I have added support
for both.

This required a few minor changes to the core, namely:
  * GTK wants to know beforehand whether a menu item is a check
    menu item or a regular one.
  * GTK doesn't give us an easy way to execute something after
    any event is processed, so an explicit idle timer is added.
    This is a no-op on Win32.
  * A few function signatures were const'ed, since GTK expects
    immutable strings when converting to Glib::ustring.
2015-07-10 15:59:12 +03:00
whitequark b68631ee56 Make fltkutil.cpp independent of FLTK and rename it to unixutil.cpp.
fltkutil.cpp should be independent of FLTK so that it can be linked
into libslvs while neither requiring every user of the library to
reimplement these support routines nor requiring linking in FLTK.
2015-07-10 15:59:11 +03:00
whitequark 5db5f1e152 Add a CMake buildsystem.
Additionally, update build tools so that no stdio redirection
is necessary.
2015-07-10 15:59:11 +03:00
whitequark c5364fe7a8 Trim trailing whitespace. 2015-07-10 15:59:11 +03:00
whitequark 7c7ac17e4b Remove all legacy buildsystems. 2015-07-10 15:59:11 +03:00
whitequark 3a42a8d8cb catc 2015-07-10 15:59:11 +03:00
whitequark 62af550c0b Fix try..catch clauses dealing with C strings.
On *nix, a thrown string literal cannot be caught using
catch(char*), resulting in crashes.
2015-07-10 15:58:56 +03:00
whitequark 024a26bf57 Explicitly request a 24-bit depth buffer in FLTK port.
See http://solvespace.com/forum.pl?action=viewthread&parent=417.
2015-07-05 06:20:25 +03:00
whitequark 14690e6e42 Work around poor line rendering with Intel Mesa-based drivers.
However, don't use ssglLineWidth for UI drawing operations.
These only draw horizontal or vertical lines that don't need to
be antialiased, and thus don't require the workaround. In fact
the workaround would make them thicker than needed.
2015-07-05 06:20:25 +03:00
whitequark 13afcb310e Fix fontconfig detection code in FLTK.
Either clang is stricter than the compiler the authors of that
code used, or fontconfig detection never worked.
2015-07-05 06:20:25 +03:00
whitequark 80046672ef Use Command instead of Control key for shortcuts on OS X.
It is the OS X convention.
2015-07-05 06:20:25 +03:00
whitequark 84f2a59993 Use the degree symbol on non-Windows.
The Windows code uses a degree symbol in Latin-1, which
crashes FLTK on OS X.
2015-07-05 06:20:25 +03:00
whitequark ffd2df9494 Fix dbg() not writing a newline.
puts() appends a newline, but fputs() does not.
Who needs consistency when you have undefined behavior? Oh, wait.
2015-07-05 06:20:25 +03:00
whitequark 1bbf61b8a2 Fix accidental glibc dependency.
fltkmain accidentally used optind instead of optndx. optind is
defined as an extern int in glibc but not on BSD systems.
This also broke passing a filename on command line.
2015-07-05 06:20:25 +03:00
whitequark 604c4bbea3 Fix oops() to not have UB.
Writing to NULL is undefined behavior and it is legal for the
compiler to simply remove it; clang will do so. abort()
or __builtin_trap() would produce the desirable result.
abort() is used as it is more portable.
2015-07-05 06:20:25 +03:00
whitequark 1cd2e2be2f Add Apple-specific OpenGL include statements. 2015-07-05 06:20:25 +03:00
whitequark 55e2d6b06d Fix stdint.h dependency in slvs.h.
Since SolveSpace's config.h is not exported, we cannot depend
on HAVE_C99_INTEGER_TYPES or similar variables. It's simplest
to just define it from scratch in the same way as MSVC does.
2015-07-05 06:20:25 +03:00
whitequark 5894efcfe5 Fix unresolved symbols in src/constraint.cpp when building libslvs. 2015-07-05 06:20:25 +03:00
Jonathan Westhues ba8202d54a Don't falsely detect inconsistent systems with small angle constraints. 2015-06-08 11:19:29 -07:00
Jonathan Westhues 403d3c04d2 Improve relative paths for file import.
Don't break on case-sensitive filesystems, and don't require an explicit
regen after initial save of the assembly.
2015-05-21 05:26:29 -07:00
Jonathan Westhues 044a4ea8fc Don't offset SVG width and height by one. 2015-04-12 14:24:55 -07:00
Jonathan Westhues 9c9a0d8c28 Merge commit 'refs/merge-requests/16' of https://gitorious.org/solvespace/solvespace 2015-03-10 22:50:31 -07:00
Marc Britten 3b587d022a Updated Freeze to be multi monitor friendly 2015-03-10 22:05:29 -05:00
Roland Lutz 48880f6fe9 Apply automake option `subdir-objects' globally 2015-03-02 21:46:11 +01:00
Roland Lutz 6c4eacf237 Add files generated by autotools to `.gitignore' 2015-03-02 21:46:11 +01:00
Roland Lutz 8401dbd84a Use separate directories for macros and auxiliary build tools 2015-03-02 21:46:11 +01:00
Roland Lutz f2cbdd36a9 Don't remove autoconf cache/backup files automatically 2015-03-02 21:46:11 +01:00
Roland Lutz a9590dc271 Treat automake warnings as errors 2015-03-02 21:46:11 +01:00
Roland Lutz 790b241f56 Fix automake warning about missing `AM_PROG_AR' 2015-03-02 21:46:11 +01:00
Roland Lutz 40552a0066 Always enable warnings, even when not using `autogen.sh' 2015-03-02 21:46:11 +01:00
Roland Lutz 8d0c2f77ec Don't try to distribute files that don't exist 2015-03-02 21:46:11 +01:00
Roland Lutz f5e4e02bac Remove duplicate entries from list of distributed files 2015-03-02 21:46:11 +01:00
Roland Lutz f5de3faedb Remove missing script from list of distributed files 2015-03-02 21:46:11 +01:00
Roland Lutz 9b68bf8f7b Move library source to src/ directory 2015-03-02 21:46:11 +01:00
Roland Lutz ae37fb783e Control libslvs compilation from src/Makefile.am 2015-03-02 21:46:11 +01:00
Roland Lutz 413ab5f578 Move library header to include/ directory 2015-03-02 21:46:11 +01:00
Roland Lutz 2622684ed5 Force object renaming to avoid constraint.o being overwritten
The GUI application and library share some object files but don't
enable object renaming resulting in the second compilation overwriting
the results of the first compilation.  This can be fixed by setting
explicit preprocessor flags for one compilation.  The actual problem,
however, is that recursive make is used in an inappropriate way; two
Makefiles shouldn't refer to the same source files.  In this case,
libslvs should be under src/ and handled by the same Makefile, in
which case the issue would have been obvious when the Makefile was
written in the first place.
2015-03-02 21:46:11 +01:00
Roland Lutz 3b4897c833 Add check for GL/GLU library
Requested by yugami:
> might I suggest explicitly including libGL as well as libpng.
> One of the previous builders errors needed that explicitly added in
2015-03-02 21:46:11 +01:00
Roland Lutz afdf3145b2 Add missing check for PNG library
As Peter Stuge pointed out, it works anyway if fltk is built with png
support because solvespace uses the flags returned by fltk-config.
If fltk was built with png support enabled, these include -lpng.
2015-03-02 21:46:11 +01:00
Andrew Downing 6cfa884406 fix GraphicsEditControlWindow placement, and fix error due to cmath being included instead of math.h 2015-02-26 12:22:42 -05:00
Andrew Downing 252f4128b7 add includes to dsc.h to fix errors in it's own context (not real errors since dsc.h isnt compiled by itself, just screws up the code model in QtCreator without them) 2015-02-26 09:19:15 -05:00