dmuGLTex2d

Inherits from: dmuGLPBuffer

#include "dmuGLTex2d.h"

Overview

The dmuGLTex2d class inherits from dmuGLPBuffer, and implements the functionality needed to use the latest data that has been receive from the parent object as a texture map in subsequent OpenGL operations. See the dmuGLPBuffer class for more details on how dmuGLPBuffers work.

The dmuGLTex2d object takes care of the grab() and release() method calls on the dmuGLPBuffer. These are wrapped in the defineTex2D method. The typical usage scenario of dmuGLTex2d looks something like this:

  • Construct (and name) a dmuObject that will be used as the data source for the dmuGLTex2d object

  • Construct (and name) a dmuGLTex2d object

  • Wire the object into the dmu chain

  • Call setup() on the dmuGLTex2d object using parameters obtained from the application (theDisplay) and from the parent object (imageSizeX, imageSizeY) Make sure the image dimensions are powers of 2.

  • Start up the dmu chain (using start() at the head of the chain), and enter the normal handle events loop. See the Overview for more information.

  • When the application wants to render a scene (after knowing that the parent of the dmuGLTex2d has gotten at least one valid frame of data), call defineTex2D. This grabs the latest data, and sets up openGL to use the data as the current texture map. (This data will be valid until the next call to defineTex2D.)

  • Render the scene. Repeat the previous step whenever the application wants to render the scene (this often happens in a separate thread from the dmu handleEvents loop).

    See the source code for more info and implementation details.

    Public Methods


    Overview    Object List     Object Hierarchy       Sample Apps