Contents User Forum Source Index APIs by Task APIs by Level Data


Selected APIs by Task

This page lists the most commonly used G3D APIs grouped into functional tasks:

  • Images and Video
  • Strings
  • File I/O
  • Ray Tracing and Physics
  • Network
  • Boldface links designate the most common and easy-to-use features. Not all API entry points are shown in this index.

    Debugging

    debugAssertAssertion macro with friendly dialog box in DEBUG builds
    screenPrintfPrints information that repeats every frame to the screen
    debugPrintfPrints to the 3D console, terminal, and log.txt
    consolePrintfPrints to the 3D console and log.txt
    logPrintfPrints to log.txt
    GApp::debugPaneAdd your own debugging GUI controls to this provided window
    G3D::debugPrintfPrints to the terminal (Unix) or Output Window (Win) in DEBUG builds
    logPrintfPrints to the log.txt file (which you should regularly check for warnings!)
    DrawRender simple geometric primitives without loading a model
    debugAssertMAssertion macro with a string message in DEBUG builds
    alwaysAssertMAssertion macro that remains even in optimized builds
    GApp::catchCommonExceptionsTurn uncaught exceptions into assertion failures
    LogGuarantees output is written to disk before Log::printf returns
    describeSystemReturns a string describing the current machine
    isValidHeapPointerUsed in assertions to identify bad pointers
    isValidPointerUsed in assertions to identify bad pointers
    setAssertionHookOverride the behavior of assertion failures
    setFailureHookOverride the behavior of alwaysAssertM failures in RELEASE builds
    GApp::showDebugTextEnable GApp::debugPrintf output

    Profiling and Optimization

    StopwatchAccurately measure the duration and effective framerate of routines
    RenderDevice::getTriangleCount, RenderDevice::getTriangleRate, RenderDevice::getTrianglesPerFrameMeasure the GPU vertex throughput
    GApp::showRenderingStatsDisplay performance information on the 3D window
    System::mallocPerformance, System::mallocStatus, System::resetMallocPerformanceCountersMeasure heap size and detect memory leaks
    System::beginCycleCount, System::endCycleCountCycle-accurate timing of very short routines

    2D Graphical User Interface

    GuiWindowSkinnable GUI (documentation contains GUI sample code)
    GuiPaneContainer and creator of other GUI controls; obtained from a GuiWindow
    GEvent, GEventTypeEvent class and type enum, used inside an event handler
    UserInputPollable keyboard, mouse, and joystick state used inside an event handler
    GApp::onEvent, GApp::onUserInputOverridable event handlers
    GFontExplicitly render text
    GuiButton, GuiCheckBox, GuiDropDownList, GuiSlider, GuiRadioButton, GuiLabel, GuiTextBoxGUI controls created by GuiPanel
    Widget
    PosedModel2D2D object scene graph, used by Widgets for rendering
    Manipulator
    msgBoxCreate a new OS window popup message

    Scene Graph

    SkySkybox, moon, sun, and stars
    IFSModelRigid body
    ArticulatedModelRigid bodies connected by joints, loads 3DS and IFS models
    BSPMapQuake 3 map
    MD2ModelQuake 2 character
    PosedModelStatic object that is prepared for rendering. Exposes geometry and adjacency information
    GCameraPinhole perspective camera abstraction
    ShapeGeometric primitives primarily used for bounding volumes and debugging

    Shadows

    Shadow rendering algorithms first determine shadowed locations, and then paint ambient illumination everywhere, and finally add illumination only in non-shadowed areas. There are two major algorithms for determining the shadowed locations in real-time, shadow volumes and shadow maps. G3D supports both, on programmable and fixed function hardware.

    ShadowMapShadow map allocation and rendering
    PosedModel::renderShadowedLightPassRender shadow volume shadows on any model (when used with begin/endMarkShadows)
    RenderDevice::configureShadowMapFixed function shadow map rendering
    Texture::createEmpty(...TextureFormat::DEPTH24, Texture::Settings::shadow)Create an empty shadow map
    SuperShader::configureShadowShaderProgrammable pipeline shadow map rendering
    PosedModel::renderShadowMappedLightPassRender shadow mapped shadows on any model
    beginMarkShadows, markShadows, endMarkShadowsCompute and render stenciled shadow volumes

    Image Processing

    Draw::rect2DStretch a Texture over a rectangle on screen
    TextureGPU image representation
    FramebufferAn "off-screen" rendering surface used for image processing on the GPU
    Image3RGB floating point image
    Image1Monochrome floating point image
    Image4RGBA floating point image
    Image1uint88-bit Monochrome image
    Image3uint824-bit RGB image
    Image4uint832-bit RGBA image
    Color1, Color3, Color4Floating-point monochrome, RGB, and RGBA color (no clamping)
    Color1uint8, Color3uint8, Color4uint88-bit Monochrome, 24-bit RGB, and 32-bit RGBA color (clamped to 0-1 / 0-255)
    GImageFast but harder to use mono-8, RGB-24, or RGBA-32 image
    Map2DTemplated image class, e.g., for creating normal maps or arbitrary grids of values
    WrapModeSpecifies how out-of-bounds image locations are treated for Texture, Map2D, and Image classes
    gaussian1DGenerate 1D blur filter coefficients
    GaussianBlurFast GPU 1D blur
    ToneMapGamma correct, adaptation, and bloom for realistic lighting

    String Processing

    beginsWith, endsWith

    formatConvert numbers to strings (a safe sprintf)

    isSlash, isWhiteSpace, isDigit, isNewline, isLetter, isQuote

    stringSplit, stringJoin

    toUpper, toLowerChange case

    trimWhitespaceRemove blanks at the beginning and end of a string

    STRMacro for creating large blocks of quoted text, usually used with G3D::Shader

    TextInput(TextInput::FROM_STRING, ...)Tokenizer for parsing complex strings

    File I/O

    BinaryInput, BinaryOutput
    TextInput, TextOutput
    getFiles, getDirsGet a directory listing, including wildcards
    readWholefile, writeWholeFile
    AnyCan hold any common value and read/write tables of named values. Very useful for making configuration files
    copyFile
    createTempFile

    filenameContainsWildcards, filenameBaseExt, filenameExt, filenamePath, parseFilenameFilename parsing and manipulation
    isDirectory, fileIsNewer, fileExists, fileLengthFile testing and comparison

    Ray Tracing and Physics

    Ray tracing and physical simulation both compute intersections between geometric primitives. G3D distinguishes between "moving" collision detection, where two objects are moving with relative constant velocity; and "fixed" detection where where the relative velocity of the objects is zero. The two problems are related. A "moving point" is the same as a fixed ray, a "moving sphere" is a fixed capsule, and so on. Thus for ray tracing one often uses "moving point" collision detection instead of rays (which is reasonable, since ray tracing simulates photons moving around a scene).

    CollisionDetectionMoving and fixed collisions between many kinds of primitives
    Ray, Sphere, Plane, Box, AABox, Triangle, Plane, Line, Cylinder, Capsule, Shape Geometric primitives
    MeshAlgRoutines for operating on triangle meshes
    AABSPTreeAxis-aligned binary space partition tree for O(log n) collision detection
    PointAABSPTreeAABSP tree optimized for zero-extent objects. Primarily used as a photon map
    GCamera::worldRayObtain the ray through a pixel
    Image3, Image4Useful for software rendering output and texture maps
    Vector3::reflectionDirection, Vector3::refractionDirection

    Network

    See also the Networking Overview.

    ReliableConduitMessage-based TCP infrastructure ideal for most games
    DiscoveryClient, DiscoveryServer, DiscoveryAdvertisementLAN-browsing infrastructure
    NetListenerServer-side way of listening for incoming connections
    BinaryInput, BinaryOutputUsed by serialize/deserialize methods to binary encode messages for transfer.
    NetAddressIP, port, and hostname addressing
    LightweightConduitMessage-based UDP infrastructure. Allows multi-cast and NAT traversal, but at the cost of unreliable transfer.


    Generated on Thu Aug 2 11:40:43 2007 for G3D by doxygen 1.5.2
    Hosted by SourceForge.net Logo