Classes |
struct | anim_channel_state_t |
| An object can have many animations going at once. More...
|
class | MaxAnimations |
class | AnimationState |
| Simple class of fixed size to maintain per-object animation state. More...
|
class | Viewer |
struct | camera_t |
| camera_t : basic physical properties of a camera More...
|
struct | fps_t |
| fps_t : handy object for frames-per-second calculations More...
|
class | State |
struct | fcolor_t |
| base floating point color object More...
|
class | Host |
| If a client wants to use this library's glut helper entry point, it needs to supply an object that supports this interface. More...
|
class | Task |
| Create one of these (you'll have to inherit) if you have openGL work you need to submit to requestTask(). More...
|
class | Material |
| A Material is anything that needs to be set up prior to drawing, and possibly requiring some cleanup afterwards. More...
|
class | MaterialContext |
| helper class: put one of these on the stack, and it will make sure that prepare() and cleanup() are called. More...
|
struct | render_context_t |
| rendering context More...
|
struct | poly_request_t |
| stores information necessary to render a polygon later More...
|
class | RenderQueue |
| queue of requests More...
|
class | Renderable |
| rendering interface -- anything that wants to draw has to implement this interface! More...
|
class | DisplayLine |
| represents a single (small) status line to overlay in the demo More...
|
class | DemoHost |
| You'll need to provide a class that inherits from DemoHost. More...
|
class | FontEffect |
| general base class for font effect objects. More...
|
struct | font_rect_t |
| font sizing information More...
|
class | Font |
| a basic font class. More...
|
class | FontManager |
| the font manager More...
|
struct | material_t |
| material (used for rendering polygons) More...
|
class | MaterialRegistry |
| Clients of the parsing APIs must implement this interface themselves. More...
|
struct | polygon_t |
| polygon object. More...
|
class | model_t |
| model object. More...
|
struct | lod_entry_t |
| level-of-detail entry. contains a model and distance information More...
|
struct | lod_model_t |
| level-of-detail model. Contains multiple level-of-detail entries (models) More...
|
class | Framebuffer |
| provides a framebuffer of fixed size for offscreen rendering. More...
|
class | FramebufferContext |
| simple helper class--put this on the stack and it will automatically call Framebuffer::setupForRendering() and Framebuffer::endRendering() for you. More...
|
struct | sphere_init_t |
| data needed for cool spheres More...
|
Typedefs |
typedef stack_array
< anim_channel_state_t,
MaxAnimations > | animation_list_t |
typedef threadsafe_map
< pthread_t, smart_ptr
< task_record_t > > | task_map_t |
typedef std::vector< smart_ptr
< DisplayLine > > | vec_display_lines_t |
typedef rect2d_t< int > | pixel_rect_t |
| standard 2D pixel rect
|
|
|
typedef rect2d_t< int > | recti_t |
Functions |
void | processTasks (void) |
static void | onExit (void) |
static void | onDisplay (void) |
static void | onIdle (void) |
static void | onMouseButton (int button, int state, int x, int y) |
static void | onMouseMove (int x, int y) |
static void | onKeyboard (byte_t key, int x, int y) |
static void | onSpecialKeys (int key, int x, int y) |
static void | onReshape (int w, int h) |
void | start (int argc,const char *argv[],int width,int height,const char *title,const char *gameModeString,smart_ptr< Host > &host) |
| clients can call this to get common glut setup
|
void | requestTask (Task *task) |
| Here a thread can request that a task be handled by the open GL thread.
|
void | drawRectLines (const rect3d_t &r,const glut_color_t &c) throw () |
| draw the outline of a 3D rectangle
|
void | getModelViewMatrix (matrix4_t &T) throw () |
| get a 4x4 matrix from the given OpenGL matrix
|
static GLint | getGlutInternalFormat (const media::image_t &image) |
static GLint | getGlutFormatFromColorFormat (const media::image_t &image) |
static int | createOpenGLTexture (const media::image_t &image) |
void | startDemo (int argc,const char *argv[],const char *title,DemoHost *host) |
| use this method to kick off a quick demo (provide an instance of your own host, inherited from glut::DemoHost ).
|
smart_ptr< FontEffect > | getCharacterAdvanceEffect (smart_ptr< Font > &font,const char *lines,int millisecondsPerCharacter,const glut_color_t &color) |
| this font effect will write out lines of text one character at a time.
|
void | breakLongString (const char *text,Font *font,int maxPixelWidth,std::string &output) |
| given a long sequence of words in a given font, this routine returns the same words, only with line breaks inserted so that a single line is never longer than the specified width.
|
smart_ptr< Font > | getDefaultFont (void) |
| retrieve the default font (throws if there isn't one)
|
bool | scaleFontToPixelHeight (Font *font,const char *textToScale,int desiredPixelHeight) |
| scale the given font to the specified height in pixels.
|
void | parseColor (std::istream &stream, img_color_t &color) |
void | parseMaterial (std::istream &stream, const char *parentDir, material_t &material) |
void | parsePolygon (MaterialRegistry *mreg, std::istream &stream, polygon_t &polygon) |
void | parseModel (MaterialRegistry *mreg, std::istream &stream, model_t &model) |
void | parseLodEntry (MaterialRegistry *mreg, std::istream &stream, lod_entry_t &entry) |
void | parseLodModel (MaterialRegistry *mreg, std::istream &stream, lod_model_t &lod_model) |
smart_ptr< MaterialRegistry > | getSimpleRegistry (const char *materialDir) |
| get a simple implementation of a material registry.
|
smart_ptr< Renderable > | loadModel (const char *filename, MaterialRegistry *reg) |
| load a model from a Wavepacket Glut Model file (.wgm extension, normally)
|
void | writeModelToStream (std::ostream &stream, const model_t &model) |
| assumes you have already written the key name, this will write the opening and closing brackets
|
static void | renderColorPolygon (const polygon_t &p) throw () |
static void | queuePolygon (const point3d_t *vertex_array, const polygon_t &p, poly_request_t &pr) throw () |
static void | renderTexturePolygon (const point3d_t *vertex_array, const polygon_t &p) throw () |
static void | getDictionaryFromNextLine (std::istream &stream, const char *debug_info, dictionary_t &d) |
static byte_t | getOptionalByte (const dictionary_t &d, const char *key) |
static void | writePoint3dToStream (std::ostream &stream, const point3d_t &p) |
static void | setUpImage (int width, int height, media::image_t &img) |
static void | setSegment (const point3d_t &p0, const point3d_t &p1, const matrix4_t &T, int genTextureId, int outTextureId, Framebuffer *framebuffer, float size, const glut::render_context_t &rc, poly_request_t *pr) |
static int | compareSegments (const void *p1, const void *p2) throw () |
smart_ptr< Renderable > | createCoolSphere (const sphere_init_t &si) |
| create a really cool-looking sphere. Yeah.
|
static float | randomX (float x) |
static void | jitter (point3d_t &p, float dx) throw () |
static void | drawLightningRing (float radius, const point3d_t &axis, float phi, const glut_color_t &color) throw () |
smart_ptr< Renderable > | createSkybox (smart_ptr< Renderable > &box) |
| treat the given model as a skybox
|
smart_ptr< Renderable > | createTerrain (hfield::Heightfield *hfield) |
| create a renderable heightfield model
|
smart_ptr< Renderable > | createXformModel (const matrix4_t &xform,smart_ptr< Renderable > &model) |
| Given a 4x4 transform and a base model, returns a wrapper model that applies the given transformation to the base model.
|
|
|
void | getTrailingViewer (const Viewer &subject,float distance_back,Viewer &view) throw () |
| getTrailingViewer() -- for over-the-shoulder views
|
void | setOpenGLProjection (const camera_t &camera) throw () |
| setOpenGLProjection() - set up OpenGL projection transformation
|
void | setOpenGLViewer (const Viewer &viewer) throw () |
| setOpenGLViewer() - set up initial OpenGL model/view transformation
|
void | addQuaternionRotation (const quaternion_t &q) throw () |
| addQuaternionRotation() - rotates current matrix by given quaternion
|
void | setPlacement (const placement_t &p) throw () |
| setPlacement() - updates current modelview transformation for placement
|
|
|
void | getViewFrustum (const camera_t &camera,const Viewer &viewer,frustum_t &viewFrustum) throw () |
| This is a method to determine the view frustum given the current camera settings and viewer orientation.
|
void | drawFrustumEdges (const frustum_t &f,const glut_color_t &color) throw () |
| helper method to draw the edges of a frustum
|
|
|
void | push2D (int screenWidth,int screenHeight) |
| switches to 2D drawing.
|
void | pop2D (void) |
| restores 3D drawing (make sure to call this after calling push2D()!).
|
void | drawCursor (int x, int y) |
|
|
int | createTextureFromImage (const media::image_t &image) |
|
|
void | createSphericalDensityMap (int size,const img_color_t &color,media::image_t &image) |
void | createCircularDensityMap (int size,const img_color_t &color,media::image_t &image) |
| creates a density map where alpha is constant (specified by color)
|
void | createLineSegmentDensityMap (int width,const img_color_t &color,media::image_t &image) |
| horizontal line segment running through the middle third of the image
|
|
|
void | drawTransparentPath (const point3d_t *pointArray,int *textureArray,int nSegments,Framebuffer *framebuffer,float size,int textureId,const render_context_t &rc,RenderQueue *rq) |
| draws a path, creating a texture normal to the viewer along each segment.
|
Variables |
static const float | s_twoPi = 2.0 * M_PI |
static const float | s_radiansPerDegree = M_PI / 180.0 |
static task_map_t | s_pendingTasks |
static task_map_t | s_completedTasks |
static smart_ptr< Host > | s_host |
static bool | s_fullscreen = false |
static pthread_t | s_glutThreadId = 0 |
static int | s_width = 0 |
static int | s_height = 0 |
static const int | s_maxBufferSize = 256 |
static const int | s_maxLighting = 3 |
static const float | s_dRot = 0.25 |
static const float | s_2 = sqrt(0.5) |
static const int | s_maxRGBA = 255 |
static const float | s_eps = 1.0e-6 |