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 Graphics
public NodePath getRenderRoot()
getRenderRoot
in interface Graphics
public RenderTarget getRenderTarget()
getRenderTarget
in interface Graphics
public SWResourceFactory getResourceFactory()
getResourceFactory
in interface Graphics
public Screen getAssociatedScreen()
getAssociatedScreen
in interface Graphics
public void sync()
Graphics
Texture
disposal
or "return to texture cache pool" operation.public BaseTransform getTransformNoClone()
getTransformNoClone
in interface Graphics
public void setTransform(BaseTransform xform)
setTransform
in interface Graphics
public void setTransform(double m00, double m10, double m01, double m11, double m02, double m12)
setTransform
in interface Graphics
public 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 Graphics
public void transform(BaseTransform xform)
public void translate(float tx, float ty, float tz)
public void setPerspectiveTransform(GeneralTransform3D transform)
setPerspectiveTransform
in interface Graphics
public NGCamera getCameraNoClone()
getCameraNoClone
in interface Graphics
public void setDepthTest(boolean depthTest)
setDepthTest
in interface Graphics
public boolean isDepthTest()
isDepthTest
in interface Graphics
public void setDepthBuffer(boolean depthBuffer)
setDepthBuffer
in interface Graphics
public boolean isDepthBuffer()
isDepthBuffer
in interface Graphics
public boolean isAlphaTestShader()
isAlphaTestShader
in interface Graphics
public void setAntialiasedShape(boolean aa)
setAntialiasedShape
in interface Graphics
public boolean isAntialiasedShape()
isAntialiasedShape
in interface Graphics
public Rectangle getClipRect()
getClipRect
in interface Graphics
public Rectangle getClipRectNoClone()
getClipRectNoClone
in interface Graphics
public RectBounds getFinalClipNoClone()
getFinalClipNoClone
in interface Graphics
public void setClipRect(Rectangle clipRect)
setClipRect
in interface Graphics
public void setHasPreCullingBits(boolean hasBits)
setHasPreCullingBits
in interface Graphics
public boolean hasPreCullingBits()
hasPreCullingBits
in interface Graphics
public int getClipRectIndex()
getClipRectIndex
in interface Graphics
public void setClipRectIndex(int index)
setClipRectIndex
in interface Graphics
public float getExtraAlpha()
getExtraAlpha
in interface Graphics
public void setExtraAlpha(float extraAlpha)
setExtraAlpha
in interface Graphics
public BasicStroke getStroke()
public void setStroke(BasicStroke stroke)
public CompositeMode getCompositeMode()
getCompositeMode
in interface Graphics
public void setCompositeMode(CompositeMode mode)
setCompositeMode
in interface Graphics
public void setNodeBounds(RectBounds bounds)
Graphics
setNodeBounds
in interface Graphics
bounds
- should not include node transformpublic void clear()
Graphics
RenderTarget
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 Graphics
public void fillEllipse(float x, float y, float width, float height)
fillEllipse
in interface Graphics
private 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 Graphics
public void drawEllipse(float x, float y, float width, float height)
drawEllipse
in interface Graphics
public void drawString(GlyphList gl, FontStrike strike, float x, float y, Color selectColor, int selectStart, int selectEnd)
drawString
in interface Graphics
private 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 Graphics
public void drawTexture(Texture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2)
drawTexture
in interface Graphics
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)
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 Graphics
public 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 Graphics
public 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 Graphics
public 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 Graphics
public void drawTextureRaw(Texture tex, float dx1, float dy1, float dx2, float dy2, float tx1, float ty1, float tx2, float ty2)
drawTextureRaw
in interface Graphics
public 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 Graphics
public boolean canReadBack()
canReadBack
in interface ReadbackGraphics
public RTTexture readBack(Rectangle view)
readBack
in interface ReadbackGraphics
public void releaseReadBackBuffer(RTTexture view)
releaseReadBackBuffer
in interface ReadbackGraphics
public void setState3D(boolean flag)
setState3D
in interface Graphics
public void setup3DRendering()
setup3DRendering
in interface Graphics
public void setPixelScaleFactor(float pixelScale)
setPixelScaleFactor
in interface Graphics
public float getPixelScaleFactor()
getPixelScaleFactor
in interface Graphics
public void setLights(NGLightBase[] lights)
public NGLightBase[] getLights()