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 | 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... | |
struct | tex_sphere_t |
data needed for texture-mapped spheres 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 |
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... | |
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... | |
Typedefs | |
typedef stack_array < anim_channel_state_t, MaxAnimations > | animation_list_t |
typedef std::vector< smart_ptr < DisplayLine > > | vec_display_lines_t |
typedef rect2d_t< int > | pixel_rect_t |
standard 2D pixel rect | |
typedef threadsafe_map < thread_id_t, smart_ptr < task_record_t > > | task_map_t |
typedef rect2d_t< int > | recti_t |
Functions | |
void | startDemo (IN int argc, IN const char *argv[], IN const char *title, IN 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 (IN smart_ptr< Font > &font, IN const char *lines, IN int millisecondsPerCharacter, IN const glut_color_t &color) |
this font effect will write out lines of text one character at a time. | |
void | breakLongString (IN const char *text, IN Font *font, IN int maxPixelWidth, OUT 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 (IO Font *font, IN const char *textToScale, IN int desiredPixelHeight) |
scale the given font to the specified height in pixels. | |
void | parseColor (IO std::istream &stream, OUT img_color_t &color) |
void | parseMaterial (IO std::istream &stream, IN const char *parentDir, OUT material_t &material) |
void | parsePolygon (IN MaterialRegistry *mreg, IO std::istream &stream, OUT polygon_t &polygon) |
void | parseModel (IN MaterialRegistry *mreg, IO std::istream &stream, OUT model_t &model) |
void | parseLodEntry (IN MaterialRegistry *mreg, IO std::istream &stream, OUT lod_entry_t &entry) |
void | parseLodModel (IN MaterialRegistry *mreg, IO std::istream &stream, OUT lod_model_t &lod_model) |
smart_ptr< MaterialRegistry > | getSimpleRegistry (IN const char *materialDir) |
get a simple implementation of a material registry. | |
smart_ptr< Renderable > | loadModel (IN const char *filename, IN MaterialRegistry *reg) |
load a model from a Wavepacket Glut Model file (.wgm extension, normally) | |
void | writeModelToStream (IO std::ostream &stream, IN const model_t &model) |
assumes you have already written the key name, this will write the opening and closing brackets | |
static void | renderColorPolygon (IN const polygon_t &p) throw () |
static void | queuePolygon (IN const point3d_t *vertex_array, IN const polygon_t &p, IO poly_request_t &pr) throw () |
static void | renderTexturePolygon (IN const point3d_t *vertex_array, IN const polygon_t &p) throw () |
static void | getDictionaryFromNextLine (IO std::istream &stream, IN const char *debug_info, OUT dictionary_t &d) |
static byte_t | getOptionalByte (IN const dictionary_t &d, IN const char *key) |
static void | writePoint3dToStream (IO std::ostream &stream, IN const point3d_t &p) |
static void | setUpImage (IN int width, IN int height, OUT media::image_t &img) |
static void | setSegment (IN const point3d_t &p0, IN const point3d_t &p1, IN const matrix4_t &T, IN int genTextureId, IN int outTextureId, IN Framebuffer *framebuffer, IN float size, IN const glut::render_context_t &rc, OUT poly_request_t *pr) |
static int | compareSegments (IN const void *p1, IN const void *p2) throw () |
smart_ptr< Renderable > | createCoolSphere (IN const sphere_init_t &si) |
create a really cool-looking sphere. Yeah. | |
smart_ptr< Renderable > | createMappedSphere (IN const tex_sphere_t &ts) |
create a texture-mapped sphere (mercator projection) The sphere will be oriented so that north is the positive y-direction, and that will be the top of the texture (v=1 coordinate) | |
static float | randomX (IN float x) |
static void | jitter (IO point3d_t &p, IN float dx) throw () |
static void | drawLightningRing (IN float radius, IN const point3d_t &axis, IN float phi, IN const glut_color_t &color) throw () |
static const sphere_vertex_t * | getSphereVertices (void) |
smart_ptr< Renderable > | createSkybox (IN smart_ptr< Renderable > &box) |
treat the given model as a skybox | |
smart_ptr< Renderable > | createTerrain (IN hfield::Heightfield *hfield) |
create a renderable heightfield model | |
static GLint | getGlutInternalFormat (IN const media::image_t &image) |
static GLint | getGlutFormatFromColorFormat (IN const media::image_t &image) |
static int | createOpenGLTexture (IN const media::image_t &image) |
void | processTasks (void) |
static void | onExit (void) |
static void | onDisplay (void) |
static void | onIdle (void) |
static void | onMouseButton (IN int button, IN int state, IN int x, IN int y) |
static void | onMouseMove (IN int x, IN int y) |
static void | onKeyboard (IN byte_t key, IN int x, IN int y) |
static void | onSpecialKeys (IN int key, IN int x, IN int y) |
static void | onReshape (IN int w, IN int h) |
void | start (IN int argc, IN const char *argv[], IN int width,IN int height,IN const char *title,IN const char *gameModeString,IN smart_ptr< Host > &host) |
clients can call this to get common glut setup | |
void | requestTask (IO Task *task) |
Here a thread can request that a task be handled by the open GL thread. | |
void | drawRectLines (IN const rect3d_t &r, IN const glut_color_t &c) throw () |
draw the outline of a 3D rectangle | |
void | getModelViewMatrix (OUT matrix4_t &T) throw () |
get a 4x4 matrix from the given OpenGL matrix | |
smart_ptr< Renderable > | createXformModel (IN const matrix4_t &xform, IN 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 | createSphericalDensityMap (IN int size,IN const img_color_t &color, OUT media::image_t &image) |
void | createCircularDensityMap (IN int size,IN const img_color_t &color, OUT media::image_t &image) |
creates a density map where alpha is constant (specified by color) | |
void | createLineSegmentDensityMap (IN int width, IN const img_color_t &color, OUT media::image_t &image) |
horizontal line segment running through the middle third of the image | |
void | drawTransparentPath (IN const point3d_t *pointArray,IN int *textureArray,IN int nSegments, IN Framebuffer *framebuffer, IN float size, IN int textureId, IN const render_context_t &rc, IN RenderQueue *rq) |
draws a path, creating a texture normal to the viewer along each segment. | |
void | getTrailingViewer (IN const Viewer &subject, IN float distance_back, OUT Viewer &view) throw () |
getTrailingViewer() -- for over-the-shoulder views | |
void | setOpenGLProjection (IN const camera_t &camera) throw () |
setOpenGLProjection() - set up OpenGL projection transformation | |
void | setOpenGLViewer (IN const Viewer &viewer) throw () |
setOpenGLViewer() - set up initial OpenGL model/view transformation | |
void | addQuaternionRotation (IN const quaternion_t &q) throw () |
addQuaternionRotation() - rotates current matrix by given quaternion | |
void | setPlacement (IN const placement_t &p) throw () |
setPlacement() - updates current modelview transformation for placement | |
void | getViewFrustum (IN const camera_t &camera, IN const Viewer &viewer, OUT frustum_t &viewFrustum) throw () |
This is a method to determine the view frustum given the current camera settings and viewer orientation. | |
void | drawFrustumEdges (IN const frustum_t &f, IN const glut_color_t &color) throw () |
helper method to draw the edges of a frustum | |
void | push2D (IN int screenWidth, IN int screenHeight) |
switches to 2D drawing. | |
void | pop2D (void) |
restores 3D drawing (make sure to call this after calling push2D()!). | |
void | drawCursor (IN int x, IN int y) |
int | createTextureFromImage (IN const media::image_t &image) |
Variables | |
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 float | s_radiansPerDegree = M_PI / 180.0 |
static const int | s_maxRGBA = 255 |
static const float | s_eps = 1.0e-6 |
static const int | s_degreesPerSlice = 9 |
static const int | s_vertexCount |
static const float | s_twoPi = 2.0 * M_PI |
static task_map_t | s_pendingTasks |
static task_map_t | s_completedTasks |
static smart_ptr< Host > | s_host |
static bool | s_fullscreen = false |
static thread_id_t | s_glutThreadId = 0 |
static int | s_width = 0 |
static int | s_height = 0 |
typedef threadsafe_map<thread_id_t, smart_ptr<task_record_t> > glut::task_map_t |
Definition at line 70 of file wave-glut.cpp.
static void glut::renderColorPolygon | ( | IN const polygon_t & | p | ) | throw () [static] |
Definition at line 47 of file model-draw.cpp.
static void glut::queuePolygon | ( | IN const point3d_t * | vertex_array, | |
IN const polygon_t & | p, | |||
IO poly_request_t & | pr | |||
) | throw () [static] |
Definition at line 73 of file model-draw.cpp.
static void glut::renderTexturePolygon | ( | IN const point3d_t * | vertex_array, | |
IN const polygon_t & | p | |||
) | throw () [static] |
Definition at line 109 of file model-draw.cpp.
static void glut::getDictionaryFromNextLine | ( | IO std::istream & | stream, | |
IN const char * | debug_info, | |||
OUT dictionary_t & | d | |||
) | [static] |
Definition at line 63 of file model-parsing.cpp.
static byte_t glut::getOptionalByte | ( | IN const dictionary_t & | d, | |
IN const char * | key | |||
) | [static] |
Definition at line 84 of file model-parsing.cpp.
static void glut::writePoint3dToStream | ( | IO std::ostream & | stream, | |
IN const point3d_t & | p | |||
) | [static] |
Definition at line 101 of file model-parsing.cpp.
static void glut::setUpImage | ( | IN int | width, | |
IN int | height, | |||
OUT media::image_t & | img | |||
) | [static] |
Definition at line 50 of file density-map.cpp.
void glut::createSphericalDensityMap | ( | IN int | size, | |
IN const img_color_t & | color, | |||
OUT media::image_t & | image | |||
) |
creates a density map where alpha varies by sphere cross-section
size | width and height |
void glut::createCircularDensityMap | ( | IN int | size, | |
IN const img_color_t & | color, | |||
OUT media::image_t & | img | |||
) |
creates a density map where alpha is constant (specified by color)
size | width and height |
void glut::createLineSegmentDensityMap | ( | IN int | width, | |
IN const img_color_t & | color, | |||
OUT media::image_t & | img | |||
) |
horizontal line segment running through the middle third of the image
static void glut::setSegment | ( | IN const point3d_t & | p0, | |
IN const point3d_t & | p1, | |||
IN const matrix4_t & | T, | |||
IN int | genTextureId, | |||
IN int | outTextureId, | |||
IN Framebuffer * | framebuffer, | |||
IN float | size, | |||
IN const glut::render_context_t & | rc, | |||
OUT poly_request_t * | pr | |||
) | [static] |
Definition at line 56 of file light-path.cpp.
static int glut::compareSegments | ( | IN const void * | p1, | |
IN const void * | p2 | |||
) | throw () [static] |
Definition at line 244 of file light-path.cpp.
void glut::drawTransparentPath | ( | IN const point3d_t * | pointArray, | |
IN int * | textureArray, | |||
IN int | nSegments, | |||
IN Framebuffer * | framebuffer, | |||
IN float | size, | |||
IN int | textureId, | |||
IN const render_context_t & | rc, | |||
IN RenderQueue * | rq | |||
) |
draws a path, creating a texture normal to the viewer along each segment.
The texture is assumed to be transparent so is added to the render queue.
pointArray | nSegments + 1 | |
textureArray | nSegments in size |
static float glut::randomX | ( | IN float | x | ) | [static] |
Definition at line 48 of file sphere.cpp.
static void glut::jitter | ( | IO point3d_t & | p, | |
IN float | dx | |||
) | throw () [static] |
Definition at line 59 of file sphere.cpp.
static void glut::drawLightningRing | ( | IN float | radius, | |
IN const point3d_t & | axis, | |||
IN float | phi, | |||
IN const glut_color_t & | color | |||
) | throw () [static] |
Definition at line 100 of file sphere.cpp.
static const sphere_vertex_t* glut::getSphereVertices | ( | void | ) | [static] |
Definition at line 85 of file tex-sphere.cpp.
smart_ptr< glut::Renderable > glut::createTerrain | ( | IN hfield::Heightfield * | hfield | ) |
create a renderable heightfield model
void glut::getTrailingViewer | ( | IN const Viewer & | subject, | |
IN float | dist, | |||
OUT Viewer & | view | |||
) | throw () |
getTrailingViewer() -- for over-the-shoulder views
void glut::setOpenGLProjection | ( | IN const camera_t & | camera | ) | throw () |
setOpenGLProjection() - set up OpenGL projection transformation
void glut::setOpenGLViewer | ( | IN const Viewer & | viewer | ) | throw () |
setOpenGLViewer() - set up initial OpenGL model/view transformation
void glut::addQuaternionRotation | ( | IN const quaternion_t & | q | ) | throw () |
addQuaternionRotation() - rotates current matrix by given quaternion
void glut::setPlacement | ( | IN const placement_t & | p | ) | throw () |
setPlacement() - updates current modelview transformation for placement
static GLint glut::getGlutInternalFormat | ( | IN const media::image_t & | image | ) | [static] |
Definition at line 48 of file texture.cpp.
static GLint glut::getGlutFormatFromColorFormat | ( | IN const media::image_t & | image | ) | [static] |
Definition at line 59 of file texture.cpp.
static int glut::createOpenGLTexture | ( | IN const media::image_t & | image | ) | [static] |
Definition at line 81 of file texture.cpp.
void glut::processTasks | ( | void | ) |
Definition at line 97 of file wave-glut.cpp.
static void glut::onExit | ( | void | ) | [static] |
Definition at line 138 of file wave-glut.cpp.
static void glut::onDisplay | ( | void | ) | [static] |
Definition at line 166 of file wave-glut.cpp.
static void glut::onIdle | ( | void | ) | [static] |
Definition at line 192 of file wave-glut.cpp.
static void glut::onMouseButton | ( | IN int | button, | |
IN int | state, | |||
IN int | x, | |||
IN int | y | |||
) | [static] |
Definition at line 233 of file wave-glut.cpp.
static void glut::onMouseMove | ( | IN int | x, | |
IN int | y | |||
) | [static] |
Definition at line 259 of file wave-glut.cpp.
static void glut::onKeyboard | ( | IN byte_t | key, | |
IN int | x, | |||
IN int | y | |||
) | [static] |
Definition at line 283 of file wave-glut.cpp.
static void glut::onSpecialKeys | ( | IN int | key, | |
IN int | x, | |||
IN int | y | |||
) | [static] |
Definition at line 309 of file wave-glut.cpp.
static void glut::onReshape | ( | IN int | w, | |
IN int | h | |||
) | [static] |
Definition at line 335 of file wave-glut.cpp.
const int glut::s_maxBufferSize = 256 [static] |
Definition at line 42 of file glut-demo.cpp.
const int glut::s_maxLighting = 3 [static] |
Definition at line 43 of file glut-demo.cpp.
const float glut::s_dRot = 0.25 [static] |
Definition at line 44 of file glut-demo.cpp.
const float glut::s_2 = sqrt(0.5) [static] |
Definition at line 45 of file glut-demo.cpp.
const float glut::s_radiansPerDegree = M_PI / 180.0 [static] |
Definition at line 47 of file glut-demo.cpp.
const int glut::s_maxRGBA = 255 [static] |
Definition at line 39 of file density-map.cpp.
const float glut::s_eps = 1.0e-6 [static] |
Definition at line 40 of file light-path.cpp.
const int glut::s_degreesPerSlice = 9 [static] |
Definition at line 65 of file tex-sphere.cpp.
const int glut::s_vertexCount [static] |
4 * (90 / s_degreesPerSlice) * (360 / s_degreesPerSlice)
Definition at line 72 of file tex-sphere.cpp.
const float glut::s_twoPi = 2.0 * M_PI [static] |
Definition at line 41 of file camera.cpp.
task_map_t glut::s_pendingTasks [static] |
Definition at line 72 of file wave-glut.cpp.
task_map_t glut::s_completedTasks [static] |
Definition at line 73 of file wave-glut.cpp.
smart_ptr<Host> glut::s_host [static] |
Definition at line 80 of file wave-glut.cpp.
bool glut::s_fullscreen = false [static] |
Definition at line 81 of file wave-glut.cpp.
thread_id_t glut::s_glutThreadId = 0 [static] |
Definition at line 82 of file wave-glut.cpp.
int glut::s_width = 0 [static] |
Definition at line 85 of file wave-glut.cpp.
int glut::s_height = 0 [static] |
Definition at line 86 of file wave-glut.cpp.