Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void drawRect(float g, float h, float i, float j, int col1) {
- float f = (float)(col1 >> 24 & 0xFF) / 255F;
- float f1 = (float)(col1 >> 16 & 0xFF) / 255F;
- float f2 = (float)(col1 >> 8 & 0xFF) / 255F;
- float f3 = (float)(col1 & 0xFF) / 255F;
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glEnable(GL11.GL_LINE_SMOOTH);
- GL11.glPushMatrix();
- GL11.glColor4f(f1, f2, f3, f);
- GL11.glBegin(GL11.GL_QUADS);
- GL11.glVertex2d(i, h);
- GL11.glVertex2d(g, h);
- GL11.glVertex2d(g, j);
- GL11.glVertex2d(i, j);
- GL11.glEnd();
- GL11.glPopMatrix();
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_LINE_SMOOTH);
- }
- public static void drawGradientRect(int x, int y, int x2, int y2, int col1, int col2) {
- float f = (float)(col1 >> 24 & 0xFF) / 255F;
- float f1 = (float)(col1 >> 16 & 0xFF) / 255F;
- float f2 = (float)(col1 >> 8 & 0xFF) / 255F;
- float f3 = (float)(col1 & 0xFF) / 255F;
- float f4 = (float)(col2 >> 24 & 0xFF) / 255F;
- float f5 = (float)(col2 >> 16 & 0xFF) / 255F;
- float f6 = (float)(col2 >> 8 & 0xFF) / 255F;
- float f7 = (float)(col2 & 0xFF) / 255F;
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glEnable(GL11.GL_LINE_SMOOTH);
- GL11.glShadeModel(GL11.GL_SMOOTH);
- GL11.glPushMatrix();
- GL11.glBegin(GL11.GL_QUADS);
- GL11.glColor4f(f1, f2, f3, f);
- GL11.glVertex2d(x2, y);
- GL11.glVertex2d(x, y);
- GL11.glColor4f(f5, f6, f7, f4);
- GL11.glVertex2d(x, y2);
- GL11.glVertex2d(x2, y2);
- GL11.glEnd();
- GL11.glPopMatrix();
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_LINE_SMOOTH);
- GL11.glShadeModel(GL11.GL_FLAT);
- }
- public static void drawSideGradientRect(float x, float y, float x2, float y2, int col1, int col2) {
- float f = (float)(col1 >> 24 & 0xFF) / 255F;
- float f1 = (float)(col1 >> 16 & 0xFF) / 255F;
- float f2 = (float)(col1 >> 8 & 0xFF) / 255F;
- float f3 = (float)(col1 & 0xFF) / 255F;
- float f4 = (float)(col2 >> 24 & 0xFF) / 255F;
- float f5 = (float)(col2 >> 16 & 0xFF) / 255F;
- float f6 = (float)(col2 >> 8 & 0xFF) / 255F;
- float f7 = (float)(col2 & 0xFF) / 255F;
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glEnable(GL11.GL_LINE_SMOOTH);
- GL11.glShadeModel(GL11.GL_SMOOTH);
- GL11.glPushMatrix();
- GL11.glBegin(GL11.GL_QUADS);
- GL11.glColor4f(f1, f2, f3, f);
- GL11.glVertex2d(x2, y);
- GL11.glColor4f(f5, f6, f7, f4);
- GL11.glVertex2d(x, y);
- GL11.glVertex2d(x, y2);
- GL11.glColor4f(f1, f2, f3, f);
- GL11.glVertex2d(x2, y2);
- GL11.glEnd();
- GL11.glPopMatrix();
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_LINE_SMOOTH);
- GL11.glShadeModel(GL11.GL_FLAT);
- }
- public static void drawBorderedRect(int x, int y, int x2, int y2, float l1, int col1, int col2) {
- drawRect(x, y, x2, y2, col2);
- float f = (float)(col1 >> 24 & 0xFF) / 255F;
- float f1 = (float)(col1 >> 16 & 0xFF) / 255F;
- float f2 = (float)(col1 >> 8 & 0xFF) / 255F;
- float f3 = (float)(col1 & 0xFF) / 255F;
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glEnable(GL11.GL_LINE_SMOOTH);
- GL11.glPushMatrix();
- GL11.glColor4f(f1, f2, f3, f);
- GL11.glLineWidth(l1);
- GL11.glBegin(GL11.GL_LINES);
- GL11.glVertex2d(x, y);
- GL11.glVertex2d(x, y2);
- GL11.glVertex2d(x2, y2);
- GL11.glVertex2d(x2, y);
- GL11.glVertex2d(x, y);
- GL11.glVertex2d(x2, y);
- GL11.glVertex2d(x, y2);
- GL11.glVertex2d(x2, y2);
- GL11.glEnd();
- GL11.glPopMatrix();
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_LINE_SMOOTH);
- }
- public static void drawHollowBorderedRect(int x, int y, int x2, int y2, float l1, int col1) {
- float f = (float)(col1 >> 24 & 0xFF) / 255F;
- float f1 = (float)(col1 >> 16 & 0xFF) / 255F;
- float f2 = (float)(col1 >> 8 & 0xFF) / 255F;
- float f3 = (float)(col1 & 0xFF) / 255F;
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glEnable(GL11.GL_LINE_SMOOTH);
- GL11.glPushMatrix();
- GL11.glColor4f(f1, f2, f3, f);
- GL11.glLineWidth(l1);
- GL11.glBegin(GL11.GL_LINES);
- GL11.glVertex2d(x, y);
- GL11.glVertex2d(x, y2);
- GL11.glVertex2d(x2, y2);
- GL11.glVertex2d(x2, y);
- GL11.glVertex2d(x, y);
- GL11.glVertex2d(x2, y);
- GL11.glVertex2d(x, y2);
- GL11.glVertex2d(x2, y2);
- GL11.glEnd();
- GL11.glPopMatrix();
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_LINE_SMOOTH);
- }
- public static void drawGradientBorderedRect(int x, int y, int x2, int y2, float l1, int col1, int col2, int col3) {
- drawGradientRect(x, y, x2, y2, col2, col3);
- float f = (float)(col1 >> 24 & 0xFF) / 255F;
- float f1 = (float)(col1 >> 16 & 0xFF) / 255F;
- float f2 = (float)(col1 >> 8 & 0xFF) / 255F;
- float f3 = (float)(col1 & 0xFF) / 255F;
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glEnable(GL11.GL_LINE_SMOOTH);
- GL11.glPushMatrix();
- GL11.glColor4f(f1, f2, f3, f);
- GL11.glLineWidth(l1);
- GL11.glBegin(GL11.GL_LINES);
- GL11.glVertex2d(x, y);
- GL11.glVertex2d(x, y2);
- GL11.glVertex2d(x2, y2);
- GL11.glVertex2d(x2, y);
- GL11.glVertex2d(x, y);
- GL11.glVertex2d(x2, y);
- GL11.glVertex2d(x, y2);
- GL11.glVertex2d(x2, y2);
- GL11.glEnd();
- GL11.glPopMatrix();
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_LINE_SMOOTH);
- }
- public static void drawVerticalLine(int x, int y, int y2, float l1, int col1) {
- float f = (float)(col1 >> 24 & 0xFF) / 255F;
- float f1 = (float)(col1 >> 16 & 0xFF) / 255F;
- float f2 = (float)(col1 >> 8 & 0xFF) / 255F;
- float f3 = (float)(col1 & 0xFF) / 255F;
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glEnable(GL11.GL_LINE_SMOOTH);
- GL11.glPushMatrix();
- GL11.glColor4f(f1, f2, f3, f);
- GL11.glLineWidth(l1);
- GL11.glBegin(GL11.GL_LINES);
- GL11.glVertex2d(x, y);
- GL11.glVertex2d(x, y2);
- GL11.glEnd();
- GL11.glPopMatrix();
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_LINE_SMOOTH);
- }
- public static void drawHorizontalLine(int x, int x2, int y, float l1, int col1) {
- float f = (float)(col1 >> 24 & 0xFF) / 255F;
- float f1 = (float)(col1 >> 16 & 0xFF) / 255F;
- float f2 = (float)(col1 >> 8 & 0xFF) / 255F;
- float f3 = (float)(col1 & 0xFF) / 255F;
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glEnable(GL11.GL_LINE_SMOOTH);
- GL11.glPushMatrix();
- GL11.glColor4f(f1, f2, f3, f);
- GL11.glLineWidth(l1);
- GL11.glBegin(GL11.GL_LINES);
- GL11.glVertex2d(x, y);
- GL11.glVertex2d(x2, y);
- GL11.glEnd();
- GL11.glPopMatrix();
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_LINE_SMOOTH);
- }
- public static void drawDiagonalLine(int x, int x2, int y, float l1, int col1) {
- float f = (float)(col1 >> 24 & 0xFF) / 255F;
- float f1 = (float)(col1 >> 16 & 0xFF) / 255F;
- float f2 = (float)(col1 >> 8 & 0xFF) / 255F;
- float f3 = (float)(col1 & 0xFF) / 255F;
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glEnable(GL11.GL_LINE_SMOOTH);
- GL11.glPushMatrix();
- GL11.glColor4f(f1, f2, f3, f);
- GL11.glLineWidth(l1);
- GL11.glBegin(GL11.GL_LINES);
- GL11.glVertex2d(x, y);
- GL11.glVertex2d(y, x2);
- GL11.glEnd();
- GL11.glPopMatrix();
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_LINE_SMOOTH);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement