Mostly this library is here only as a convenient placeholder.
More...
Classes | |
class | glut::Viewer |
class | glut::Material |
A Material is anything that needs to be set up prior to drawing, and possibly requiring some cleanup afterwards. More... | |
struct | glut::fcolor_t |
base floating point color object More... | |
class | glut::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 | glut::Task |
Create one of these (you'll have to inherit) if you have openGL work you need to submit to requestTask(). More... | |
Modules | |
OpenGL Effects Library | |
Several useful OpenGL effects. | |
Cameras and OpenGL | |
Basically, use GL_PROJECTION to set up the camera properties but NOT position or rotation. | |
Wavepacket OpenGL Threading | |
| |
Functions | |
void | glut::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 | |
| |
typedef rect2d_t< int > | glut::recti_t |
| |
void | glut::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 | glut::drawFrustumEdges (IN const frustum_t &f, IN const glut_color_t &color) throw () |
helper method to draw the edges of a frustum | |
| |
void | glut::push2D (IN int screenWidth, IN int screenHeight) |
switches to 2D drawing. | |
void | glut::pop2D (void) |
restores 3D drawing (make sure to call this after calling push2D()!). | |
void | glut::drawCursor (IN int x, IN int y) |
| |
int | glut::createTextureFromImage (IN const media::image_t &image) |
Mostly this library is here only as a convenient placeholder.
Code with glut dependencies can refer to this module in the build, and then the right directories will be searched for include files, the right libraries linked, etc.
This library does provide a few helper objects and methods to make using glut easier, and to abstract away common setup code.
typedef rect2d_t<int> glut::recti_t |
Definition at line 50 of file renderable.h.
void glut::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.
What is a frustum? It is a basic 3D solid. See http://en.wikipedia.org/wiki/Frustum In particular, this is a clipped 4-sided pyramid, also called a right square frustum. In 3D rendering, a frustum defines the area of space that can be seen from the current camera, given its position and orientation. This is called the view frustrum. Given other objects, we can quickly test if they are inside the view frustrum or not. If not, we can avoid rendering them altogether. This is called culling. If you have partitioned your object space (always a good idea), you can cull dozens or hundreds of objects with a single frustum/rectangle test.
For more links on view frustrum culling try:
Or for an up-to-date search: http://www.google.com/search?q=opengl+view+frustum+culling
viewFrustum | view frustum |
void glut::push2D | ( | IN int | screenWidth, | |
IN int | screenHeight | |||
) |
switches to 2D drawing.
NOTE: for historical reasons, I don't follow the usual OpenGL coordinate conventions here. In 2D coordinates, positive Y down, not up. y=0 is the top of the screen. (OpenGL is flipped: positive Y is up). So be aware when 2D drawing.
int glut::createTextureFromImage | ( | IN const media::image_t & | image | ) |
creates a texture from the given image, and returns the new texture ID
void glut::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
width | window width, pixels | |
height | window height, pixels | |
title | window title | |
gameModeString | optional |
void glut::drawFrustumEdges | ( | IN const frustum_t & | f, | |
IN const glut_color_t & | c | |||
) | throw () |
helper method to draw the edges of a frustum
void glut::pop2D | ( | void | ) |
restores 3D drawing (make sure to call this after calling push2D()!).
void glut::drawCursor | ( | IN int | x, | |
IN int | y | |||
) |