Adam Boggs [Tue, 7 Feb 2012 05:13:02 +0000 (22:13 -0700)]
Incorporated code review feedback and some fixes.
Fixed indentation to tabs, use g_assert and guint/gchar/etc. Pass the
display_mask in on the icon command line so user can control what gets
displayed. Fixed a colorspace bug when using ARGB surfaces mapped to
RGBA gl textures. Store label offset in marker structure so we can
change it based on icon size or a cairo-drawn object such as the point.
Andy Spencer [Sun, 8 Jan 2012 23:06:16 +0000 (23:06 +0000)]
Fix clipping plane issues
The clipping plane is flat, so the distance between the camera and the
clipping plane varies based on where screen location. I.e. it is closest
in the center and farther at the corners. Add a offset to elev to
account of this. It would be better to use a sin or to calculate
distances directly, but this is easy and appears to work.
Andy Spencer [Tue, 3 Jan 2012 07:32:34 +0000 (07:32 +0000)]
Add GritsLine
GritsLine is similar to GritsPoly, but does not draw a filled polygon.
As such it does not need to do any tessellation.
Currently it draws the points directly instead of using a display list.
This should make it easier to updated the line at runtime without
needing to create a new object.
Andy Spencer [Mon, 12 Dec 2011 05:37:20 +0000 (05:37 +0000)]
Move OpenGL includes to a common place
Apple seems to think the should put GL.h in OpenGL instead of GL..
putting it all gtkgl.h makes it a little easier, but requires gtkgl.h to
be included in the install and by grits.h.
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.