本文整理汇总了Java中com.jogamp.opengl.GL2.glPushAttrib方法的典型用法代码示例。如果您正苦于以下问题:Java GL2.glPushAttrib方法的具体用法?Java GL2.glPushAttrib怎么用?Java GL2.glPushAttrib使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.GL2
的用法示例。
在下文中一共展示了GL2.glPushAttrib方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawHistogram
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
public static void drawHistogram(GL2 gl, float[] activations, int width, int height, float lineWidth, Color color) {
if (activations == null) {
return;
}
float[] ca = color.getColorComponents(null);
gl.glPushAttrib(GL2ES3.GL_COLOR | GL.GL_LINE_WIDTH);
gl.glLineWidth(lineWidth);
gl.glColor4fv(ca, 0);
float dx = (float) (width) / (activations.length);
float sy = (float) HISTOGRAM_HEIGHT_FRACTION * (height);
gl.glBegin(GL.GL_LINE_STRIP);
for (int i = 0; i < activations.length; i++) {
float y = 1 + (sy * activations[i]); // TODO debug hack
float x1 = 1 + (dx * i), x2 = x1 + dx;
gl.glVertex2f(x1, 1);
gl.glVertex2f(x1, y);
gl.glVertex2f(x2, y);
gl.glVertex2f(x2, 1);
}
gl.glEnd();
gl.glPopAttrib();
}
示例2: draw
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
synchronized void draw(GL2 gl) {
gl.glPushAttrib(GL2.GL_ENABLE_BIT);
gl.glLineStipple(1, (short) 0x7777);
gl.glLineWidth(9);
gl.glColor4f(0, 1, 1, .9f);
// textRenderer.begin3DRendering();
// textRenderer.draw3D("laser line", 5, 5, 0, textScale);
// textRenderer.end3DRendering();
gl.glEnable(GL2.GL_LINE_STIPPLE);
gl.glBegin(GL.GL_LINE_STRIP);
for (int i = 0; i < mapSizeX; i++) {
if (!ys[i].isNaN()) { // skip over columns without valid score
gl.glVertex2f(i, ys[i]);
} else { // interrupt lines at NaN
gl.glEnd();
gl.glBegin(GL.GL_LINE_STRIP);
}
}
gl.glEnd();
gl.glPopAttrib();
}
示例3: annotateHistogram
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
public void annotateHistogram(GL2 gl, int width, int height, float lineWidth, Color color) {
gl.glPushAttrib(GL2ES3.GL_COLOR | GL.GL_LINE_WIDTH);
gl.glLineWidth(lineWidth);
float[] ca = color.getColorComponents(null);
gl.glColor4fv(ca, 0);
OutputOrInnerProductFullyConnectedLayer.this.annotateHistogram(gl, width, height);
gl.glPopAttrib();
}
示例4: annotateHistogram
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
public void annotateHistogram(GL2 gl, int width, int height, float lineWidth, Color color) {
gl.glPushAttrib(GL2ES3.GL_COLOR | GL.GL_LINE_WIDTH);
gl.glLineWidth(lineWidth);
float[] ca = color.getColorComponents(null);
gl.glColor4fv(ca, 0);
outputHistogram(gl, width, height);
gl.glPopAttrib();
}
示例5: draw
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
void draw(GL2 gl, float lineWidth, float[] color) {
gl.glPushAttrib(GL2ES3.GL_COLOR | GL.GL_LINE_WIDTH);
gl.glLineWidth(lineWidth);
gl.glColor4fv(color, 0);
draw(gl);
gl.glPopAttrib();
}
示例6: draw
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
void draw(GL2 gl, float lineWidth, float[] color) {
gl.glPushAttrib(GL2GL3.GL_COLOR | GL2.GL_LINE_WIDTH);
gl.glLineWidth(lineWidth);
gl.glColor4fv(color, 0);
draw(gl);
gl.glPopAttrib();
}
示例7: draw
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
void draw(GL2 gl, float lineWidth, float[] color) {
gl.glPushAttrib(GL2.GL_COLOR | GL.GL_LINE_WIDTH);
gl.glLineWidth(lineWidth);
gl.glColor4fv(color, 0);
draw(gl);
gl.glPopAttrib();
}