|
|
@ -22,23 +22,23 @@ import mightypork.utils.math.timing.FpsMeter; |
|
|
|
* @author MightyPork |
|
|
|
* @author MightyPork |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract class GraphicsModule extends BackendModule { |
|
|
|
public abstract class GraphicsModule extends BackendModule { |
|
|
|
|
|
|
|
|
|
|
|
/** X axis vector */ |
|
|
|
/** X axis vector */ |
|
|
|
protected static final VectConst AXIS_X = Vect.make(1, 0, 0); |
|
|
|
protected static final VectConst AXIS_X = Vect.make(1, 0, 0); |
|
|
|
/** Y axis vector */ |
|
|
|
/** Y axis vector */ |
|
|
|
protected static final VectConst AXIS_Y = Vect.make(0, 1, 0); |
|
|
|
protected static final VectConst AXIS_Y = Vect.make(0, 1, 0); |
|
|
|
/** Z axis vector */ |
|
|
|
/** Z axis vector */ |
|
|
|
protected static final VectConst AXIS_Z = Vect.make(0, 0, 1); |
|
|
|
protected static final VectConst AXIS_Z = Vect.make(0, 0, 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set drawing color |
|
|
|
* Set drawing color |
|
|
|
* |
|
|
|
* |
|
|
|
* @param color color |
|
|
|
* @param color color |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void setColor(Color color); |
|
|
|
public abstract void setColor(Color color); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set drawing color, adjust alpha |
|
|
|
* Set drawing color, adjust alpha |
|
|
|
* |
|
|
|
* |
|
|
@ -46,8 +46,8 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @param alpha alpha multiplier |
|
|
|
* @param alpha alpha multiplier |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void setColor(Color color, double alpha); |
|
|
|
public abstract void setColor(Color color, double alpha); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Translate by x, y |
|
|
|
* Translate by x, y |
|
|
|
* |
|
|
|
* |
|
|
@ -55,8 +55,8 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @param y y offset |
|
|
|
* @param y y offset |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void translate(double x, double y); |
|
|
|
public abstract void translate(double x, double y); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Translate by x, y, z |
|
|
|
* Translate by x, y, z |
|
|
|
* |
|
|
|
* |
|
|
@ -65,24 +65,24 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @param z z offset |
|
|
|
* @param z z offset |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void translate(double x, double y, double z); |
|
|
|
public abstract void translate(double x, double y, double z); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Translate by offset vector |
|
|
|
* Translate by offset vector |
|
|
|
* |
|
|
|
* |
|
|
|
* @param offset offset coordinate |
|
|
|
* @param offset offset coordinate |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void translate(Vect offset); |
|
|
|
public abstract void translate(Vect offset); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Translate by offset vector, ignore Z |
|
|
|
* Translate by offset vector, ignore Z |
|
|
|
* |
|
|
|
* |
|
|
|
* @param offset offset coordinate |
|
|
|
* @param offset offset coordinate |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void translateXY(Vect offset); |
|
|
|
public abstract void translateXY(Vect offset); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set scale for translations and coordinates |
|
|
|
* Set scale for translations and coordinates |
|
|
|
* |
|
|
|
* |
|
|
@ -90,8 +90,8 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @param y y scale |
|
|
|
* @param y y scale |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void scale(double x, double y); |
|
|
|
public abstract void scale(double x, double y); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set scale for translations and coordinates |
|
|
|
* Set scale for translations and coordinates |
|
|
|
* |
|
|
|
* |
|
|
@ -100,72 +100,72 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @param z z scale |
|
|
|
* @param z z scale |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void scale(double x, double y, double z); |
|
|
|
public abstract void scale(double x, double y, double z); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set scale for translations and coordinates |
|
|
|
* Set scale for translations and coordinates |
|
|
|
* |
|
|
|
* |
|
|
|
* @param scale vector |
|
|
|
* @param scale vector |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void scale(Vect scale); |
|
|
|
public abstract void scale(Vect scale); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set scale for translations and coordinates (same value for X and Y scale) |
|
|
|
* Set scale for translations and coordinates (same value for X and Y scale) |
|
|
|
* |
|
|
|
* |
|
|
|
* @param scale scaling factor |
|
|
|
* @param scale scaling factor |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void scaleXY(double scale); |
|
|
|
public abstract void scaleXY(double scale); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set X scale for translations and coordinates |
|
|
|
* Set X scale for translations and coordinates |
|
|
|
* |
|
|
|
* |
|
|
|
* @param scale scaling factor |
|
|
|
* @param scale scaling factor |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void scaleX(double scale); |
|
|
|
public abstract void scaleX(double scale); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set Y scale for translations and coordinates |
|
|
|
* Set Y scale for translations and coordinates |
|
|
|
* |
|
|
|
* |
|
|
|
* @param scale scaling factor |
|
|
|
* @param scale scaling factor |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void scaleY(double scale); |
|
|
|
public abstract void scaleY(double scale); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set Z scale for translations and coordinates |
|
|
|
* Set Z scale for translations and coordinates |
|
|
|
* |
|
|
|
* |
|
|
|
* @param scale scaling factor |
|
|
|
* @param scale scaling factor |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void scaleZ(double scale); |
|
|
|
public abstract void scaleZ(double scale); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Rotate coordinate system around X axis |
|
|
|
* Rotate coordinate system around X axis |
|
|
|
* |
|
|
|
* |
|
|
|
* @param angle rotation (in degrees) |
|
|
|
* @param angle rotation (in degrees) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void rotateX(double angle); |
|
|
|
public abstract void rotateX(double angle); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Rotate coordinate system around Y axis |
|
|
|
* Rotate coordinate system around Y axis |
|
|
|
* |
|
|
|
* |
|
|
|
* @param angle rotation (in degrees) |
|
|
|
* @param angle rotation (in degrees) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void rotateY(double angle); |
|
|
|
public abstract void rotateY(double angle); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Rotate coordinate system around Z axis |
|
|
|
* Rotate coordinate system around Z axis |
|
|
|
* |
|
|
|
* |
|
|
|
* @param angle rotation (in degrees) |
|
|
|
* @param angle rotation (in degrees) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void rotateZ(double angle); |
|
|
|
public abstract void rotateZ(double angle); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Rotate coordinate system around given axis |
|
|
|
* Rotate coordinate system around given axis |
|
|
|
* |
|
|
|
* |
|
|
@ -173,54 +173,54 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @param axis rotation axis (unit vector) |
|
|
|
* @param axis rotation axis (unit vector) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void rotate(double angle, Vect axis); |
|
|
|
public abstract void rotate(double angle, Vect axis); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Store render state on stack<br> |
|
|
|
* Store render state on stack<br> |
|
|
|
* This includes pushGeometry and pushColor. |
|
|
|
* This includes pushGeometry and pushColor. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void pushState(); |
|
|
|
public abstract void pushState(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Restore state from stack (must be pushed first)<br> |
|
|
|
* Restore state from stack (must be pushed first)<br> |
|
|
|
* This includes popColor and popGeometry. |
|
|
|
* This includes popColor and popGeometry. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void popState(); |
|
|
|
public abstract void popState(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Store current rotation and translation on stack |
|
|
|
* Store current rotation and translation on stack |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void pushGeometry(); |
|
|
|
public abstract void pushGeometry(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Restore rotation and translation from stack |
|
|
|
* Restore rotation and translation from stack |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void popGeometry(); |
|
|
|
public abstract void popGeometry(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Store color on stack (so it can later be restored) |
|
|
|
* Store color on stack (so it can later be restored) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void pushColor(); |
|
|
|
public abstract void pushColor(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Restore color from stack (must be pushed first) |
|
|
|
* Restore color from stack (must be pushed first) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void popColor(); |
|
|
|
public abstract void popColor(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Render 2D quad with currently set color |
|
|
|
* Render 2D quad with currently set color |
|
|
|
* |
|
|
|
* |
|
|
|
* @param rect drawn rect |
|
|
|
* @param rect drawn rect |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void quad(Rect rect); |
|
|
|
public abstract void quad(Rect rect); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Render 2D quad with given color.<br> |
|
|
|
* Render 2D quad with given color.<br> |
|
|
|
* This may change current drawing color. |
|
|
|
* This may change current drawing color. |
|
|
@ -229,8 +229,8 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @param color draw color |
|
|
|
* @param color draw color |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void quad(Rect rect, Color color); |
|
|
|
public abstract void quad(Rect rect, Color color); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Render 2D quad with gradient.<br> |
|
|
|
* Render 2D quad with gradient.<br> |
|
|
|
* This may change current drawing color. |
|
|
|
* This may change current drawing color. |
|
|
@ -239,8 +239,8 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @param grad gradient |
|
|
|
* @param grad gradient |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void quad(Rect rect, Grad grad); |
|
|
|
public abstract void quad(Rect rect, Grad grad); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Render textured quad with current color |
|
|
|
* Render textured quad with current color |
|
|
|
* |
|
|
|
* |
|
|
@ -248,8 +248,8 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @param txquad texture quad |
|
|
|
* @param txquad texture quad |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void quad(Rect rect, TxQuad txquad); |
|
|
|
public abstract void quad(Rect rect, TxQuad txquad); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Render textured quad with given color |
|
|
|
* Render textured quad with given color |
|
|
|
* |
|
|
|
* |
|
|
@ -258,14 +258,14 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @param color color tint |
|
|
|
* @param color color tint |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void quad(Rect rect, TxQuad txquad, Color color); |
|
|
|
public abstract void quad(Rect rect, TxQuad txquad, Color color); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Setup projection for 2D graphics, using current screen size |
|
|
|
* Setup projection for 2D graphics, using current screen size |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void setupProjection(); |
|
|
|
public abstract void setupProjection(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Get backend-flavoured deferred PNG texture. |
|
|
|
* Get backend-flavoured deferred PNG texture. |
|
|
|
* |
|
|
|
* |
|
|
@ -273,8 +273,8 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @return the deferred font |
|
|
|
* @return the deferred font |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract DeferredTexture createTextureResource(String path); |
|
|
|
public abstract DeferredTexture createTextureResource(String path); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Get backend-flavoured deferred TTF font. |
|
|
|
* Get backend-flavoured deferred TTF font. |
|
|
|
* |
|
|
|
* |
|
|
@ -282,8 +282,8 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @return the deferred font |
|
|
|
* @return the deferred font |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract DeferredFont createFontResource(String path); |
|
|
|
public abstract DeferredFont createFontResource(String path); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Get backend-flavoured deferred TTF font. |
|
|
|
* Get backend-flavoured deferred TTF font. |
|
|
|
* |
|
|
|
* |
|
|
@ -298,11 +298,11 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
final DeferredFont font = createFontResource(path); |
|
|
|
final DeferredFont font = createFontResource(path); |
|
|
|
font.setChars(chars); |
|
|
|
font.setChars(chars); |
|
|
|
font.setSize(size); |
|
|
|
font.setSize(size); |
|
|
|
|
|
|
|
|
|
|
|
return font; |
|
|
|
return font; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set target fps (for syncing in endFrame() call).<br> |
|
|
|
* Set target fps (for syncing in endFrame() call).<br> |
|
|
|
* With vsync enabled, the target fps may not be met. |
|
|
|
* With vsync enabled, the target fps may not be met. |
|
|
@ -310,8 +310,8 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @param fps requested fps |
|
|
|
* @param fps requested fps |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void setTargetFps(int fps); |
|
|
|
public abstract void setTargetFps(int fps); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set fullscreen. The fullscreen state will be changed when possible (eg. |
|
|
|
* Set fullscreen. The fullscreen state will be changed when possible (eg. |
|
|
|
* at the end of the current frame) and a {@link ViewportChangeEvent} will |
|
|
|
* at the end of the current frame) and a {@link ViewportChangeEvent} will |
|
|
@ -320,14 +320,14 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @param fs true for fullscreen |
|
|
|
* @param fs true for fullscreen |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void setFullscreen(boolean fs); |
|
|
|
public abstract void setFullscreen(boolean fs); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Request fullscreen toggle. See setFullscreen() for more info) |
|
|
|
* Request fullscreen toggle. See setFullscreen() for more info) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void switchFullscreen(); |
|
|
|
public abstract void switchFullscreen(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Get fullscreen state (note that methods changing fullscreen may not have |
|
|
|
* Get fullscreen state (note that methods changing fullscreen may not have |
|
|
|
* immediate effect, so this method may report the old state if the |
|
|
|
* immediate effect, so this method may report the old state if the |
|
|
@ -336,8 +336,8 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @return is fullscreen |
|
|
|
* @return is fullscreen |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract boolean isFullscreen(); |
|
|
|
public abstract boolean isFullscreen(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Take screenshot (expensive processing should be done in separate thread |
|
|
|
* Take screenshot (expensive processing should be done in separate thread |
|
|
|
* when screenshot is saved).<br> |
|
|
|
* when screenshot is saved).<br> |
|
|
@ -346,20 +346,20 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @return screenshot object |
|
|
|
* @return screenshot object |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract Screenshot takeScreenshot(); |
|
|
|
public abstract Screenshot takeScreenshot(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Start a render frame - clear buffers, prepare rendering context etc. |
|
|
|
* Start a render frame - clear buffers, prepare rendering context etc. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void beginFrame(); |
|
|
|
public abstract void beginFrame(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* End a render frame: flip buffers, sync to fps... |
|
|
|
* End a render frame: flip buffers, sync to fps... |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void endFrame(); |
|
|
|
public abstract void endFrame(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set display dimensions |
|
|
|
* Set display dimensions |
|
|
|
* |
|
|
|
* |
|
|
@ -367,76 +367,76 @@ public abstract class GraphicsModule extends BackendModule { |
|
|
|
* @param height display height (pixels) |
|
|
|
* @param height display height (pixels) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void setSize(int width, int height); |
|
|
|
public abstract void setSize(int width, int height); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set window titlebar text |
|
|
|
* Set window titlebar text |
|
|
|
* |
|
|
|
* |
|
|
|
* @param title titlebar text |
|
|
|
* @param title titlebar text |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void setTitle(String title); |
|
|
|
public abstract void setTitle(String title); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Enable or disable VSync |
|
|
|
* Enable or disable VSync |
|
|
|
* |
|
|
|
* |
|
|
|
* @param vsync true for vsync enabled |
|
|
|
* @param vsync true for vsync enabled |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void setVSync(boolean vsync); |
|
|
|
public abstract void setVSync(boolean vsync); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set window resizable / fixed |
|
|
|
* Set window resizable / fixed |
|
|
|
* |
|
|
|
* |
|
|
|
* @param resizable true for resizable |
|
|
|
* @param resizable true for resizable |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract void setResizable(boolean resizable); |
|
|
|
public abstract void setResizable(boolean resizable); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Get screen rect. Should always return the same Rect instance. |
|
|
|
* Get screen rect. Should always return the same Rect instance. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return the rect |
|
|
|
* @return the rect |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract Rect getRect(); |
|
|
|
public abstract Rect getRect(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Get current FPS (eg. measured by a {@link FpsMeter}) |
|
|
|
* Get current FPS (eg. measured by a {@link FpsMeter}) |
|
|
|
* |
|
|
|
* |
|
|
|
* @return current FPS |
|
|
|
* @return current FPS |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract long getFps(); |
|
|
|
public abstract long getFps(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Get screen center. Should always return the same {@link Vect} instance. |
|
|
|
* Get screen center. Should always return the same {@link Vect} instance. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return screen center. |
|
|
|
* @return screen center. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract Vect getCenter(); |
|
|
|
public abstract Vect getCenter(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Get screen size. Should always return the same {@link Vect} instance. |
|
|
|
* Get screen size. Should always return the same {@link Vect} instance. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return size |
|
|
|
* @return size |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract Vect getSize(); |
|
|
|
public abstract Vect getSize(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @return screen width |
|
|
|
* @return screen width |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract int getWidth(); |
|
|
|
public abstract int getWidth(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @return screen height |
|
|
|
* @return screen height |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract int getHeight(); |
|
|
|
public abstract int getHeight(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create the display (window) based on current settings. |
|
|
|
* Create the display (window) based on current settings. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|