final class SWGraphics extends java.lang.Object implements ReadbackGraphics
| Modifier and Type | Field and Description |
|---|---|
private boolean |
antialiasedShape |
private Rectangle |
clip |
private int |
clipRectIndex |
private CompositeMode |
compositeMode |
private SWContext |
context |
private static Paint |
DEFAULT_PAINT |
private static BasicStroke |
DEFAULT_STROKE |
private Ellipse2D |
ellipse2d |
private Rectangle |
finalClip |
private boolean |
hasPreCullingBits |
private Line2D |
line2d |
private RectBounds |
nodeBounds |
private Paint |
paint |
private float |
pixelScale |
private PiscesRenderer |
pr |
private RoundRectangle2D |
rect2d |
private NodePath |
renderRoot |
private BasicStroke |
stroke |
private SWPaint |
swPaint |
private SWRTTexture |
target |
private BaseTransform |
tx |
| Constructor and Description |
|---|
SWGraphics(SWRTTexture target,
SWContext context,
PiscesRenderer pr) |
| Modifier and Type | Method and Description |
|---|---|
void |
blit(RTTexture srcTex,
RTTexture dstTex,
int srcX0,
int srcY0,
int srcX1,
int srcY1,
int dstX0,
int dstY0,
int dstX1,
int dstY1) |
boolean |
canReadBack() |
void |
clear()
Clears the current
RenderTarget with transparent pixels. |
void |
clear(Color color)
Clears the current
RenderTarget with the given Color. |
void |
clearQuad(float x1,
float y1,
float x2,
float y2)
Clears the region represented by the given quad with transparent pixels.
|
void |
draw(Shape shape) |
void |
drawEllipse(float x,
float y,
float width,
float height) |
private void |
drawGlyph(FontStrike strike,
GlyphList gl,
int idx,
BaseTransform glyphTx,
boolean drawAsMasks,
float x,
float y) |
void |
drawLine(float x1,
float y1,
float x2,
float y2) |
void |
drawMappedTextureRaw(Texture tex,
float dx1,
float dy1,
float dx2,
float dy2,
float tx11,
float ty11,
float tx21,
float ty21,
float tx12,
float ty12,
float tx22,
float ty22) |
void |
drawRect(float x,
float y,
float width,
float height) |
void |
drawRoundRect(float x,
float y,
float width,
float height,
float arcw,
float arch) |
void |
drawString(GlyphList gl,
FontStrike strike,
float x,
float y,
Color selectColor,
int selectStart,
int selectEnd) |
void |
drawTexture(Texture tex,
float x,
float y,
float w,
float h) |
void |
drawTexture(Texture tex,
float dx1,
float dy1,
float dx2,
float dy2,
float sx1,
float sy1,
float sx2,
float sy2) |
private void |
drawTexture(Texture tex,
float dx1,
float dy1,
float dx2,
float dy2,
float sx1,
float sy1,
float sx2,
float sy2,
int lEdge,
int rEdge,
int tEdge,
int bEdge) |
private void |
drawTexture(Texture tex,
int imageMode,
float dx1,
float dy1,
float dx2,
float dy2,
float sx1,
float sy1,
float sx2,
float sy2,
int lEdge,
int rEdge,
int tEdge,
int bEdge) |
void |
drawTexture3SliceH(Texture tex,
float dx1,
float dy1,
float dx2,
float dy2,
float sx1,
float sy1,
float sx2,
float sy2,
float dh1,
float dh2,
float sh1,
float sh2) |
void |
drawTexture3SliceV(Texture tex,
float dx1,
float dy1,
float dx2,
float dy2,
float sx1,
float sy1,
float sx2,
float sy2,
float dv1,
float dv2,
float sv1,
float sv2) |
void |
drawTexture9Slice(Texture tex,
float dx1,
float dy1,
float dx2,
float dy2,
float sx1,
float sy1,
float sx2,
float sy2,
float dh1,
float dv1,
float dh2,
float dv2,
float sh1,
float sv1,
float sh2,
float sv2) |
void |
drawTextureRaw(Texture tex,
float dx1,
float dy1,
float dx2,
float dy2,
float tx1,
float ty1,
float tx2,
float ty2) |
void |
drawTextureVO(Texture tex,
float topopacity,
float botopacity,
float dx1,
float dy1,
float dx2,
float dy2,
float sx1,
float sy1,
float sx2,
float sy2) |
void |
fill(Shape shape) |
void |
fillEllipse(float x,
float y,
float width,
float height) |
void |
fillQuad(float x1,
float y1,
float x2,
float y2) |
void |
fillRect(float x,
float y,
float width,
float height) |
void |
fillRoundRect(float x,
float y,
float width,
float height,
float arcw,
float arch) |
Screen |
getAssociatedScreen() |
NGCamera |
getCameraNoClone() |
Rectangle |
getClipRect() |
int |
getClipRectIndex() |
Rectangle |
getClipRectNoClone() |
CompositeMode |
getCompositeMode() |
float |
getExtraAlpha() |
RectBounds |
getFinalClipNoClone() |
NGLightBase[] |
getLights() |
Paint |
getPaint() |
float |
getPixelScaleFactor() |
NodePath |
getRenderRoot() |
RenderTarget |
getRenderTarget() |
SWResourceFactory |
getResourceFactory() |
BasicStroke |
getStroke() |
BaseTransform |
getTransformNoClone() |
boolean |
hasPreCullingBits() |
boolean |
isAlphaTestShader() |
boolean |
isAntialiasedShape() |
boolean |
isDepthBuffer() |
boolean |
isDepthTest() |
boolean |
isState3D() |
private void |
paintEllipse(float x,
float y,
float width,
float height,
BasicStroke st) |
private void |
paintRoundRect(float x,
float y,
float width,
float height,
float arcw,
float arch,
BasicStroke st) |
private void |
paintShape(Shape shape,
BasicStroke st,
BaseTransform tr) |
private void |
paintShapePaintAlreadySet(Shape shape,
BasicStroke st,
BaseTransform tr) |
RTTexture |
readBack(Rectangle view) |
void |
releaseReadBackBuffer(RTTexture view) |
void |
scale(float sx,
float sy) |
void |
scale(float sx,
float sy,
float sz) |
void |
setAntialiasedShape(boolean aa) |
void |
setCamera(NGCamera camera) |
void |
setClipRect(Rectangle clipRect) |
void |
setClipRectIndex(int index) |
void |
setCompositeMode(CompositeMode mode) |
void |
setDepthBuffer(boolean depthBuffer) |
void |
setDepthTest(boolean depthTest) |
void |
setExtraAlpha(float extraAlpha) |
void |
setHasPreCullingBits(boolean hasBits) |
void |
setLights(NGLightBase[] lights) |
void |
setNodeBounds(RectBounds bounds)
Set the node bounds for any node that would like to render objects of a
different size to self.
|
void |
setPaint(Paint paint) |
void |
setPerspectiveTransform(GeneralTransform3D transform) |
void |
setPixelScaleFactor(float pixelScale) |
void |
setRenderRoot(NodePath root) |
void |
setState3D(boolean flag) |
void |
setStroke(BasicStroke stroke) |
void |
setTransform(BaseTransform xform) |
void |
setTransform(double m00,
double m10,
double m01,
double m11,
double m02,
double m12) |
void |
setTransform3D(double mxx,
double mxy,
double mxz,
double mxt,
double myx,
double myy,
double myz,
double myt,
double mzx,
double mzy,
double mzz,
double mzt) |
void |
setup3DRendering() |
void |
sync()
Synchronize, or flush, any outstanding rendering operations to the
destination in preparation for some caller potentially reusing or
disposing a resource that has been used as the source of a recently
invoked rendering operation.
|
void |
transform(BaseTransform xform) |
void |
translate(float tx,
float ty) |
void |
translate(float tx,
float ty,
float tz) |
private static final BasicStroke DEFAULT_STROKE
private static final Paint DEFAULT_PAINT
private final PiscesRenderer pr
private final SWContext context
private final SWRTTexture target
private final SWPaint swPaint
private final BaseTransform tx
private CompositeMode compositeMode
private Rectangle clip
private final Rectangle finalClip
private RectBounds nodeBounds
private int clipRectIndex
private Paint paint
private BasicStroke stroke
private Ellipse2D ellipse2d
private Line2D line2d
private RoundRectangle2D rect2d
private boolean antialiasedShape
private boolean hasPreCullingBits
private float pixelScale
private NodePath renderRoot
public SWGraphics(SWRTTexture target, SWContext context, PiscesRenderer pr)
public void setRenderRoot(NodePath root)
setRenderRoot in interface Graphicspublic NodePath getRenderRoot()
getRenderRoot in interface Graphicspublic RenderTarget getRenderTarget()
getRenderTarget in interface Graphicspublic SWResourceFactory getResourceFactory()
getResourceFactory in interface Graphicspublic Screen getAssociatedScreen()
getAssociatedScreen in interface Graphicspublic void sync()
GraphicsTexture disposal
or "return to texture cache pool" operation.public BaseTransform getTransformNoClone()
getTransformNoClone in interface Graphicspublic void setTransform(BaseTransform xform)
setTransform in interface Graphicspublic void setTransform(double m00,
double m10,
double m01,
double m11,
double m02,
double m12)
setTransform in interface Graphicspublic void setTransform3D(double mxx,
double mxy,
double mxz,
double mxt,
double myx,
double myy,
double myz,
double myt,
double mzx,
double mzy,
double mzz,
double mzt)
setTransform3D in interface Graphicspublic void transform(BaseTransform xform)
public void translate(float tx,
float ty,
float tz)
public void setPerspectiveTransform(GeneralTransform3D transform)
setPerspectiveTransform in interface Graphicspublic NGCamera getCameraNoClone()
getCameraNoClone in interface Graphicspublic void setDepthTest(boolean depthTest)
setDepthTest in interface Graphicspublic boolean isDepthTest()
isDepthTest in interface Graphicspublic void setDepthBuffer(boolean depthBuffer)
setDepthBuffer in interface Graphicspublic boolean isDepthBuffer()
isDepthBuffer in interface Graphicspublic boolean isAlphaTestShader()
isAlphaTestShader in interface Graphicspublic void setAntialiasedShape(boolean aa)
setAntialiasedShape in interface Graphicspublic boolean isAntialiasedShape()
isAntialiasedShape in interface Graphicspublic Rectangle getClipRect()
getClipRect in interface Graphicspublic Rectangle getClipRectNoClone()
getClipRectNoClone in interface Graphicspublic RectBounds getFinalClipNoClone()
getFinalClipNoClone in interface Graphicspublic void setClipRect(Rectangle clipRect)
setClipRect in interface Graphicspublic void setHasPreCullingBits(boolean hasBits)
setHasPreCullingBits in interface Graphicspublic boolean hasPreCullingBits()
hasPreCullingBits in interface Graphicspublic int getClipRectIndex()
getClipRectIndex in interface Graphicspublic void setClipRectIndex(int index)
setClipRectIndex in interface Graphicspublic float getExtraAlpha()
getExtraAlpha in interface Graphicspublic void setExtraAlpha(float extraAlpha)
setExtraAlpha in interface Graphicspublic BasicStroke getStroke()
public void setStroke(BasicStroke stroke)
public CompositeMode getCompositeMode()
getCompositeMode in interface Graphicspublic void setCompositeMode(CompositeMode mode)
setCompositeMode in interface Graphicspublic void setNodeBounds(RectBounds bounds)
GraphicssetNodeBounds in interface Graphicsbounds - should not include node transformpublic void clear()
GraphicsRenderTarget with transparent pixels.
Note that this operation is affected by the current clip rectangle,
if set. To clear the entire surface, call setClipRect(null)
prior to calling clear().
This is equivalent to calling:
clear(Color.TRANSPARENT);
public void clear(Color color)
RenderTarget with the given Color.
Note that this operation is affected by the current clip rectangle,
if set. To clear the entire surface, call setClipRect(null)
prior to calling clear().public void clearQuad(float x1,
float y1,
float x2,
float y2)
clear() methods, this
method does not attempt to clear the depth buffer.public void fillQuad(float x1,
float y1,
float x2,
float y2)
public void fillRect(float x,
float y,
float width,
float height)
public void fillRoundRect(float x,
float y,
float width,
float height,
float arcw,
float arch)
fillRoundRect in interface Graphicspublic void fillEllipse(float x,
float y,
float width,
float height)
fillEllipse in interface Graphicsprivate void paintShape(Shape shape, BasicStroke st, BaseTransform tr)
private void paintShapePaintAlreadySet(Shape shape, BasicStroke st, BaseTransform tr)
private void paintRoundRect(float x,
float y,
float width,
float height,
float arcw,
float arch,
BasicStroke st)
private void paintEllipse(float x,
float y,
float width,
float height,
BasicStroke st)
public void drawLine(float x1,
float y1,
float x2,
float y2)
public void drawRect(float x,
float y,
float width,
float height)
public void drawRoundRect(float x,
float y,
float width,
float height,
float arcw,
float arch)
drawRoundRect in interface Graphicspublic void drawEllipse(float x,
float y,
float width,
float height)
drawEllipse in interface Graphicspublic void drawString(GlyphList gl, FontStrike strike, float x, float y, Color selectColor, int selectStart, int selectEnd)
drawString in interface Graphicsprivate void drawGlyph(FontStrike strike, GlyphList gl, int idx, BaseTransform glyphTx, boolean drawAsMasks, float x, float y)
public void drawTexture(Texture tex, float x, float y, float w, float h)
drawTexture in interface Graphicspublic void drawTexture(Texture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2)
drawTexture in interface Graphicsprivate void drawTexture(Texture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2, int lEdge, int rEdge, int tEdge, int bEdge)
private void drawTexture(Texture tex, int imageMode, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2, int lEdge, int rEdge, int tEdge, int bEdge)
public void drawTexture3SliceH(Texture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2, float dh1, float dh2, float sh1, float sh2)
drawTexture3SliceH in interface Graphicspublic void drawTexture3SliceV(Texture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2, float dv1, float dv2, float sv1, float sv2)
drawTexture3SliceV in interface Graphicspublic void drawTexture9Slice(Texture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2, float dh1, float dv1, float dh2, float dv2, float sh1, float sv1, float sh2, float sv2)
drawTexture9Slice in interface Graphicspublic void drawTextureVO(Texture tex, float topopacity, float botopacity, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2)
drawTextureVO in interface Graphicspublic void drawTextureRaw(Texture tex, float dx1, float dy1, float dx2, float dy2, float tx1, float ty1, float tx2, float ty2)
drawTextureRaw in interface Graphicspublic void drawMappedTextureRaw(Texture tex, float dx1, float dy1, float dx2, float dy2, float tx11, float ty11, float tx21, float ty21, float tx12, float ty12, float tx22, float ty22)
drawMappedTextureRaw in interface Graphicspublic boolean canReadBack()
canReadBack in interface ReadbackGraphicspublic RTTexture readBack(Rectangle view)
readBack in interface ReadbackGraphicspublic void releaseReadBackBuffer(RTTexture view)
releaseReadBackBuffer in interface ReadbackGraphicspublic void setState3D(boolean flag)
setState3D in interface Graphicspublic void setup3DRendering()
setup3DRendering in interface Graphicspublic void setPixelScaleFactor(float pixelScale)
setPixelScaleFactor in interface Graphicspublic float getPixelScaleFactor()
getPixelScaleFactor in interface Graphicspublic void setLights(NGLightBase[] lights)
public NGLightBase[] getLights()