本文整理汇总了Java中org.lwjgl.opengl.GL11.glGetInteger方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glGetInteger方法的具体用法?Java GL11.glGetInteger怎么用?Java GL11.glGetInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.glGetInteger方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateRenderInfo
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Updates the current render info and camera location based on entity look angles and 1st/3rd person view mode
*/
public static void updateRenderInfo(EntityPlayer entityplayerIn, boolean p_74583_1_)
{
GlStateManager.getFloat(2982, MODELVIEW);
GlStateManager.getFloat(2983, PROJECTION);
GL11.glGetInteger(GL11.GL_VIEWPORT, VIEWPORT);
float f = (float)((VIEWPORT.get(0) + VIEWPORT.get(2)) / 2);
float f1 = (float)((VIEWPORT.get(1) + VIEWPORT.get(3)) / 2);
GLU.gluUnProject(f, f1, 0.0F, MODELVIEW, PROJECTION, VIEWPORT, OBJECTCOORDS);
position = new Vec3((double)OBJECTCOORDS.get(0), (double)OBJECTCOORDS.get(1), (double)OBJECTCOORDS.get(2));
int i = p_74583_1_ ? 1 : 0;
float f2 = entityplayerIn.rotationPitch;
float f3 = entityplayerIn.rotationYaw;
rotationX = MathHelper.cos(f3 * (float)Math.PI / 180.0F) * (float)(1 - i * 2);
rotationZ = MathHelper.sin(f3 * (float)Math.PI / 180.0F) * (float)(1 - i * 2);
rotationYZ = -rotationZ * MathHelper.sin(f2 * (float)Math.PI / 180.0F) * (float)(1 - i * 2);
rotationXY = rotationX * MathHelper.sin(f2 * (float)Math.PI / 180.0F) * (float)(1 - i * 2);
rotationXZ = MathHelper.cos(f2 * (float)Math.PI / 180.0F);
}
示例2: checkBoundTexture
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void checkBoundTexture()
{
if (Config.isMinecraftThread())
{
int i = GL11.glGetInteger(GL13.GL_ACTIVE_TEXTURE);
int j = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
int k = getActiveTextureUnit();
int l = getBoundTexture();
if (l > 0)
{
if (i != k || j != l)
{
Config.dbg("checkTexture: act: " + k + ", glAct: " + i + ", tex: " + l + ", glTex: " + j);
}
}
}
}
示例3: getRayTrace
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static RayTrace getRayTrace()
{
FloatBuffer model = BufferUtils.createFloatBuffer(16);
FloatBuffer projection = BufferUtils.createFloatBuffer(16);
IntBuffer viewport = BufferUtils.createIntBuffer(16);
GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, model);
GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, projection);
GL11.glGetInteger(GL11.GL_VIEWPORT, viewport);
FloatBuffer posNearBuffer = BufferUtils.createFloatBuffer(3);
FloatBuffer posFarBuffer = BufferUtils.createFloatBuffer(3);
GLU.gluUnProject(Mouse.getX(), Mouse.getY(), 0.0F, model, projection, viewport, posNearBuffer);
GLU.gluUnProject(Mouse.getX(), Mouse.getY(), 1.0F, model, projection, viewport, posFarBuffer);
float[] posNear = new float[3];
float[] posFar = new float[3];
for(int i = 0; i < 3; i++)
{
posNear[i] = posNearBuffer.get(i);
posFar[i] = posFarBuffer.get(i);
}
Vec3d v = new Vec3d(posNear[0], posNear[1], posNear[2]);
Vec3d w = new Vec3d(posFar[0], posFar[1], posFar[2]);
return new RayTrace(v,w);
// entityModel.clearHighlights();
// PartObj p = entityModel.testRay(new RayTrace(v,w));
// if(p != null)
// hoveredPart = p.getName();
// else
// hoveredPart = null;
}
示例4: call
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void call(RenderWorld event) {
GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, MODELVIEW_BUFFER);
GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, PROJECTION_BUFFER);
GL11.glGetInteger(GL11.GL_VIEWPORT, VIEWPORT_BUFFER);
ScaledResolution scaledResolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
GLUProjection.getInstance().updateMatrices(VIEWPORT_BUFFER, MODELVIEW_BUFFER, PROJECTION_BUFFER,
scaledResolution.getScaledWidth() / (double) mc.displayWidth,
scaledResolution.getScaledHeight() / (double) mc.displayHeight);
}
示例5: detectOpenGlExtensions
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private static String[] detectOpenGlExtensions()
{
try
{
GlVersion glversion = getGlVersion();
if (glversion.getMajor() >= 3)
{
int i = GL11.glGetInteger(33309);
if (i > 0)
{
String[] astring = new String[i];
for (int j = 0; j < i; ++j)
{
astring[j] = GL30.glGetStringi(7939, j);
}
return astring;
}
}
}
catch (Exception exception1)
{
exception1.printStackTrace();
}
try
{
String s = GL11.glGetString(GL11.GL_EXTENSIONS);
String[] astring1 = s.split(" ");
return astring1;
}
catch (Exception exception)
{
exception.printStackTrace();
return new String[0];
}
}
示例6: glGetInteger
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.opengl.renderer.SGL#glGetInteger(int, java.nio.IntBuffer)
*/
public void glGetInteger(int id, IntBuffer ret) {
GL11.glGetInteger(id, ret);
}
示例7: drawRailEndCaps
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Draws the end caps of rails.
*
* @param texPoint - Position to render the caps at.
* @param vertices - Rail shape vertices, as returned by {@link openflextrack.api.IRailType#getRailVertices() getRailVertices()}.
* @param texScale - {@link openflextrack.api.IRailType#getTextureScale() Texture scale} of the rail segment.
* @param holographic - {@code true} if the track is a hologram.
*/
private static void drawRailEndCaps(float[] texPoint, Vec3f[][] vertices, float texScale, boolean holographic) {
/* Backup face mode. */
final int glFaceMode = GL11.glGetInteger(GL11.GL_FRONT_FACE);
for (byte b = 1; b > -2; b-=2)
{
GL11.glPushMatrix();
GL11.glScalef(texPoint[4], 1.0F, texPoint[3]);
/* If we're rendering the second cap, invert front face mode and scale.
* This will mirror the cap without the need to render vertices in different order. */
if (b == -1) {
GL11.glScalef(-1, 1, -1);
if (glFaceMode == GL11.GL_CCW) {
GL11.glFrontFace(GL11.GL_CW);
}
else {
GL11.glFrontFace(GL11.GL_CCW);
}
}
/* Actually render face. */
GL11.glBegin(GL11.GL_QUADS);
{
if (!holographic) {
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, texPoint[6]%65536, texPoint[6]/65536);
}
for (Vec3f[] verts : vertices)
{
/* The fourth vertex (index 3; bottom left of texture)
* defines x offset and minumum y value,
* and is the first point of the rectangle. */
final float xOff = (verts[3].x-verts[0].x);
final float yMin = verts[3].z;
GL11.glTexCoord2d(0.0F, yMin + (verts[0].y-verts[3].y)*texScale);
GL11.glVertex3d(verts[3].x, verts[3].y, verts[3].x);
GL11.glTexCoord2d((verts[3].x-verts[2].x), yMin - (verts[3].y-verts[2].y)*texScale + (verts[1].y-verts[2].y)*texScale);
GL11.glVertex3d(verts[2].x, verts[2].y, verts[2].x);
GL11.glTexCoord2d(xOff + (verts[0].x-verts[1].x), yMin + (verts[0].y-verts[1].y)*texScale);
GL11.glVertex3d(verts[1].x, verts[1].y, verts[1].x);
GL11.glTexCoord2d(xOff, yMin);
GL11.glVertex3d(verts[0].x, verts[0].y, verts[0].x);
}
}
GL11.glEnd();
GL11.glPopMatrix();
}
/* Reset face mode. */
GL11.glFrontFace(glFaceMode);
}
示例8: drawRailSegment
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Draws a rail segment with the given coordinates.
*
* @param texPoints
* @param w1 - X-coordinate of first vertex.
* @param w2 - X-coordinate of second vertex.
* @param h1 - Y-coordinate of first vertex.
* @param h2 - Y-coordinate of second vertex.
* @param t1 - Y-texture offset of first vertex.
* @param texScale - {@link openflextrack.api.IRailType#getTextureScale() Texture scale} of the rail segment.
* @param holographic - {@code true} if the track is holographic.
*/
private static void drawRailSegment(List<float[]> texPoints, float w1, float w2, float h1, float h2, float t1, float texScale, boolean holographic) {
/* Backup face mode. */
final int glFaceMode = GL11.glGetInteger(GL11.GL_FRONT_FACE);
final float t2 = t1 + (Math.abs(w2-w1) + Math.abs(h2-h1)) * texScale;
for (byte b = 1; b > -2; b-=2)
{
GL11.glPushMatrix();
/* If we're rendering the second rail, invert front face mode and scale.
* This will mirror the rail without the need to render vertices in different order. */
if (b == -1) {
if (glFaceMode == GL11.GL_CCW) {
GL11.glFrontFace(GL11.GL_CW);
}
else {
GL11.glFrontFace(GL11.GL_CCW);
}
}
/* Actually render the rail. */
GL11.glBegin(GL11.GL_QUAD_STRIP);
{
for (float[] point : texPoints) {
if (!holographic) {
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, point[6]%65536, point[6]/65536);
}
GL11.glTexCoord2d(point[5], t2);
GL11.glNormal3f(0, 1, 0);
GL11.glVertex3d(point[0] + b*w1*point[4], point[1] + h1, point[2] + b*w1*point[3]);
GL11.glTexCoord2d(point[5], t1);
GL11.glNormal3f(0, 1, 0);
GL11.glVertex3d(point[0] + b*w2*point[4], point[1] + h2, point[2] + b*w2*point[3]);
}
}
GL11.glEnd();
GL11.glPopMatrix();
}
/* Reset face mode. */
GL11.glFrontFace(glFaceMode);
}
示例9: onWorldLastRender
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@SubscribeEvent
public void onWorldLastRender(RenderWorldLastEvent evt)
{
World world = Minecraft.getMinecraft().theWorld;
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
double x = player.lastTickPosX + (player.posX - player.lastTickPosX) * evt.partialTicks;
double y = player.lastTickPosY + (player.posY - player.lastTickPosY) * evt.partialTicks;
double z = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * evt.partialTicks;
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
GL11.glTranslated(-x, -y, -z);
GlStateManager.disableTexture2D();
GlStateManager.disableLighting();
int shade_model = GL11.glGetInteger(GL11.GL_SHADE_MODEL);
GlStateManager.shadeModel(GL11.GL_SMOOTH);
GL11.glLineWidth(3);
GL11.glBegin(GL11.GL_LINES);
//display link process
PlayerProperties props = (PlayerProperties)player.getExtendedProperties(PlayerProperties.ID);
if(props != null && props.p_link != null
&& props.p_link.distanceSq(x,y+1,z) <= FundamentalChemistry.MAX_RELAY_DISTANCE-1f){ //distance check with some margin
GlStateManager.color(0f,1f,0.5f,1f);
GL11.glVertex3d(props.p_link.getX()+0.5, props.p_link.getY()+FundamentalChemistry.LASER_HEIGHT, props.p_link.getZ()+0.5);
GlStateManager.color(0f,0.5f,1f,1f);
GL11.glVertex3d(x, y+1, z);
}
for(TileEntity te : world.loadedTileEntityList){
if(te instanceof TileLaserRelay){
TileLaserRelay ent = (TileLaserRelay)te;
// change matrix for absolute coordinates
BlockPos cpos = ent.getPos();
for(BlockPos pos : ent.inputs){
TileEntity ce = te.getWorld().getTileEntity(pos);
if(ce != null && ce instanceof TileLaserRelay && (player.getPosition().distanceSq(pos.getX(),pos.getY(),pos.getZ()) <= 500
|| player.getPosition().distanceSq(cpos.getX(),cpos.getY(),cpos.getZ()) <= 500)){
//add height shift if it is a circular connections
TileLaserRelay cent = (TileLaserRelay)ce;
float shift = 0;
if(cent.inputs.contains(cpos) && cpos.hashCode() < pos.hashCode())
shift = 1/16.0f*2;
//draw connection
GlStateManager.color(0f,0.5f,1f,1f);
GL11.glVertex3d(cpos.getX()+0.5, cpos.getY()+FundamentalChemistry.LASER_HEIGHT-shift, cpos.getZ()+0.5);
GlStateManager.color(0f,1f,0.5f,1f);
GL11.glVertex3d(pos.getX()+0.5, pos.getY()+FundamentalChemistry.LASER_HEIGHT-shift, pos.getZ()+0.5);
}
}
}
}
GL11.glEnd();
GlStateManager.shadeModel(shade_model);
GlStateManager.enableTexture2D();
GlStateManager.enableLighting();
GlStateManager.popMatrix();
GlStateManager.popAttrib();
}
示例10: isInUse
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public boolean isInUse()
{
return GL11.glGetInteger(GL20.GL_CURRENT_PROGRAM) == this.handle;
}
示例11: glGetInteger
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void glGetInteger(int p_187445_0_, IntBuffer p_187445_1_)
{
GL11.glGetInteger(p_187445_0_, p_187445_1_);
}