public class RenderWindow extends Window implements RenderTarget
CLOSE, DEFAULT, FULLSCREEN, NONE, RESIZE, TITLEBAR| Constructor and Description |
|---|
RenderWindow()
Constructs a new render window without actually creating (opening) it.
|
RenderWindow(VideoMode mode,
String title)
Constructs a new render window and creates it with default style and context settings.
|
RenderWindow(VideoMode mode,
String title,
int style)
Constructs a new render window and creates it with default context settings.
|
RenderWindow(VideoMode mode,
String title,
int style,
ContextSettings settings)
Constructs a new render window and creates it with the specified parameters.
|
| Modifier and Type | Method and Description |
|---|---|
Image |
capture()
Copies the current contents of the window to an image.
|
void |
clear()
Clears the target with black.
|
void |
clear(Color color)
Clears the render target and fills it with a constant color.
|
void |
create(VideoMode mode,
String title,
int style,
ContextSettings settings)
Creates and opens a window or re-creates it if it was already opened.
|
void |
draw(Drawable drawable)
Draws a drawable object to the render target using the default render states.
|
void |
draw(Drawable drawable,
RenderStates renderStates)
Draws a drawable object to the render target using the given render states.
|
void |
draw(Vertex[] vertices,
PrimitiveType type)
Draws a primitive of the given type using the given vertices and the default render states.
|
void |
draw(Vertex[] vertices,
PrimitiveType type,
RenderStates states)
Draws a primitive of the given type using the given vertices and the given render states.
|
ConstView |
getDefaultView()
Gets the target's default view.
|
ConstView |
getView()
Gets the target's current view.
|
IntRect |
getViewport(ConstView view)
Computes the viewport of the given view applied to this render target.
|
Vector2i |
mapCoordsToPixel(Vector2f point)
Converts a point from world coordinates to target coordinates using the target's
current view.
|
Vector2i |
mapCoordsToPixel(Vector2f point,
ConstView view)
Converts a point from world coordinates to target coordinates for a certain view.
|
Vector2f |
mapPixelToCoords(Vector2i point)
Converts a point from target coordinates to world coordinates using the target's
current view.
|
Vector2f |
mapPixelToCoords(Vector2i point,
ConstView view)
Converts a point from target coordinates to world coordinates for a certain view.
|
protected long |
nativeCreate()
Deprecated.
|
protected void |
nativeDelete()
Deprecated.
|
protected void |
nativeSetExPtr()
Deprecated.
|
void |
popGLStates()
Pops the last OpenGL states and matrices from the top of the stack.
|
void |
pushGLStates()
Pushes the current OpenGL states and matrices to the stack.
|
void |
resetGLStates()
Resets the internal OpenGL states so that the target is ready for drawing.
|
void |
setView(ConstView view)
Sets the target's view.
|
close, create, create, display, getPosition, getSettings, getSize, isLegalWindowThread, isOpen, pollEvent, pollEvents, setActive, setActive, setFramerateLimit, setIcon, setJoystickTreshold, setKeyRepeatEnabled, setMouseCursorVisible, setPosition, setSize, setTitle, setVerticalSyncEnabled, setVisible, waitEventfinalizeclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSizepublic RenderWindow()
public RenderWindow(VideoMode mode, String title, int style, ContextSettings settings)
mode - the video mode to use for rendering.title - the window title.style - the window style.settings - the settings for the OpenGL context.create(org.jsfml.window.VideoMode, String, int, org.jsfml.window.ContextSettings)public RenderWindow(VideoMode mode, String title, int style)
mode - the video mode to use for rendering.title - the window title.style - the window style.Window.create(org.jsfml.window.VideoMode, String, int)@Deprecated protected long nativeCreate()
SFMLNativeObjectnativeCreate in class Window@Deprecated protected void nativeSetExPtr()
SFMLNativeObjectnativeSetExPtr in class Window@Deprecated protected void nativeDelete()
SFMLNativeObjectnativeDelete in class Windowpublic void create(VideoMode mode, String title, int style, ContextSettings settings)
Windowcreate in class Windowmode - the video mode that determines the window's size.
This must be a valid video mode in case WindowStyle.FULLSCREEN is set.title - the window title.style - the style of the window.
This should be a combination (using OR of the style flags
WindowStyle.TITLEBAR, WindowStyle.RESIZE, WindowStyle.CLOSE and
WindowStyle.FULLSCREEN, or WindowStyle.NONE for no style.
WindowStyle.DEFAULT provides a default combination of style flags.settings - the context settings for the created OpenGL context.VideoMode.isValid(),
WindowStyle,
ContextSettingspublic Image capture()
Texture.update(org.jsfml.window.Window)
or a RenderTexture instead.public void clear(Color color)
RenderTargetclear in interface RenderTargetcolor - the color to fill the target with.public void clear()
public void setView(ConstView view)
RenderTargetsetView in interface RenderTargetview - the target's new view.public ConstView getView()
RenderTargetgetView in interface RenderTargetpublic ConstView getDefaultView()
RenderTargetgetDefaultView in interface RenderTargetpublic IntRect getViewport(ConstView view)
RenderTargetgetViewport in interface RenderTargetview - the view.public final Vector2f mapPixelToCoords(Vector2i point)
RenderTargetmapPixelToCoords in interface RenderTargetpoint - the point on the render target.public Vector2f mapPixelToCoords(Vector2i point, ConstView view)
RenderTargetmapPixelToCoords in interface RenderTargetpoint - the point on the render target.view - the view to use for conversion.public final Vector2i mapCoordsToPixel(Vector2f point)
RenderTargetmapCoordsToPixel in interface RenderTargetpoint - the point in the world.public Vector2i mapCoordsToPixel(Vector2f point, ConstView view)
RenderTargetmapCoordsToPixel in interface RenderTargetpoint - the point in the world.view - the view to use for conversion.public final void draw(Drawable drawable)
RenderTargetdraw in interface RenderTargetdrawable - the object to draw.public void draw(Drawable drawable, RenderStates renderStates)
RenderTargetdraw in interface RenderTargetdrawable - the object to draw.renderStates - the render states to use for drawing.public final void draw(Vertex[] vertices, PrimitiveType type)
RenderTargetdraw in interface RenderTargetvertices - the vertices to draw.type - the type of OpenGL primitive to draw.public void draw(Vertex[] vertices, PrimitiveType type, RenderStates states)
RenderTargetdraw in interface RenderTargetvertices - the vertices to draw.type - the type of OpenGL primitive to draw.states - the render states to use for drawing.public void pushGLStates()
RenderTargetpushGLStates in interface RenderTargetpublic void popGLStates()
RenderTargetpopGLStates in interface RenderTargetpublic void resetGLStates()
RenderTargetresetGLStates in interface RenderTarget