7 #ifndef __draw_DrawCached_h__ 8 #define __draw_DrawCached_h__ 10 #define DCH_MAX_VERTS 512 36 Color m_pColor[DCH_MAX_VERTS];
37 Real m_pRadius[DCH_MAX_VERTS];
38 Vector2 m_pTexture[DCH_MAX_VERTS];
41 U32 m_pFiller[DCH_MAX_VERTS];
49 Real m_pBaseScale[DCH_MAX_VERTS];
50 U32 m_pSlices[DCH_MAX_VERTS];
53 class FE_DL_EXPORT Command
75 m_projection(ViewI::e_current),
76 m_instruction(e_null),
77 m_stripMode(DrawI::e_discrete),
89 m_pVertex=m_localBuffer.m_pVertex;
90 m_pNormal=m_localBuffer.m_pNormal;
91 m_pColor=m_localBuffer.m_pColor;
92 m_pTexture=m_localBuffer.m_pTexture;
93 m_pElement=m_localBuffer.m_pElement;
96 Command(
const Command& rCommand)
97 { operator=(rCommand); }
99 Command& operator=(
const Command& rCommand);
101 I32 layer(
void)
const 102 {
return m_spDrawMode.isValid()?
103 m_spDrawMode->layer(): -1; }
113 ViewI::Projection m_projection;
114 Instruction m_instruction;
132 Buffer m_localBuffer;
135 class CommandQueue:
public Array<Command>
144 Command& access(U32 index)
160 void initialize(
void);
162 virtual void flush(
void);
163 virtual void flushLive(
void);
164 virtual void clearInput(
void);
165 virtual BWORD empty(
void)
const;
168 {
return m_spDrawChain.isValid() &&
169 m_spDrawChain->isDirect(); }
173 return m_spDrawChain->font(); }
186 {
if(!prepareChain())
return Real(1);
187 return m_spDrawChain->multiplication(); }
193 BWORD multicolor,
const Color *color,
201 BWORD multicolor,
const Color *color,
202 BWORD multiradius,
const Real *radius,
203 const Vector3i *element,U32 elementCount,
210 const Vector2 *texture,U32 vertices,
218 virtual void drawRectangles(
const SpatialVector *vertex,U32 vertices,
219 BWORD multicolor,
const Color *color);
228 Real baseScale,
const Color &color,U32 slices);
231 const U32* slices,U32 cylinders,
232 BWORD multicolor,
const Color* color);
239 using DrawCommon::drawTransformed;
249 {
return m_spDrawChain.isValid()?
250 m_spDrawChain->createBuffer():
257 { m_spDrawChain=a_spDrawI; }
259 {
return m_spDrawChain; }
263 BWORD prepareChain(
void);
264 void drawOutput(U32 queue,BWORD a_clearQueue);
265 void clearCameraMap(
void);
274 void drawGeometry(Command::Instruction instruction,
278 const Real* auxReal,
const U32* auxU32,
280 BWORD multicolor,
const Color *color,
281 BWORD multiradius,
const Real *radius,
285 const Vector3i *element,U32 elementCount,
288 void adoptView(DrawCached::Command& rCommand,
291 U32 m_grain[Command::e_max];
292 U32 m_oversize[Command::e_max];
294 CommandQueue* m_pCommandQueue;
virtual void drawPoints(const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, BWORD multicolor, const Color *color)
Draw points vertex[vertices].
Definition: DrawCommon.cc:222
Drawing functions not specific to the graphics language.
Definition: DrawCommon.h:32
kernel
Definition: namespace.dox:3
StripMode
Format of vertices for tri-stripping.
Definition: DrawI.h:26
virtual void drawTriangles(const SpatialVector *vertex, const SpatialVector *normal, const Vector2 *texture, U32 vertices, StripMode strip, BWORD multicolor, const Color *color)
Draw triangles.
Definition: DrawCommon.cc:257
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
virtual BWORD isDirect(void) const
Returns TRUE is display is local and rendered directly.
Definition: DrawCached.h:167
virtual void draw(cp< DrawableI > cpDrawableI, const Color *color)
Draw DrawableI.
Definition: DrawCommon.cc:84
Special vector for color (RGBA)
Definition: Color.h:21
Delayed rendering to another DrawI, presumably an immediate one.
Definition: DrawCached.h:25
virtual void drawCylinder(const SpatialTransform &transform, const SpatialVector *scale, Real baseScale, const Color &color, U32 slices)
Draw a transformed cylinder or cone.
Definition: DrawCommon.cc:792
Automatically reference-counted string container.
Definition: String.h:128
virtual void drawLines(const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, StripMode strip, BWORD multicolor, const Color *color)
Draw lines.
Definition: DrawCommon.cc:238
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Copy-On-Write shared pointer.
Definition: Protectable.h:93
virtual sp< FontI > font(void)
Get current font.
Definition: DrawCached.h:171
virtual Real multiplication(void)
Select the GL-specific index/handle.
Definition: DrawCached.h:185
virtual void setDrawChain(sp< DrawI > a_spDrawI)
Set next DrawI in a chain.
Definition: DrawCached.h:256