Commit Graph

996 Commits (37de36425770880032bd281efe069a1c0b8daea9)

Author SHA1 Message Date
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 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 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
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
Andrew Downing 023f404475 add LDFLAGS for FLTK to exposed/Makefile.am and src/Makefile.am 2015-02-25 22:47:35 -05:00
Andrew Downing ce77197dac display GraphicsEditControl in its own tooltip window avoiding the need to hack FLTKs internals 2015-02-25 12:43:01 -05:00
Andrew Downing 396b1c63a4 fix fltk code 2015-02-24 16:07:32 -05:00
Andrew Downing 1bfba0df5f fix fltk code 2015-02-24 15:54:27 -05:00
Marc Britten 0f334cc040 Added updated header information for surfaces 2015-02-08 10:43:19 -06:00
Petteri Aimonen 12a29ddce0 FLTK: Don't oops() when unknown mouse button is pressed.
For example forward/backward buttons are present on many mouses
but are not used by solvespace. This oops() caused solvespace to
crash whenever those buttons were (accidentally) pressed.
2014-12-29 22:33:19 +02:00
Petteri Aimonen 8996833989 Fix crash on Ubuntu when opening assembly files.
Ubuntu enables GCC's buffer overflow checks by default. In SAVEDptr
union, the path was declared as 'char', even though MAX_PATH memory
was actually allocated. The buffer overflow check mistakenly thought
that the buffer size was only 1 and aborted the program whenever it
tried to read a path from a file.
2014-12-29 22:16:21 +02:00
Jonathan Westhues e587d0ebee Fix GUI bugs in FLTK port, per Xavier Thomas's forum post:
"There was some small but annoying bugs with the FLTK port:
-cursor disappear sometimes
-not all the area of the windows (graphic and text windows) is accessible
by the mouse after a re-size
-input widget for editing constraints value are not correctly placed"
2014-05-11 15:43:03 -07:00
Ilya Novoselov f5297093c0 Fix automake "option 'subdir-objects' is disabled" warning 2014-04-10 23:05:17 +06:00
Ilya Novoselov 01213bcafb Rest of code assumes that allocated memory is filled with zeroes 2014-04-08 07:56:57 +06:00
Jonathan Westhues f4916f9ee4 Compare ((char *)p)[0] against '\0', not (char *)p.
Also make the library example compile again under MSVC, and make the
perl scripts to build the image tables work.
2013-12-08 00:32:50 -08:00
Daniel Richard G 1bc73c4a75 Renamed the RGB() macro to RGBi() to avoid collisions with Microsoft
Microsoft defines an RGB() macro that at one point was compatible with our
version (returning a packed integer containing 8-bit red, green and blue
channels), but is no longer, and the incompatibility led to an awkward
situation in w32main.cpp where we had to restore Microsoft's form of the
macro in order for the commctrl.h header to compile. By renaming the macro
to RGBi()---analogous to the RGBf() macro we already define---we avoid the
hassle entirely.
2013-12-02 04:27:34 -05:00
Daniel Richard G f9f321ca84 Warning fixes 2013-12-02 04:27:33 -05:00
Daniel Richard G fd9dc19a34 Added the exposed/ library and demo program to the Autotools build
The libslvs library and CDemo program can now be built by Autotools. A few
code changes were needed for this: C++ comments in C code had to be
converted, constraint.cpp required some massaging, and fltkutil.cpp needed
a stub for InitHeaps().
2013-12-02 04:27:33 -05:00
Daniel Richard G 6c68294249 Improved handling of generated files
Place a pre-built copy of generated source files in src/built/, so that
users building SolveSpace from Git without the tools or setup necessary to
generate these can still complete the process.

Makefile.msvc: Use slashes consistently, and added rules to copy files from
src/built/ if needed

configure.ac: Check for presence of src/built/ at configure time

src/Makefile.am: Handle the generated *.table.h files together with
icon*.h; updated the source-generation rules so that the files are created
in builddir, not srcdir; added rules to copy files from src/built/ if
needed
2013-11-20 01:25:48 -05:00
Daniel Richard G 174ed76ef9 Added libspnav configure option and support to the Autotools build system 2013-11-19 18:17:55 -05:00
Daniel Richard G bb3e5e9bb1 Minor follow-up changes
solvespace.h: Need to #define MAX_PATH on POSIX systems

resource.rc: icon.ico now lives in the same directory as this file
2013-11-19 18:17:55 -05:00
Daniel Richard G 0a24cf40f0 Moved most of the source into a src/ subdirectory
The SolveSpace top-level directory was getting a bit cluttered, so
following the example of numerous other free-software projects, we move the
main application source into a subdirectory and adjust the build systems
accordingly.

Also, got rid of the obj/ directory in favor of creating it on the fly in
Makefile.msvc.
2013-11-19 18:17:32 -05:00