Draw3D Class Reference

[BlockOut Index] [BlockOut Heirarchy]


Abstract class for drawing in 3D More...

#include <Draw3D.h>

Public Members

Protected Members


Detailed Description

Abstract class for drawing in 3D. Uses no GDI dependent functions, so it must be derived for Windows/X11. Drawing of rectangles is optimized. Provides a secondary buffer for fast moving of sprites.


virtual void setForegroundColor(const Color& newColor)

Sets the foreground color for the following operations. Default is 255,255,255

virtual void setBackgroundColor(const Color& newColor)

Sets the background color for the following operations. Default is 0,0,0

void drawLine(const Position.html">Position& pos0, const Position.html">Position& pos1)

Draws a line between pos0 and pos1.

void drawLineStrip(const Position pos[], const int n)

Draws a polygon between pos[0],pos[1],..pos[n-1].

void drawPolygon(const Position pos[], const int n)

Draws a polygon between pos[0],pos[1],..pos[n-1],pos[0].

void drawRectangleZ(const Position.html">Position& p0, const Position.html">Position& p1)

Fills the rectangle between x0,y0 and y0, y1 with constant z.

void drawRectangleX(const Position.html">Position& p0, const Position.html">Position& p1)

Fills the rectangle between y0,z0 and y0,z1 with constant x.

void drawRectangleY(const Position.html">Position& p0, const Position.html">Position& p1)

Fills the rectangle between x0,z0 and x0,z1 with constant y.

virtual void saveInBuffer()

Saves all the image data since last clear in buffer.

virtual void restoreBuffer()

Restores the data saved in buffer by saveInBuffer.

virtual void startDrawing()

Drawing starts, prepare buffer and paint devices.

virtual void endDrawing()

Drawing ended. Must be called before updateDisplay.

virtual void clear()

Clears the display with backgroundColor.

virtual void updateDisplay()

Updates the display with operations since last clear.

void setPerspective(MeasureUnit _leftX, MeasureUnit _rightX, MeasureUnit _lowerY, MeasureUnit _upperY, MeasureUnit _nearZ, double _perspectiveFactor)

Sets the parameters for perspective projection.

static Draw3D *globalInstance

Points to an implemented Draw3D.

Color currentColor

Color used for following 3D operations.

Color backgroundColor

Background color.

virtual void projectTo2D(const Position *pos, int *x, int *y)

Does a projection of 3D coordinates to 2D coordinates.

virtual void drawLine2D(const int x0, const int y0, const int x1, const int y1)

Draws a line between x0,y0 and x1,y1 in current color.

virtual void drawLineStrip2D()

Draws a line between xValues2D[0],yValues2D[0]...xValues2D[size-1],yValues2D[size-1] in current color.

virtual void drawFilledPolygon2D()

Draws a polygon and fills it with currentColor. First point may be different from last point.

int maxValues

Used for effizient storing of 2D Coordiantes in path of drawXXX3D,drawLineStrip.

void maxAllocateBuffer(int n)

Checks if xValues2D and yValues2D can hold max n values, else resizes them.

nearZ

Parameters for projection of 3D coordinates to 2D coordinates,

float perspectiveFactor

0,0=lower left corner.


Documentation generated by skyhunter@Dagobah on Wed Sep 16 18:39:03 MEST 1998
Kdoc