Skip to content
Snippets Groups Projects
Commit de7bde9b authored by Florian Hölzl's avatar Florian Hölzl
Browse files

YELLOW

refs 907
parent ea9e0b8f
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ import org.newdawn.slick.TrueTypeFont;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 2D3EA80BD21A94CB4E0EA52933EC7308
* @ConQAT.Rating YELLOW Hash: 11A2F7D76713A7864939A7D835692625
*/
@SuppressWarnings("deprecation")
public class LwjglCanvas extends GLCanvas {
......@@ -123,4 +123,10 @@ public class LwjglCanvas extends GLCanvas {
fontMap.get(font).drawString(x, y, msg, color);
disableTextures();
}
/** Returns the width of the given string for the given font. */
public int getStringWidth(String msg, Font font) {
ensureFontLoading(font);
return fontMap.get(font).getWidth(msg);
}
}
......@@ -51,6 +51,7 @@ import static org.lwjgl.opengl.GL11.glClear;
import static org.lwjgl.opengl.GL11.glClearColor;
import static org.lwjgl.opengl.GL11.glClearDepth;
import static org.lwjgl.opengl.GL11.glColor3f;
import static org.lwjgl.opengl.GL11.glColor4f;
import static org.lwjgl.opengl.GL11.glColorMaterial;
import static org.lwjgl.opengl.GL11.glCullFace;
import static org.lwjgl.opengl.GL11.glDisable;
......@@ -102,7 +103,7 @@ import org.newdawn.slick.Color;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 378E9D01D61C60FD4480F0D19169D038
* @ConQAT.Rating YELLOW Hash: 23F2E32F2D0E6F21F4317E6F09995872
*/
public class GLPrimitives {
/** The X unit vector. */
......@@ -142,7 +143,7 @@ public class GLPrimitives {
public static void initializeGLfor2D(int width, int height) {
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
glLineWidth(1);
glLineWidth(2);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// orthographic projection
......@@ -172,12 +173,12 @@ public class GLPrimitives {
/** Sets the current color. */
public static void setColor(Color color) {
glColor3f(color.r, color.g, color.b);
glColor4f(color.r, color.g, color.b, 1.0f);
}
/** Sets the current color. */
public static void setColor(Color3D color) {
glColor3f(color.getRed(), color.getGreen(), color.getBlue());
glColor4f(color.getRed(), color.getGreen(), color.getBlue(), 1.0f);
}
/** Applies the given translation. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment