Andy Spencer [Sat, 15 Oct 2011 06:20:43 +0000 (06:20 +0000)]
Add mouse, keyboard, and motion events to GritsObject
These work by chaining the event from GritsOpenGL up to each individual
object, which then emits the callback if it is currently selected
(moused over).
Andy Spencer [Sat, 15 Oct 2011 06:13:39 +0000 (06:13 +0000)]
Add mouse enter/leave signals to objects
This uses the OpenGL Selection render mode to determine which objects
the mouse is over. It requires fairly tight integration between
GritsOpenGL and GritsObject.
The signal code is handled internally by GritsObject. However, most of
the actual selection matching work is done by GritsOpenGL.
Object types that wish to improve performance can implement the pick()
function in addition to the draw() function. The pick function is used
when performing selection matching. It works similar to draw, but does
not need to do textures/lighting/opacity/etc.
Andy Spencer [Sat, 18 Jun 2011 22:10:17 +0000 (22:10 +0000)]
Change binaries to shared objects
There's a double load of the GObjects when using static libraries with
plugins. Shared libraries avoid this, I think there are other work
arounds that let static binaries work too, but this should be fine for
now.
Andy Spencer [Tue, 7 Jun 2011 08:43:32 +0000 (08:43 +0000)]
Switch from GtkGLExt to internal OpenGL handling
GtkGLExt has many problems:
- It's code is bloated and convoluted
- It doesn't work on Win32
- It doesn't work with gtk+-3.0
- The last release was in early 2006
Using our own lets us fix these issues and should be easier to maintain
than trying to figure out the GtkGLExt mess, or waiting for someone else
to fix it.
Andy Spencer [Mon, 24 Jan 2011 03:33:30 +0000 (03:33 +0000)]
Add GritsTester for debugging GritsObjects
The "tester" object is similar to a stripped down version of
GisOpenGL/GisViewer. It is intended for debugging GisObjects during
development. It displays one or more objects centered in the view and
and supports panning/moving around to inspect various parts of the
object.
Andy Spencer [Sat, 22 Jan 2011 20:13:05 +0000 (20:13 +0000)]
Allow disabling operations in grits_object_draw
Objects now include a GRITS_SKIP_* bitmask used for disabling various
operations in grits_object_draw. The default is to perform all tests and
operations, however some of these are expensive. Objects which do not
need some operations or take care of it themselves can disable the tests
in grits_object_draw to save processing time.
For instance, saving the OpenGL state can be quite costly for simple
objects.
Andy Spencer [Thu, 18 Nov 2010 06:35:21 +0000 (06:35 +0000)]
Move g_signal_connects to realize callback
Under Mesa the "configure" callback is is triggered before the "realize"
callback. This causes a crash because some OpenGL initialization must be
performed after the widget is realized.
Moving the callback connects forces proper ordering.
Andy Spencer [Mon, 1 Nov 2010 03:37:53 +0000 (03:37 +0000)]
Give extra weight to "edge" triangles when splitting
"Edge" triangles are triangles where one of the edges of the triangle
makes up an edge off the mesh. For example, the triangle E below is an
edge triangle due to the top edge.
This helps prevent jagged "edges" on the tops of mountains, etc. It also
helps round out the edges of the globe when viewed from far away.
Andy Spencer [Sun, 24 Oct 2010 11:57:09 +0000 (11:57 +0000)]
Move OpenGL code from GisOpenGL to objects
Add draw functions to GisObjectClass which should be set by subclasses.
This allows outside object types to be written in the normal way
(instead of always using GisCallback).
This also moves a lot of drawing code out of GisOpenGL which should
prevent it from becoming too big.
Unfortunately, there are some pesky dependency problems between
GisObject/GisViewer/GisOpenGL/GTK now. For example, Wms pulls in
GisTile, which pulls in GisViewer/GisViewer, which pulls in all of GTK.