Free Electron
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
fe::ext::DrawOpenGL Class Reference

OpenGL-specific implementations for DrawI. More...

#include <DrawOpenGL.h>

Inheritance diagram for fe::ext::DrawOpenGL:
Inheritance graph
[legend]

Public Member Functions

void initialize (void)
 
virtual BWORD isDirect (void) const
 Returns TRUE is display is local and rendered directly. More...
 
virtual void flush (void)
 Called once after each frame. More...
 
virtual void pushMatrixState (void)
 Push transform matrices. More...
 
virtual void popMatrixState (void)
 Pop transform matrices. More...
 
virtual void pushMatrix (MatrixMode a_mode, Real a_values[16])
 push a new 4x4 matrix on a particular stack More...
 
virtual void popMatrix (MatrixMode a_mode)
 pop the top 4x4 matrix from a particular stack More...
 
virtual void unbindVertexArray (void)
 currently, sets vertex array to zero in OpenGL More...
 
virtual void setBrightness (Real a_brightness)
 set additive lightening More...
 
virtual void setContrast (Real a_contrast)
 set multiplicitive light scaling More...
 
virtual void setDrawMode (sp< DrawMode > spMode)
 Set rendering mode. More...
 
virtual sp< FontIfont (void)
 Get current font. More...
 
virtual Real multiplication (void)
 Select the GL-specific index/handle. More...
 
virtual void drawPoints (const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, BWORD multicolor, const Color *color, sp< DrawBufferI > spDrawBuffer)
 
virtual void drawLines (const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, StripMode strip, BWORD multicolor, const Color *color, BWORD multiradius, const Real *radius, const Vector3i *element, U32 elementCount, sp< DrawBufferI > spDrawBuffer)
 
virtual void drawTriangles (const SpatialVector *vertex, const SpatialVector *normal, const Vector2 *texture, U32 vertices, StripMode strip, BWORD multicolor, const Color *color, const Array< I32 > *vertexMap, const Array< I32 > *hullPointMap, const Array< Vector4i > *hullFacePoint, sp< DrawBufferI > spDrawBuffer)
 
virtual void drawRectangles (const SpatialVector *vertex, U32 vertices, BWORD multicolor, const Color *color)
 Draw rectangles. More...
 
virtual void drawAlignedText (const SpatialVector &location, const String text, const Color &color)
 Draw screen-aligned single color text. More...
 
virtual void drawTransformedPoints (const SpatialTransform &transform, const SpatialVector *scale, const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, BWORD multicolor, const Color *color, sp< DrawBufferI > spDrawBuffer)
 
virtual void drawTransformedLines (const SpatialTransform &transform, const SpatialVector *scale, const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, StripMode strip, BWORD multicolor, const Color *color, BWORD multiradius, const Real *radius, const Vector3i *element, U32 elementCount, sp< DrawBufferI > spDrawBuffer)
 
virtual void drawTransformedTriangles (const SpatialTransform &transform, const SpatialVector *scale, const SpatialVector *vertex, const SpatialVector *normal, const Vector2 *texture, U32 vertices, StripMode strip, BWORD multicolor, const Color *color, const Array< I32 > *vertexMap, const Array< I32 > *hullPointMap, const Array< Vector4i > *hullFacePoint, sp< DrawBufferI > spDrawBuffer)
 
virtual void drawRaster (sp< ImageI > spImageI, const SpatialVector &location)
 
virtual sp< DrawBufferIcreateBuffer (void)
 
- Public Member Functions inherited from fe::ext::DrawCommon
void initialize (void)
 
virtual sp< DrawModedrawMode (void) const
 Get rendering mode. More...
 
virtual void pushDrawMode (sp< DrawMode > mode)
 Push rendering mode onto stack. More...
 
virtual sp< DrawModepopDrawMode (void)
 Pop rendering mode from stack. More...
 
virtual Real brightness (void)
 get lightening More...
 
virtual Real contrast (void)
 get light scaling More...
 
virtual void setView (sp< ViewI > spViewI)
 Set current view. More...
 
virtual sp< ViewIview (void) const
 Get current view. More...
 
virtual void drawCurve (const SpatialVector *vertex, const SpatialVector *normal, const Real *radius, U32 vertices, BWORD multicolor, const Color *color)
 Draw one curve. More...
 
virtual void draw (cp< DrawableI > cpDrawableI, const Color *color)
 Draw DrawableI. More...
 
virtual void draw (cp< DrawableI > cpDrawableI, const Color *color, sp< DrawBufferI > spDrawBuffer)
 
virtual void drawTransformed (const SpatialTransform &transform, cp< DrawableI > cpDrawableI, const Color *color)
 
virtual void drawTransformed (const SpatialTransform &transform, cp< DrawableI > cpDrawableI, const Color *color, sp< DrawBufferI > spDrawBuffer)
 
virtual void drawBox (const Box2 &box, const Color &color)
 Draw 2D box. More...
 
virtual void drawBox (const Box2i &box, const Color &color)
 Draw 2D box with pixel adjustments. More...
 
virtual void drawBox (const Box3 &box, const Color &color)
 Draw 3D box. More...
 
virtual void drawCircle (const SpatialTransform &transform, const SpatialVector *scale, const Color &color)
 
virtual void drawSphere (const SpatialTransform &transform, const SpatialVector *scale, const Color &color)
 
virtual void drawCylinder (const SpatialTransform &transform, const SpatialVector *scale, Real baseScale, const Color &color, U32 slices)
 Draw a transformed cylinder or cone. More...
 
virtual void drawCylinder (const SpatialVector &location1, const SpatialVector &location2, Real radius1, Real radius2, const Color &color, U32 slices)
 
virtual void drawCylinders (const SpatialTransform *transform, const SpatialVector *scale, const Real *baseScale, const U32 *slices, U32 cylinders, BWORD multicolor, const Color *color)
 
virtual void drawTransformedCylinders (const SpatialTransform &pretransform, const SpatialTransform *transform, const SpatialVector *scale, const Real *baseScale, const U32 *slices, U32 cylinders, BWORD multicolor, const Color *color)
 
virtual void drawArc (const SpatialTransform &transform, const SpatialVector *scale, Real startangle, Real endangle, const Color &color)
 
virtual void drawTransformedPoints (const SpatialTransform &transform, const SpatialVector *scale, const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, BWORD multicolor, const Color *color)
 
virtual void drawTransformedLines (const SpatialTransform &transform, const SpatialVector *scale, const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, StripMode strip, BWORD multicolor, const Color *color)
 
virtual void drawTransformedCurve (const SpatialTransform &transform, const SpatialVector *scale, const SpatialVector *vertex, const SpatialVector *normal, const Real *radius, U32 vertices, BWORD multicolor, const Color *color)
 
virtual void drawTransformedTriangles (const SpatialTransform &transform, const SpatialVector *scale, const SpatialVector *vertex, const SpatialVector *normal, const Vector2 *texture, U32 vertices, StripMode strip, BWORD multicolor, const Color *color)
 
virtual void drawTransformedBox (const SpatialTransform &transform, const Box3 &box, const Color &color)
 
virtual void drawTransformedBoxes (const SpatialTransform *transform, const SpatialVector *scale, U32 boxes, BWORD multicolor, const Color *color)
 
virtual void drawAxes (Real scale)
 
virtual void drawTransformedAxes (const SpatialTransform &transform, Real scale)
 
virtual void drawMarker (Real radius, const Color &color)
 
virtual void drawTransformedMarker (const SpatialTransform &transform, Real radius, const Color &color)
 
virtual void setDrawChain (sp< DrawI > a_spDrawI)
 Set next DrawI in a chain. More...
 
virtual sp< DrawIdrawChain (void)
 
virtual void setTransform (const SpatialTransform &a_rTransform)
 Impose a spatial translation. More...
 
virtual void flushLive (void)
 Pass on current input data as is. More...
 
virtual void clearInput (void)
 Reset the current input queue. More...
 
virtual BWORD empty (void) const
 Returns TRUE if the current input queue is empty. More...
 
virtual void drawPoints (const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, BWORD multicolor, const Color *color)
 Draw points vertex[vertices]. More...
 
virtual void drawLines (const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, StripMode strip, BWORD multicolor, const Color *color)
 Draw lines. More...
 
virtual void drawTriangles (const SpatialVector *vertex, const SpatialVector *normal, const Vector2 *texture, U32 vertices, StripMode strip, BWORD multicolor, const Color *color)
 Draw triangles. More...
 
- Public Member Functions inherited from fe::Initialized
void initializeAll (void)
 
void setActive (bool a_active)
 
- Public Member Functions inherited from fe::Component
const Stringname (void) const
 Return the components chosen name. More...
 
const String verboseName (void) const
 Return the annotated chosen name. More...
 
void setName (const String &name)
 Rename the component to anything you want. More...
 
hp< Registryregistry (void) const
 Get the Registry that created this component. More...
 
void adjoin (sp< Component > spComponent)
 Tie this component's lifetime to another. More...
 
sp< Componentcreate (const String &implementation, BWORD quiet=FALSE) const
 Convienience function to registry()->create() More...
 
void disjoin (void)
 Untie component from Hub, if connected. More...
 
String factoryName (void)
 
void setLibrary (sp< Library > spLibrary)
 Store a reference to the library used to instantiate this component. More...
 
sp< Librarylibrary (void)
 Get the library that created the component. More...
 
void setFactoryIndex (I32 a_factoryIndex)
 Set the library's factory index. More...
 
I32 factoryIndex (void)
 Get the library's factory index. More...
 
void setSingleton (BWORD set)
 Specify whether component is a singleton. More...
 
BWORD isSingleton (void)
 Return whether component is a singleton. More...
 
virtual void acquire (void)
 Specialized reference increment. More...
 
virtual void release (void)
 Specialized reference decrement. More...
 
- Public Member Functions inherited from fe::Handled< Component >
const hp< Component > & getHandle (void) const
 Get a safe handle to this object. More...
 
- Public Member Functions inherited from fe::Protectable
virtual I32 protection (void) const
 
virtual void protect (void)
 
virtual void unprotect (void)
 
virtual Protectableclone (Protectable *pInstance=NULL)
 
- Public Member Functions inherited from fe::Counted
virtual void acquire (int &rCount)
 Increment the reference count (and get the count) More...
 
virtual void abandon (void)
 Decrement the reference count. More...
 
int count (void) const
 Return the count of references. More...
 
void setName (const String &)
 
void trackReference (void *pReference, String what)
 
void untrackReference (void *pReference)
 
void registerRegion (void *pT, U32 bytes)
 

Protected Member Functions

virtual void createDefaultView (void)
 
virtual void drawPolys (U32 grain, const SpatialVector *vertex, const SpatialVector *normal, const Vector2 *texture, U32 vertices, StripMode strip, BWORD multicolor, const Color *color, const Array< I32 > *vertexMap, const Array< I32 > *hullPointMap, const Array< Vector4i > *hullFacePoint, sp< DrawBufferI > spDrawBuffer)
 
virtual void drawLinesInternal (const SpatialVector *vertex, const SpatialVector *normal, const Vector2 *texture, U32 vertices, StripMode strip, BWORD multicolor, const Color *color, BWORD multiradius, const Real *radius, const Vector3i *element, U32 elementCount, sp< DrawBufferI > spDrawBuffer)
 
sp< Texture > createTexture (void)
 
sp< Texture > getTexture (GLsizei a_width, GLsizei a_height, GLenum a_format, GLenum a_type, const GLvoid *a_pData, I32 a_serial)
 
void assureFont (void)
 
void threadLock (void)
 
void threadUnlock (void)
 
void bindTexture (sp< ImageI > spImageI, I32 imageID)
 
void drawCylinderGLU (const SpatialTransform &transform, const SpatialVector *scale, Real baseScale, const Color &color, U32 slices)
 
void drawSphereGLU (const SpatialTransform &transform, const SpatialVector *scale, const Color &color)
 
void beginArrays (const SpatialVector *vertex, const SpatialVector *normal, const Array< I32 > *vertexMap, const Vector2 *texture, U32 vertices, BWORD multicolor, const Color *color, sp< DrawBufferI > spDrawBuffer, BWORD normals, BWORD blending)
 
void endArrays (const Array< I32 > *vertexMap, const Vector2 *texture, BWORD multicolor, const Color *color, sp< DrawBufferI > spDrawBuffer, BWORD normals)
 
void setupLights (void)
 
void createDefaultTexture (void)
 
void useDefaultTexture (void)
 
void pushAntialiasPoints (void)
 
void pushAntialiasLines (void)
 
void pushBlending (void)
 
void activateBlending (void)
 
void queryFormat (sp< ImageI > spImageI, GLenum &format, GLenum &type, GLint &components)
 
void setup (DrawMode::DrawStyle style, BWORD lit, BWORD dual, BWORD texture, BWORD frontcull, BWORD backcull, BWORD zBuffer)
 
- Protected Member Functions inherited from fe::ext::DrawCommon
DrawMode::DrawStyle drawStyle (void) const
 
sp< ImageItextureImage (void) const
 
I32 textureImageID (void) const
 
Real pointSize (void) const
 
Real lineWidth (void) const
 
BWORD antialias (void) const
 
BWORD frontfaceCulling (void) const
 
BWORD backfaceCulling (void) const
 
BWORD twoSidedLighting (void) const
 
BWORD zBuffering (void) const
 
BWORD isLit (void) const
 
BWORD isUvSpace (void) const
 
- Protected Member Functions inherited from fe::Initialized
void addInitializer (InitializeFunction function)
 
- Protected Member Functions inherited from fe::Handled< Component >
void abandonHandle (void)
 
- Protected Member Functions inherited from fe::Counted
int releaseInternal (void)
 Decrement the reference count. More...
 
void suppressReport (void)
 

Static Protected Member Functions

static void checkForError (String a_location)
 

Protected Attributes

sp< ImageIm_spCurrentTexture
 
I32 m_currentTextureId
 
Real m_multiplication
 
BWORD m_isDirect
 
BWORD m_lockThreads
 
GLUquadric * m_pQuadric
 
sp< Texture > m_spDefaultTexture
 
GLubyte m_defaultTextureData [DGL_DEFAULT_TEXTURE_SIZE][DGL_DEFAULT_TEXTURE_SIZE][3]
 
std::map< const void *, sp< Texture > > m_textureTable
 
sp< FontIm_spFont
 
- Protected Attributes inherited from fe::ext::DrawCommon
sp< ViewIm_spDefaultView
 
Real m_brightness
 
Real m_contrast
 

Additional Inherited Members

- Public Types inherited from fe::ext::DrawI
enum  StripMode {
  e_discrete,
  e_strip,
  e_fan,
  e_triple
}
 Format of vertices for tri-stripping. More...
 
enum  MatrixMode {
  e_modelview,
  e_projection,
  e_texture,
  e_color
}
 
- Static Public Member Functions inherited from fe::Counted
static String reportTracker (void)
 
static U32 trackerCount (void)
 
- Protected Types inherited from fe::Initialized
typedef void(* InitializeFunction) (Initialized *)
 

Detailed Description

OpenGL-specific implementations for DrawI.

Member Function Documentation

◆ drawAlignedText()

void fe::ext::DrawOpenGL::drawAlignedText ( const SpatialVector location,
const String  text,
const Color color 
)
virtual

Draw screen-aligned single color text.

Text is drawn at the given location, transformed and projected by the current state of the underlying graphics system.

Reimplemented from fe::ext::DrawCommon.

◆ drawRectangles()

void fe::ext::DrawOpenGL::drawRectangles ( const SpatialVector vertex,
U32  vertices,
BWORD  multicolor,
const Color color 
)
virtual

Draw rectangles.

Uses vertices and colors as explained in drawPoints.

Rectangles are never stripped.

Reimplemented from fe::ext::DrawCommon.

◆ flush()

void fe::ext::DrawOpenGL::flush ( void  )
virtual

Called once after each frame.

This shifts data access to freeze the current input buffer and prepare a new empty input buffer.

The resulting output buffer is sent on to the next DrawI interface.

Reimplemented from fe::ext::DrawCommon.

Reimplemented in fe::ext::DrawHydra.

References fe::errorString(), and fe::ext::DrawNull::view().

Referenced by fe::ext::DrawHydra::flush().

◆ font()

virtual sp<FontI> fe::ext::DrawOpenGL::font ( void  )
inlinevirtual

◆ isDirect()

virtual BWORD fe::ext::DrawOpenGL::isDirect ( void  ) const
inlinevirtual

Returns TRUE is display is local and rendered directly.

Reimplemented from fe::ext::DrawCommon.

◆ multiplication()

Real fe::ext::DrawOpenGL::multiplication ( void  )
virtual

Select the GL-specific index/handle.

An index of 0 indicates no font. upscaling preference, such as for high DPI

Reimplemented from fe::ext::DrawCommon.

◆ popMatrix()

void fe::ext::DrawOpenGL::popMatrix ( MatrixMode  a_mode)
virtual

pop the top 4x4 matrix from a particular stack

Reimplemented from fe::ext::DrawCommon.

◆ popMatrixState()

void fe::ext::DrawOpenGL::popMatrixState ( void  )
virtual

Pop transform matrices.

Reimplemented from fe::ext::DrawCommon.

◆ pushMatrix()

void fe::ext::DrawOpenGL::pushMatrix ( MatrixMode  a_mode,
Real  a_values[16] 
)
virtual

push a new 4x4 matrix on a particular stack

Reimplemented from fe::ext::DrawCommon.

◆ pushMatrixState()

void fe::ext::DrawOpenGL::pushMatrixState ( void  )
virtual

Push transform matrices.

Reimplemented from fe::ext::DrawCommon.

◆ setBrightness()

void fe::ext::DrawOpenGL::setBrightness ( Real  a_brightness)
virtual

set additive lightening

Reimplemented from fe::ext::DrawCommon.

References fe::ext::DrawCommon::setBrightness().

◆ setContrast()

void fe::ext::DrawOpenGL::setContrast ( Real  a_contrast)
virtual

set multiplicitive light scaling

Reimplemented from fe::ext::DrawCommon.

References fe::Registry::create(), fe::Component::registry(), and fe::ext::DrawCommon::setContrast().

◆ setDrawMode()

void fe::ext::DrawOpenGL::setDrawMode ( sp< DrawMode mode)
virtual

Set rendering mode.

Reimplemented from fe::ext::DrawCommon.

◆ unbindVertexArray()

void fe::ext::DrawOpenGL::unbindVertexArray ( void  )
virtual

currently, sets vertex array to zero in OpenGL

Reimplemented from fe::ext::DrawCommon.


The documentation for this class was generated from the following files: