DriveWorks SDK Reference

| 0.6.67 Release

Renderer

Detailed Description

Defines Renderer related types, structs, and functions.

Data Structures

struct  dwRenderBufferVertexLayout
 Vertex layout describing format and semantics for position, color, and texture. More...
 

Typedefs

typedef const struct dwRenderBufferObject * dwConstRenderBufferHandle_t
 Const handle representing vertex data for rendering. More...
 
typedef const struct dwRendererObject * dwConstRendererHandle_t
 Const handle for the renderer. More...
 
typedef struct dwRenderBufferObject * dwRenderBufferHandle_t
 Handle representing vertex data for rendering. More...
 
typedef struct dwRendererObject * dwRendererHandle_t
 Handle for the renderer. More...
 

Enumerations

enum  dwRenderBufferColorSemantic {
  DW_RENDER_SEMANTIC_COL_NULL = 0,
  DW_RENDER_SEMANTIC_COL_R = 1,
  DW_RENDER_SEMANTIC_COL_A = 2,
  DW_RENDER_SEMANTIC_COL_RGB = 3,
  DW_RENDER_SEMANTIC_COL_RGBA = 4,
  DW_RENDER_SEMANTIC_COL_LUT = 5,
  DW_RENDER_SEMANTIC_COL_HUE = 6
}
 Vertex component semantics. More...
 
enum  dwRenderBufferFormat {
  DW_RENDER_FORMAT_NULL = 0,
  DW_RENDER_FORMAT_R32G32B32A32_FLOAT = 1,
  DW_RENDER_FORMAT_R32G32B32_FLOAT = 2,
  DW_RENDER_FORMAT_R32G32_FLOAT = 3,
  DW_RENDER_FORMAT_R32_FLOAT = 4
}
 Vertex component channel count and format. More...
 
enum  dwRenderBufferPositionSemantic {
  DW_RENDER_SEMANTIC_POS_NULL = 0,
  DW_RENDER_SEMANTIC_POS_XY = 1,
  DW_RENDER_SEMANTIC_POS_XYZ = 2
}
 Vertex component semantics. More...
 
enum  dwRenderBufferPrimitiveType {
  DW_RENDER_PRIM_POINTLIST = 0,
  DW_RENDER_PRIM_LINELIST = 1,
  DW_RENDER_PRIM_TRIANGLELIST = 2,
  DW_RENDER_PRIM_LINESTRIP = 3,
  DW_RENDER_PRIM_LINELOOP = 4
}
 Render primitives supported by the renderer. More...
 
enum  dwRenderBufferTexSemantic {
  DW_RENDER_SEMANTIC_TEX_NULL = 0,
  DW_RENDER_SEMANTIC_TEX_S = 1,
  DW_RENDER_SEMANTIC_TEX_ST = 2
}
 Vertex component semantics. More...
 
enum  dwRendererFonts {
  DW_RENDER_FONT_VERDANA_8 = 0,
  DW_RENDER_FONT_VERDANA_12 = 1,
  DW_RENDER_FONT_VERDANA_16 = 2,
  DW_RENDER_FONT_VERDANA_20 = 3,
  DW_RENDER_FONT_VERDANA_24 = 4,
  DW_RENDER_FONT_VERDANA_32 = 5,
  DW_RENDER_FONT_VERDANA_48 = 6,
  DW_RENDER_FONT_VERDANA_64 = 7,
  DW_RENDER_FONT_COUNT
}
 Font types and sizes supported by the renderer. More...
 

Functions

DW_API_PUBLIC dwStatus dwRenderBuffer_createView (uint32_t *slot, dwRenderBufferHandle_t renderbuffer, const dwRenderBufferVertexLayout newLayout, const dwRenderBufferPrimitiveType newPrimType, dwContextHandle_t context)
 Creates an additional view for a render buffer, allowing you to change layout and primitive type, but not vertex stride. More...
 
DW_API_PUBLIC dwStatus dwRenderBuffer_initialize (dwRenderBufferHandle_t *renderbuffer, const dwRenderBufferVertexLayout layout, const dwRenderBufferPrimitiveType primType, const uint32_t primCount, dwContextHandle_t context)
 Initializes a RenderBuffer structure for rendering. More...
 
DW_API_PUBLIC dwStatus dwRenderBuffer_map (float32_t **map, uint32_t *maxVertices, uint32_t *vertexStride, dwRenderBufferHandle_t renderbuffer)
 Maps the CPU copy of a RenderBuffer to the application for updating. More...
 
DW_API_PUBLIC dwStatus dwRenderBuffer_mapRange (float32_t **map, uint32_t *maxVertices, uint32_t *vertexStride, const uint32_t startVertex, dwRenderBufferHandle_t renderbuffer)
 Maps a contiguous range of the CPU copy of a RenderBuffer to the application for updating. More...
 
DW_API_PUBLIC dwStatus dwRenderBuffer_release (dwRenderBufferHandle_t *renderbuffer)
 Releases the RenderBuffer data structure. More...
 
DW_API_PUBLIC dwStatus dwRenderBuffer_set2DCoordNormalizationFactors (const float32_t width, const float32_t height, dwRenderBufferHandle_t renderbuffer)
 Sets 2D normalization values when 2D coordinates are specified in pixel values and not in 0..1 range. More...
 
DW_API_PUBLIC dwStatus dwRenderBuffer_unmap (uint32_t nVerts, dwRenderBufferHandle_t renderbuffer)
 After a map/mapRange, returns the updated buffer to the RenderBuffer structure and updates the GPU portion. More...
 
DW_API_PUBLIC dwStatus dwRenderer_get2DTransform (float32_t matrix[9], dwConstRendererHandle_t obj)
 Gets current 2D transformation applied when rendering to the screen. More...
 
DW_API_PUBLIC dwStatus dwRenderer_getColor (float32_t color[4], dwConstRendererHandle_t obj)
 Gets current rendering color. More...
 
DW_API_PUBLIC dwStatus dwRenderer_getColorMapScale (float32_t colorMapScale[3], dwConstRendererHandle_t obj)
 Gets current rendering color map scale. More...
 
DW_API_PUBLIC dwStatus dwRenderer_getFont (dwRendererFonts *value, dwConstRendererHandle_t obj)
 Gets current font. More...
 
DW_API_PUBLIC dwStatus dwRenderer_getLineWidth (float32_t *value, dwConstRendererHandle_t obj)
 Gets current line width, in pixels. More...
 
DW_API_PUBLIC dwStatus dwRenderer_getModelView (float32_t matrix[16], dwConstRendererHandle_t obj)
 Gets current ModelView matrix. More...
 
DW_API_PUBLIC dwStatus dwRenderer_getPointSize (float32_t *value, dwConstRendererHandle_t obj)
 Gets current point size. More...
 
DW_API_PUBLIC dwStatus dwRenderer_getProjection (float32_t matrix[16], dwConstRendererHandle_t obj)
 Gets current projection matrix. More...
 
DW_API_PUBLIC dwStatus dwRenderer_getRect (dwRect *rect, dwConstRendererHandle_t obj)
 Gets current rendering screen area expressed in pixel values. More...
 
DW_API_PUBLIC dwStatus dwRenderer_initialize (dwRendererHandle_t *renderer, dwContextHandle_t context)
 Initializes a Renderer. More...
 
DW_API_PUBLIC dwStatus dwRenderer_release (dwRendererHandle_t *renderer)
 Released the renderer. More...
 
DW_API_PUBLIC dwStatus dwRenderer_renderBuffer (dwConstRenderBufferHandle_t buffer, dwRendererHandle_t obj)
 Renders a RenderBuffer. More...
 
DW_API_PUBLIC dwStatus dwRenderer_renderCircle (dwVector2f center, float32_t radius, dwRendererHandle_t obj)
 Renders a 2D circle. More...
 
DW_API_PUBLIC dwStatus dwRenderer_renderData2D (const dwVector2f *buffer, size_t count, dwRenderBufferPrimitiveType primitiveType, dwRendererHandle_t obj)
 Renders a set of 2D vertices. More...
 
DW_API_PUBLIC dwStatus dwRenderer_renderData3D (const dwVector3f *buffer, size_t count, dwRenderBufferPrimitiveType primitiveType, dwRendererHandle_t obj)
 Renders a set of 3D vertices. More...
 
DW_API_PUBLIC dwStatus dwRenderer_renderSubTexture (const GLuint inputTexture, const GLenum textureTarget, const float32_t minx, const float32_t miny, const float32_t maxx, const float32_t maxy, dwRendererHandle_t obj)
 Renders a subrect of a textured quad on the screen. More...
 
DW_API_PUBLIC dwStatus dwRenderer_renderText (const int32_t x, const int32_t y, const char *text, dwRendererHandle_t obj)
 Renders a text line on the screen. More...
 
DW_API_PUBLIC dwStatus dwRenderer_renderTextNorm (const float32_t normX, const float32_t normY, const char *text, dwRendererHandle_t obj)
 Renders a text line on the screen. More...
 
DW_API_PUBLIC dwStatus dwRenderer_renderTexture (const GLuint inputTexture, const GLenum textureTarget, dwRendererHandle_t obj)
 Renders a textured quad on the screen. More...
 
DW_API_PUBLIC dwStatus dwRenderer_reset (dwRendererHandle_t renderer)
 Resets renderer state. More...
 
DW_API_PUBLIC dwStatus dwRenderer_set2DTransform (const float32_t matrix[9], dwRendererHandle_t obj)
 Sets current 2D transformation applied when rendering to the screen. More...
 
DW_API_PUBLIC dwStatus dwRenderer_setColor (const float32_t color[4], dwRendererHandle_t obj)
 Sets current rendering color. More...
 
DW_API_PUBLIC dwStatus dwRenderer_setColorMapScale (const float32_t colorMapScale[3], dwRendererHandle_t obj)
 Sets current rendering color mapping scale. More...
 
DW_API_PUBLIC dwStatus dwRenderer_setFont (const dwRendererFonts value, dwRendererHandle_t obj)
 Sets current font. More...
 
DW_API_PUBLIC dwStatus dwRenderer_setLineWidth (const float32_t value, dwRendererHandle_t obj)
 Sets current line width, in pixels. More...
 
DW_API_PUBLIC dwStatus dwRenderer_setModelView (const float32_t matrix[16], dwRendererHandle_t obj)
 Sets current ModelView matrix. More...
 
DW_API_PUBLIC dwStatus dwRenderer_setPointSize (const float32_t value, dwRendererHandle_t obj)
 Sets current point size. More...
 
DW_API_PUBLIC dwStatus dwRenderer_setProjection (const float32_t matrix[16], dwRendererHandle_t obj)
 Sets current projection matrix. More...
 
DW_API_PUBLIC dwStatus dwRenderer_setRect (const dwRect rect, dwRendererHandle_t obj)
 Sets current rendering screen area expressed in pixel values. More...
 

Variables

const float32_t DW_RENDER_COLORMAPSCALE_100M [3] = { 100.0f, 100.0f, 100.0f}
 
const float32_t DW_RENDER_COLORMAPSCALE_130M [3] = { 130.0f, 130.0f, 130.0f}
 
const float32_t DW_RENDER_COLORMAPSCALE_150M [3] = { 150.0f, 150.0f, 150.0f}
 
const float32_t DW_RENDER_COLORMAPSCALE_75M [3] = { 75.0f, 75.0f, 75.0f}
 Color map scales - determine the bandwidth of the color spectum. More...
 
static const uint32_t DW_RENDERBUFFER_MAX_VIEWS = 10
 The maximal number of views that can be created in with. More...
 
const float32_t DW_RENDERER_COLOR_BLACK [4] = { 0.0f/255.0f, 0.0f/255.0f, 0.0f/255.0f, 1.0f}
 
const float32_t DW_RENDERER_COLOR_BLUE [4] = { 32.0f/255.0f, 72.0f/255.0f, 230.0f/255.0f, 1.0f}
 
const float32_t DW_RENDERER_COLOR_DARKBLUE [4] = { 45.0f/255.0f, 44.0f/255.0f, 100.0f/255.0f, 0.6f}
 
const float32_t DW_RENDERER_COLOR_DARKGREEN [4] = { 45.0f/255.0f, 100.0f/255.0f, 44.0f/255.0f, 1.0f}
 
const float32_t DW_RENDERER_COLOR_DARKGREY [4] = { 72.0f/255.0f, 72.0f/255.0f, 72.0f/255.0f, 1.0f}
 
const float32_t DW_RENDERER_COLOR_DARKRED [4] = { 180.0f/255.0f, 5.0f/255.0f, 0.0f/255.0f, 1.0f}
 
const float32_t DW_RENDERER_COLOR_GREEN [4] = { 32.0f/255.0f, 230.0f/255.0f, 32.0f/255.0f, 1.0f}
 
const float32_t DW_RENDERER_COLOR_LIGHTBLUE [4] = { 51.0f/255.0f, 153.0f/255.0f, 255.0f/255.0f, 0.6f}
 
const float32_t DW_RENDERER_COLOR_LIGHTGREEN [4] = { 118.0f/255.0f, 185.0f/255.0f, 0.0f/255.0f, 1.0f}
 
const float32_t DW_RENDERER_COLOR_ORANGE [4] = { 230.0f/255.0f, 100.0f/255.0f, 10.0f/255.0f, 1.0f}
 
const float32_t DW_RENDERER_COLOR_RED [4] = { 230.0f/255.0f, 72.0f/255.0f, 32.0f/255.0f, 1.0f}
 
const float32_t DW_RENDERER_COLOR_WHITE [4] = { 230.0f/255.0f, 230.0f/255.0f, 230.0f/255.0f, 1.0f}
 
const float32_t DW_RENDERER_COLOR_YELLOW [4] = { 230.0f/255.0f, 230.0f/255.0f, 10.0f/255.0f, 1.0f}
 
static const uint32_t DW_RENDERER_DEFAULT_BUFFER_SIZE = 10000
 The maximum number of vertices that can be passed to a call dwRenderer_renderData3D() or dwRenderer_renderData2D() More...
 

Data Structure Documentation

◆ dwRenderBufferVertexLayout

struct dwRenderBufferVertexLayout
Data Fields
dwRenderBufferFormat colFormat

format of the color data

dwRenderBufferColorSemantic colSemantic

description of the color data

dwRenderBufferFormat posFormat

format of the position data

dwRenderBufferPositionSemantic posSemantic

description of the color data

dwRenderBufferFormat texFormat

format of the texture coordinates data

dwRenderBufferTexSemantic texSemantic

description of the color data

Typedef Documentation

◆ dwConstRenderBufferHandle_t

typedef const struct dwRenderBufferObject* dwConstRenderBufferHandle_t

Const handle representing vertex data for rendering.

Definition at line 164 of file Renderer.h.

◆ dwConstRendererHandle_t

typedef const struct dwRendererObject* dwConstRendererHandle_t

Const handle for the renderer.

Definition at line 170 of file Renderer.h.

◆ dwRenderBufferHandle_t

typedef struct dwRenderBufferObject* dwRenderBufferHandle_t

Handle representing vertex data for rendering.

Definition at line 161 of file Renderer.h.

◆ dwRendererHandle_t

typedef struct dwRendererObject* dwRendererHandle_t

Handle for the renderer.

Definition at line 167 of file Renderer.h.

Enumeration Type Documentation

◆ dwRenderBufferColorSemantic

Vertex component semantics.

Enumerator
DW_RENDER_SEMANTIC_COL_NULL 
DW_RENDER_SEMANTIC_COL_R 
DW_RENDER_SEMANTIC_COL_A 
DW_RENDER_SEMANTIC_COL_RGB 
DW_RENDER_SEMANTIC_COL_RGBA 
DW_RENDER_SEMANTIC_COL_LUT 
DW_RENDER_SEMANTIC_COL_HUE 

Definition at line 120 of file Renderer.h.

◆ dwRenderBufferFormat

Vertex component channel count and format.

Enumerator
DW_RENDER_FORMAT_NULL 
DW_RENDER_FORMAT_R32G32B32A32_FLOAT 
DW_RENDER_FORMAT_R32G32B32_FLOAT 
DW_RENDER_FORMAT_R32G32_FLOAT 
DW_RENDER_FORMAT_R32_FLOAT 

Definition at line 101 of file Renderer.h.

◆ dwRenderBufferPositionSemantic

Vertex component semantics.

Origin of POS_XY coordinates is top-left.

Enumerator
DW_RENDER_SEMANTIC_POS_NULL 
DW_RENDER_SEMANTIC_POS_XY 
DW_RENDER_SEMANTIC_POS_XYZ 

Definition at line 113 of file Renderer.h.

◆ dwRenderBufferPrimitiveType

Render primitives supported by the renderer.

Enumerator
DW_RENDER_PRIM_POINTLIST 
DW_RENDER_PRIM_LINELIST 
DW_RENDER_PRIM_TRIANGLELIST 
DW_RENDER_PRIM_LINESTRIP 
DW_RENDER_PRIM_LINELOOP 

Definition at line 149 of file Renderer.h.

◆ dwRenderBufferTexSemantic

Vertex component semantics.

Enumerator
DW_RENDER_SEMANTIC_TEX_NULL 
DW_RENDER_SEMANTIC_TEX_S 
DW_RENDER_SEMANTIC_TEX_ST 

Definition at line 132 of file Renderer.h.

◆ dwRendererFonts

Font types and sizes supported by the renderer.

Enumerator
DW_RENDER_FONT_VERDANA_8 
DW_RENDER_FONT_VERDANA_12 
DW_RENDER_FONT_VERDANA_16 
DW_RENDER_FONT_VERDANA_20 
DW_RENDER_FONT_VERDANA_24 
DW_RENDER_FONT_VERDANA_32 
DW_RENDER_FONT_VERDANA_48 
DW_RENDER_FONT_VERDANA_64 
DW_RENDER_FONT_COUNT 

Definition at line 87 of file Renderer.h.

Function Documentation

◆ dwRenderBuffer_createView()

DW_API_PUBLIC dwStatus dwRenderBuffer_createView ( uint32_t *  slot,
dwRenderBufferHandle_t  renderbuffer,
const dwRenderBufferVertexLayout  newLayout,
const dwRenderBufferPrimitiveType  newPrimType,
dwContextHandle_t  context 
)

Creates an additional view for a render buffer, allowing you to change layout and primitive type, but not vertex stride.

Note
This method performs allocations on the heap.
Parameters
[out]slotA pointer to the slot this view is allocated in. Slot 0 is the default view.
[in]renderbufferSpecifies the RenderBuffer with the data.
[in]newLayoutSpecifies the new size of a vertex.
[in]newPrimTypeSpecifies how many vertices are in a primitive.
[in]contextSpecifies a handle to the context under which it is created.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS, DW_FAILURE

◆ dwRenderBuffer_initialize()

DW_API_PUBLIC dwStatus dwRenderBuffer_initialize ( dwRenderBufferHandle_t renderbuffer,
const dwRenderBufferVertexLayout  layout,
const dwRenderBufferPrimitiveType  primType,
const uint32_t  primCount,
dwContextHandle_t  context 
)

Initializes a RenderBuffer structure for rendering.

It must be initialized on a thread with a valid current OpenGL context. This call creates data both on the heap and on the GPU.

Parameters
[out]renderbufferA pointer to an initialized render buffer object.
[in]layoutSpecifies the stride of a vertex.
[in]primTypeSpecifies how many vertices are in a primitive.
[in]primCountSpecifies how many primitives the buffer should contain.
[in]contextSpecifies a handle to the context under which it is created.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderBuffer_map()

DW_API_PUBLIC dwStatus dwRenderBuffer_map ( float32_t **  map,
uint32_t *  maxVertices,
uint32_t *  vertexStride,
dwRenderBufferHandle_t  renderbuffer 
)

Maps the CPU copy of a RenderBuffer to the application for updating.

The pointer provided is only valid until the corresponding unmap call. The application can overwrite any portion of the buffer. Note that the number of valid vertices in the buffer is updated to nVerts in unmap. This is a lightweight call. Mapping a currently mapped RenderBuffer returns an error.

Parameters
[out]mapA pointer to the CPU side of the RenderBuffer data.
[out]maxVerticesA pointer to the maximum number of vertices in the allocated data.
[out]vertexStrideA pointer to the size (in float32_t) of a vertex.
[in]renderbufferSpecifies the RenderBuffer being mapped to the CPU.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS, DW_FAILURE

◆ dwRenderBuffer_mapRange()

DW_API_PUBLIC dwStatus dwRenderBuffer_mapRange ( float32_t **  map,
uint32_t *  maxVertices,
uint32_t *  vertexStride,
const uint32_t  startVertex,
dwRenderBufferHandle_t  renderbuffer 
)

Maps a contiguous range of the CPU copy of a RenderBuffer to the application for updating.

The pointer provided is only valid until the corresponding unmap call. The application can overwrite parts or the entirety of the specified range. This is a lightweight call. Mapping a currently mapped RenderBuffer returns an error. The vertices before startVertex must be valid.

Parameters
[out]mapA pointer to the CPU side of the RenderBuffer data.
[out]maxVerticesA pointer to the maximum number of vertices that can be mapped.
[out]vertexStrideA pointer to the size (in floats) of a vertex.
[in]startVertexSpecifies the first vertex to map. This corresponds to map[0].
[in]renderbufferSpecifies the RenderBuffer being mapped to the CPU.
Returns
DW_CALL_NOT_ALLOWED, DW_SUCCESS

◆ dwRenderBuffer_release()

DW_API_PUBLIC dwStatus dwRenderBuffer_release ( dwRenderBufferHandle_t renderbuffer)

Releases the RenderBuffer data structure.

It frees both the CPU and GPU memory allocated during the initialization call. The RenderBuffer is assigned a NULL value.

Parameters
[out]renderbufferA pointer to the RenderBuffer to be released.
Returns
DW_CALL_NOT_ALLOWED, DW_SUCCESS

◆ dwRenderBuffer_set2DCoordNormalizationFactors()

DW_API_PUBLIC dwStatus dwRenderBuffer_set2DCoordNormalizationFactors ( const float32_t  width,
const float32_t  height,
dwRenderBufferHandle_t  renderbuffer 
)

Sets 2D normalization values when 2D coordinates are specified in pixel values and not in 0..1 range.

To reset to normalized values, set values to 1.0.

Parameters
[in]widthSpecifies the pixels to scale the X coordinate with.
[in]heightSpecifies the pixels to scale the Y coordinate with.
[in]renderbufferSpecifies the RenderBuffer to be released.
Returns
DW_INVALID_HANDLE, DW_SUCCESS

◆ dwRenderBuffer_unmap()

DW_API_PUBLIC dwStatus dwRenderBuffer_unmap ( uint32_t  nVerts,
dwRenderBufferHandle_t  renderbuffer 
)

After a map/mapRange, returns the updated buffer to the RenderBuffer structure and updates the GPU portion.

Since a host to device copy is required, this method is not lightweight. If the GPU buffer is in use, this can incur an extra cost. If the provided RenderBuffer has not been mapped, it returns an error.

Parameters
[in]nVertsSpecifies how many vertices have been updated. Assumes a contiguous update from the origin to nVerts. map: Current number of valid vertices in buffer is updated to nVerts. mapRange: Current number of valid vertices extended if necessary, but not reduced.
[in]renderbufferSpecifies the RenderBuffer being mapped to the CPU.
Returns
DW_INVALID_HANDLE, DW_SUCCESS, DW_CALL_NOT_ALLOWED

◆ dwRenderer_get2DTransform()

DW_API_PUBLIC dwStatus dwRenderer_get2DTransform ( float32_t  matrix[9],
dwConstRendererHandle_t  obj 
)

Gets current 2D transformation applied when rendering to the screen.

Parameters
[out]matrixSpecifies a 3x3 matrix containing a 2D rasterization transform applied during rendering.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getColor()

DW_API_PUBLIC dwStatus dwRenderer_getColor ( float32_t  color[4],
dwConstRendererHandle_t  obj 
)

Gets current rendering color.

Parameters
[out]colorSpecifies a float[4] vector in 0..1 range.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getColorMapScale()

DW_API_PUBLIC dwStatus dwRenderer_getColorMapScale ( float32_t  colorMapScale[3],
dwConstRendererHandle_t  obj 
)

Gets current rendering color map scale.

Parameters
[out]colorMapScaleSpecifies a scale factor via float32_t[3] in meters for the saturation range. colorScale[0], colorScale[1] and colorScale[2] to x, y, z respectively. E.g. {150, 150, std::numeric_limits<double>::infinity()} indicates the color will wrap after 150 meters in the x,y plane (z component is ignored).
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getFont()

DW_API_PUBLIC dwStatus dwRenderer_getFont ( dwRendererFonts value,
dwConstRendererHandle_t  obj 
)

Gets current font.

Parameters
[out]valueSpecifies the active valid font.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getLineWidth()

DW_API_PUBLIC dwStatus dwRenderer_getLineWidth ( float32_t value,
dwConstRendererHandle_t  obj 
)

Gets current line width, in pixels.

Parameters
[out]valueSpecifies the width of a line, in pixels.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getModelView()

DW_API_PUBLIC dwStatus dwRenderer_getModelView ( float32_t  matrix[16],
dwConstRendererHandle_t  obj 
)

Gets current ModelView matrix.

Parameters
[out]matrixSpecifies a 4D homogeneous matrix as float[16] col major.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getPointSize()

DW_API_PUBLIC dwStatus dwRenderer_getPointSize ( float32_t value,
dwConstRendererHandle_t  obj 
)

Gets current point size.

Parameters
[out]valueSpecifies the size of a point, in pixels.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getProjection()

DW_API_PUBLIC dwStatus dwRenderer_getProjection ( float32_t  matrix[16],
dwConstRendererHandle_t  obj 
)

Gets current projection matrix.

Parameters
[out]matrixSpecifies a 4D homogeneous matrix as float[16] col major
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getRect()

DW_API_PUBLIC dwStatus dwRenderer_getRect ( dwRect rect,
dwConstRendererHandle_t  obj 
)

Gets current rendering screen area expressed in pixel values.

Parameters
[out]rectA pointer to a structure containing the current react area.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_initialize()

DW_API_PUBLIC dwStatus dwRenderer_initialize ( dwRendererHandle_t renderer,
dwContextHandle_t  context 
)

Initializes a Renderer.

This initialization implies creation of various graphics resources including shaders, vertex data, and textures. It must be initialized on a thread with a valid current OpenGL context. While multiple renderers may coexist, resources among them are not shared.

Parameters
[out]rendererA pointer to an initialized renderer object.
[in]contextSpecifies a handle to the context under which it is created.
Returns
DW_INVALID_ARGUMENT, DW_FAILURE, DW_SUCCESS

◆ dwRenderer_release()

DW_API_PUBLIC dwStatus dwRenderer_release ( dwRendererHandle_t renderer)

Released the renderer.

This call frees all GPU resources. The handle points to NULL on success.

Parameters
[in]rendererA pointer to the Renderer object to be released.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_renderBuffer()

DW_API_PUBLIC dwStatus dwRenderer_renderBuffer ( dwConstRenderBufferHandle_t  buffer,
dwRendererHandle_t  obj 
)

Renders a RenderBuffer.

Parameters
[in]bufferSpecifies the buffer to render.
[in]objSpecifies a handle to the renderer object.
Returns
DW_SUCCESS

◆ dwRenderer_renderCircle()

DW_API_PUBLIC dwStatus dwRenderer_renderCircle ( dwVector2f  center,
float32_t  radius,
dwRendererHandle_t  obj 
)

Renders a 2D circle.

Parameters
[in]centerCenter of circle.
[in]radiusRadius of circle.
[in]objSpecifies a handle to the renderer object.
Returns
DW_SUCCESS

◆ dwRenderer_renderData2D()

DW_API_PUBLIC dwStatus dwRenderer_renderData2D ( const dwVector2f buffer,
size_t  count,
dwRenderBufferPrimitiveType  primitiveType,
dwRendererHandle_t  obj 
)

Renders a set of 2D vertices.

This is equivalent to rendering a RenderBuffer with only xy positions. No 2d normalization factors are used.

Parameters
[in]bufferSpecifies the vertices to render. Vertices are in opengl [-1..+1] range.
[in]countNumber of vertices.
[in]primitiveTypeGL primitive type.
[in]objSpecifies a handle to the renderer object.
Returns
DW_SUCCESS

◆ dwRenderer_renderData3D()

DW_API_PUBLIC dwStatus dwRenderer_renderData3D ( const dwVector3f buffer,
size_t  count,
dwRenderBufferPrimitiveType  primitiveType,
dwRendererHandle_t  obj 
)

Renders a set of 3D vertices.

This is equivalent to rendering a RenderBuffer with only xyz positions.

Parameters
[in]bufferSpecifies the buffer to render. The active projection matrix determines the expected range of the vertices.
[in]countNumber of vertices.
[in]primitiveTypeGL primitive type.
[in]objSpecifies a handle to the renderer object.
Returns
DW_SUCCESS

◆ dwRenderer_renderSubTexture()

DW_API_PUBLIC dwStatus dwRenderer_renderSubTexture ( const GLuint  inputTexture,
const GLenum  textureTarget,
const float32_t  minx,
const float32_t  miny,
const float32_t  maxx,
const float32_t  maxy,
dwRendererHandle_t  obj 
)

Renders a subrect of a textured quad on the screen.

If this texture comes from an external device such as a camera, then use GL_TEXTURE_EXTERNAL_OES as the format instead of a regular GL_TEXTURE_2D for the rest.

Parameters
[in]inputTextureSpecifies the GL texture ID to render.
[in]textureTargetSpecifies the GL texture type. Only GL_TEXTURE_2D and GL_TEXTURE_EXTERNAL_OES are supported.
[in]minxSpecifies the smallest value of the x coordinate in 0..1 range.
[in]minySpecifies the smallest value of the y coordinate in 0..1 range.
[in]maxxSpecifies the largest value of the x coordinate in 0..1 range.
[in]maxySpecifies the largest value of the y coordinate in 0..1 range.
[in]objSpecifies a handle to renderer object.
Returns
DW_SUCCESS

◆ dwRenderer_renderText()

DW_API_PUBLIC dwStatus dwRenderer_renderText ( const int32_t  x,
const int32_t  y,
const char *  text,
dwRendererHandle_t  obj 
)

Renders a text line on the screen.

Parameters
[in]xSpecifies the coordinate of the start of the string, in pixel values.
[in]ySpecifies the coordinate of the start of the string, in pixel values.
[in]textSpecifies the text to render.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_renderTextNorm()

DW_API_PUBLIC dwStatus dwRenderer_renderTextNorm ( const float32_t  normX,
const float32_t  normY,
const char *  text,
dwRendererHandle_t  obj 
)

Renders a text line on the screen.

Parameters
[in]normXSpecifies the x coordinate of the start of the string, in 0..1 range.
[in]normYSpecifies the y coordinate of the start of the string, in 0..1 range.
[in]textSpecifies the text to render.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_renderTexture()

DW_API_PUBLIC dwStatus dwRenderer_renderTexture ( const GLuint  inputTexture,
const GLenum  textureTarget,
dwRendererHandle_t  obj 
)

Renders a textured quad on the screen.

If this texture comes from an external device such as a camera, then use GL_TEXTURE_EXTERNAL_OES as format instead of a regular GL_TEXTURE_2D for the rest.

Parameters
[in]inputTextureSpecifies the GL texture ID to render.
[in]textureTargetSpecifies the GL texture type. Only GL_TEXTURE_2D and GL_TEXTURE_EXTERNAL_OES are supported.
[in]objSpecifies a handle to the renderer object.
Returns
DW_SUCCESS

◆ dwRenderer_reset()

DW_API_PUBLIC dwStatus dwRenderer_reset ( dwRendererHandle_t  renderer)

Resets renderer state.

THis is a Lightweight call that does not destroy or create resources.

Parameters
[in]rendererA pointer to Renderer object to be reset.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_set2DTransform()

DW_API_PUBLIC dwStatus dwRenderer_set2DTransform ( const float32_t  matrix[9],
dwRendererHandle_t  obj 
)

Sets current 2D transformation applied when rendering to the screen.

Parameters
[in]matrixSpecifies the 3x3 matrix containing the 2D rasterization applied to the data being rendered.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_setColor()

DW_API_PUBLIC dwStatus dwRenderer_setColor ( const float32_t  color[4],
dwRendererHandle_t  obj 
)

Sets current rendering color.

Parameters
[in]colorSpecifies the color as float[4] values in 0..1 range.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_setColorMapScale()

DW_API_PUBLIC dwStatus dwRenderer_setColorMapScale ( const float32_t  colorMapScale[3],
dwRendererHandle_t  obj 
)

Sets current rendering color mapping scale.

Parameters
[in]colorMapScaleSpecifies a scale factor via float32_t[3] in meters for the saturation range.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS
Note
colorScale[0], colorScale[1] and colorScale[2] to x, y, z respectively. E.g. colorMapScale = {150, 150, std::numeric_limits<double>::infinity()} indicates the color will wrap after 150 meters in the x-y plane.

◆ dwRenderer_setFont()

DW_API_PUBLIC dwStatus dwRenderer_setFont ( const dwRendererFonts  value,
dwRendererHandle_t  obj 
)

Sets current font.

Parameters
[in]valueSpecifies the enum value corresponding to the desired valid font.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_setLineWidth()

DW_API_PUBLIC dwStatus dwRenderer_setLineWidth ( const float32_t  value,
dwRendererHandle_t  obj 
)

Sets current line width, in pixels.

Parameters
[in]valueSpecifies the float value representing the width of a line, in pixels.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_setModelView()

DW_API_PUBLIC dwStatus dwRenderer_setModelView ( const float32_t  matrix[16],
dwRendererHandle_t  obj 
)

Sets current ModelView matrix.

Parameters
[in]matrixSpecifies the 4D homogeneous matrix as float[16] col major. OpenGL ModelView matrix.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_setPointSize()

DW_API_PUBLIC dwStatus dwRenderer_setPointSize ( const float32_t  value,
dwRendererHandle_t  obj 
)

Sets current point size.

Parameters
[in]valueSpecifies the float value representing the size of a point, in pixels.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_setProjection()

DW_API_PUBLIC dwStatus dwRenderer_setProjection ( const float32_t  matrix[16],
dwRendererHandle_t  obj 
)

Sets current projection matrix.

Parameters
[in]matrixSpecifies the 4D homogeneous matrix as float[16] col major. OpenGL projection matrix.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_setRect()

DW_API_PUBLIC dwStatus dwRenderer_setRect ( const dwRect  rect,
dwRendererHandle_t  obj 
)

Sets current rendering screen area expressed in pixel values.

Origin of rectangle coordinates is bottom-left.

Parameters
[out]rectSpecifies the structure containing the current react area.
[in]objSpecifies a handle to renderer object.
Returns
DW_SUCCESS

Variable Documentation

◆ DW_RENDER_COLORMAPSCALE_100M

const float32_t DW_RENDER_COLORMAPSCALE_100M[3] = { 100.0f, 100.0f, 100.0f}

Definition at line 81 of file Renderer.h.

◆ DW_RENDER_COLORMAPSCALE_130M

const float32_t DW_RENDER_COLORMAPSCALE_130M[3] = { 130.0f, 130.0f, 130.0f}

Definition at line 82 of file Renderer.h.

◆ DW_RENDER_COLORMAPSCALE_150M

const float32_t DW_RENDER_COLORMAPSCALE_150M[3] = { 150.0f, 150.0f, 150.0f}

Definition at line 83 of file Renderer.h.

◆ DW_RENDER_COLORMAPSCALE_75M

const float32_t DW_RENDER_COLORMAPSCALE_75M[3] = { 75.0f, 75.0f, 75.0f}

Color map scales - determine the bandwidth of the color spectum.

Definition at line 80 of file Renderer.h.

◆ DW_RENDERBUFFER_MAX_VIEWS

const uint32_t DW_RENDERBUFFER_MAX_VIEWS = 10
static

The maximal number of views that can be created in with.

See also
dwRenderBuffer_createView().

Definition at line 76 of file Renderer.h.

◆ DW_RENDERER_COLOR_BLACK

const float32_t DW_RENDERER_COLOR_BLACK[4] = { 0.0f/255.0f, 0.0f/255.0f, 0.0f/255.0f, 1.0f}

Definition at line 73 of file Renderer.h.

◆ DW_RENDERER_COLOR_BLUE

const float32_t DW_RENDERER_COLOR_BLUE[4] = { 32.0f/255.0f, 72.0f/255.0f, 230.0f/255.0f, 1.0f}

Definition at line 63 of file Renderer.h.

◆ DW_RENDERER_COLOR_DARKBLUE

const float32_t DW_RENDERER_COLOR_DARKBLUE[4] = { 45.0f/255.0f, 44.0f/255.0f, 100.0f/255.0f, 0.6f}

Definition at line 69 of file Renderer.h.

◆ DW_RENDERER_COLOR_DARKGREEN

const float32_t DW_RENDERER_COLOR_DARKGREEN[4] = { 45.0f/255.0f, 100.0f/255.0f, 44.0f/255.0f, 1.0f}

Definition at line 66 of file Renderer.h.

◆ DW_RENDERER_COLOR_DARKGREY

const float32_t DW_RENDERER_COLOR_DARKGREY[4] = { 72.0f/255.0f, 72.0f/255.0f, 72.0f/255.0f, 1.0f}

Definition at line 68 of file Renderer.h.

◆ DW_RENDERER_COLOR_DARKRED

const float32_t DW_RENDERER_COLOR_DARKRED[4] = { 180.0f/255.0f, 5.0f/255.0f, 0.0f/255.0f, 1.0f}

Definition at line 62 of file Renderer.h.

◆ DW_RENDERER_COLOR_GREEN

const float32_t DW_RENDERER_COLOR_GREEN[4] = { 32.0f/255.0f, 230.0f/255.0f, 32.0f/255.0f, 1.0f}

Definition at line 64 of file Renderer.h.

◆ DW_RENDERER_COLOR_LIGHTBLUE

const float32_t DW_RENDERER_COLOR_LIGHTBLUE[4] = { 51.0f/255.0f, 153.0f/255.0f, 255.0f/255.0f, 0.6f}

Definition at line 72 of file Renderer.h.

◆ DW_RENDERER_COLOR_LIGHTGREEN

const float32_t DW_RENDERER_COLOR_LIGHTGREEN[4] = { 118.0f/255.0f, 185.0f/255.0f, 0.0f/255.0f, 1.0f}

Definition at line 67 of file Renderer.h.

◆ DW_RENDERER_COLOR_ORANGE

const float32_t DW_RENDERER_COLOR_ORANGE[4] = { 230.0f/255.0f, 100.0f/255.0f, 10.0f/255.0f, 1.0f}

Definition at line 71 of file Renderer.h.

◆ DW_RENDERER_COLOR_RED

const float32_t DW_RENDERER_COLOR_RED[4] = { 230.0f/255.0f, 72.0f/255.0f, 32.0f/255.0f, 1.0f}

Definition at line 61 of file Renderer.h.

◆ DW_RENDERER_COLOR_WHITE

const float32_t DW_RENDERER_COLOR_WHITE[4] = { 230.0f/255.0f, 230.0f/255.0f, 230.0f/255.0f, 1.0f}

Definition at line 65 of file Renderer.h.

◆ DW_RENDERER_COLOR_YELLOW

const float32_t DW_RENDERER_COLOR_YELLOW[4] = { 230.0f/255.0f, 230.0f/255.0f, 10.0f/255.0f, 1.0f}

Definition at line 70 of file Renderer.h.

◆ DW_RENDERER_DEFAULT_BUFFER_SIZE

const uint32_t DW_RENDERER_DEFAULT_BUFFER_SIZE = 10000
static

The maximum number of vertices that can be passed to a call dwRenderer_renderData3D() or dwRenderer_renderData2D()

Definition at line 158 of file Renderer.h.