public abstract class GLInterface extends java.lang.Object implements IInterface
IInterface for OpenGL in Minecraft.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
clipX
Boolean indicating whether to clip in the horizontal direction.
|
| Constructor and Description |
|---|
GLInterface(boolean clipX)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
begin(boolean matrix)
Set OpenGL to the state used by the rendering methods.
|
void |
drawImage(java.awt.Rectangle r,
int rotation,
boolean parity,
int image,
java.awt.Color color)
Draw an image.
|
void |
drawLine(java.awt.Point a,
java.awt.Point b,
java.awt.Color c1,
java.awt.Color c2)
Draw a line on the screen.
|
void |
drawRect(java.awt.Rectangle r,
java.awt.Color c1,
java.awt.Color c2,
java.awt.Color c3,
java.awt.Color c4)
Draw the outline of an axis-aligned rectangle on the screen.
|
void |
drawString(java.awt.Point pos,
int height,
java.lang.String s,
java.awt.Color c)
Draw a string on the screen.
|
void |
end(boolean matrix)
Restore OpenGL to the state expected by Minecraft.
|
void |
fillRect(java.awt.Rectangle r,
java.awt.Color c1,
java.awt.Color c2,
java.awt.Color c3,
java.awt.Color c4)
Draw an axis-aligned rectangle on the screen.
|
void |
fillTriangle(java.awt.Point pos1,
java.awt.Point pos2,
java.awt.Point pos3,
java.awt.Color c1,
java.awt.Color c2,
java.awt.Color c3)
Draw a triangle on the screen.
|
int |
getFontWidth(int height,
java.lang.String s)
Get the font width of a string being rendered by
IInterface.drawString(Point, int, String, Color) |
protected abstract net.minecraft.client.util.math.MatrixStack |
getMatrixStack()
Get the matrix stack to be used.
|
protected abstract java.lang.String |
getResourcePrefix()
Get the Minecraft resource location string.
|
protected double |
getScreenHeight()
Get the current screen height.
|
protected double |
getScreenWidth()
Get the current screen width.
|
java.awt.Dimension |
getWindowSize()
Get size of display.
|
protected abstract float |
getZLevel()
Get the z-coordinate to render everything.
|
java.awt.Point |
guiToScreen(java.awt.Point p)
Utility function to convert PanelStudio GUI coordinates to screen pixel coordinates.
|
int |
loadImage(java.lang.String name)
Load an image into memory and return a number that may be used to draw that image.
|
void |
restore()
Restore the clipping to the previous state.
|
protected void |
scissor(java.awt.Rectangle r)
Utility function to set clipping rectangle.
|
java.awt.Point |
screenToGui(java.awt.Point p)
Utility function to convert screen pixel coordinates to PanelStudio GUI coordinates.
|
void |
window(java.awt.Rectangle r)
Clip all rendering on screen outside the intersection of the specified rectangle and the current clipping rectangle.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdrawImage, getButton, getModifier, getMouse, getTimeprotected boolean clipX
public GLInterface(boolean clipX)
clipX - whether to clip in the horizontal directionpublic java.awt.Dimension getWindowSize()
IInterfacegetWindowSize in interface IInterfacepublic void drawString(java.awt.Point pos,
int height,
java.lang.String s,
java.awt.Color c)
IInterfacedrawString in interface IInterfacepos - the position of the string on the screenheight - the height of the fonts - the string to be displayedc - the color of the string to be displayedpublic int getFontWidth(int height,
java.lang.String s)
IInterfaceIInterface.drawString(Point, int, String, Color)getFontWidth in interface IInterfaceheight - the height of the strings - the string to be consideredpublic void fillTriangle(java.awt.Point pos1,
java.awt.Point pos2,
java.awt.Point pos3,
java.awt.Color c1,
java.awt.Color c2,
java.awt.Color c3)
IInterfacefillTriangle in interface IInterfacepos1 - the first corner of the trianglepos2 - the second corner of the trianglepos3 - the third corner of the trianglec1 - the color at the first cornerc2 - the color at the second cornerc3 - the color at the third cornerpublic void drawLine(java.awt.Point a,
java.awt.Point b,
java.awt.Color c1,
java.awt.Color c2)
IInterfacedrawLine in interface IInterfacea - the start of the lineb - the end of the linec1 - the color at the start of the linec2 - the color at the end of the linepublic void fillRect(java.awt.Rectangle r,
java.awt.Color c1,
java.awt.Color c2,
java.awt.Color c3,
java.awt.Color c4)
IInterfacefillRect in interface IInterfacer - the rectangle to be renderedc1 - the color at the top-left corner of the rectanglec2 - the color at the top-right corner of the rectanglec3 - the color at the bottom-right corner of the rectanglec4 - the color at the bottom-left corner of the rectanglepublic void drawRect(java.awt.Rectangle r,
java.awt.Color c1,
java.awt.Color c2,
java.awt.Color c3,
java.awt.Color c4)
IInterfacedrawRect in interface IInterfacer - the rectangle to be renderedc1 - the color at the top-left corner of the rectanglec2 - the color at the top-right corner of the rectanglec3 - the color at the bottom-right corner of the rectanglec4 - the color at the bottom-left corner of the rectanglepublic int loadImage(java.lang.String name)
IInterfaceloadImage in interface IInterfacename - a string indicating the location of the image to be loadedIInterface.drawImage(Rectangle, int, boolean, int),
IInterface.drawImage(Rectangle, int, boolean, int, Color)public void drawImage(java.awt.Rectangle r,
int rotation,
boolean parity,
int image,
java.awt.Color color)
IInterfacedrawImage in interface IInterfacer - the rectangle specifying the position of the imagerotation - the rotation of the image in units of 90 degrees counter-clockwiseparity - if true, will flip the image around the vertical axisimage - the number identifying the imagecolor - the color to modulate the image byIInterface.loadImage(String)protected void scissor(java.awt.Rectangle r)
r - the clipping rectanglepublic void window(java.awt.Rectangle r)
IInterfaceIInterface.restore() after rendering.window in interface IInterfacer - the clipping rectangleIInterface.restore()public void restore()
IInterfacerestore in interface IInterfaceIInterface.window(Rectangle)public java.awt.Point screenToGui(java.awt.Point p)
p - the screen coordinatespublic java.awt.Point guiToScreen(java.awt.Point p)
p - the GUI coordinatesprotected double getScreenWidth()
protected double getScreenHeight()
public void begin(boolean matrix)
matrix - whether to set up the modelview matrixpublic void end(boolean matrix)
matrix - whether to restore the modelview matrixprotected abstract float getZLevel()
protected abstract net.minecraft.client.util.math.MatrixStack getMatrixStack()
protected abstract java.lang.String getResourcePrefix()