GritsObject

GritsObject — Base class for drawing operations

Synopsis

struct              GritsObject;
struct              GritsObjectClass;
void                grits_object_draw                   (GritsObject *object,
                                                         GritsOpenGL *opengl);
#define             grits_object_center                 (object)

Object Hierarchy

  GObject
   +----GritsObject
         +----GritsCallback
         +----GritsMarker
         +----GritsTile
         +----GritsVolume

Description

Objects in grits are things which can be added to the viewer and will be displayed to the user. Each object has information such as it's location and level of detail which are used by the viewer to determine which objects should be drawn.

Each GritsObject is also a GObject, but not every GObject in grits is a GritsObject. The "Object" part of the name is just coincidence.

Details

struct GritsObject

struct GritsObject;


struct GritsObjectClass

struct GritsObjectClass {
	GObjectClass parent_class;

	/* Move some of these to GObject? */
	void (*draw) (GritsObject *object, GritsOpenGL *opengl);
	void (*hide) (GritsObject *object, gboolean hidden);
};


grits_object_draw ()

void                grits_object_draw                   (GritsObject *object,
                                                         GritsOpenGL *opengl);

Perform any OpenGL commands necessasairy to draw the object.

The GL_PROJECTION and GL_MODELVIEW matricies and GL_ALL_ATTRIB_BITS will be restored to the default state after the call to draw.

object :

the object

opengl :

the viewer the object is being displayed in

grits_object_center()

#define             grits_object_center(object)

Get the GritsPoint representing the center of an object

object :

The GritsObject to get the center of

Returns :

the center point