本文整理汇总了Java中org.lwjgl.opengl.GL11.glMatrixMode方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glMatrixMode方法的具体用法?Java GL11.glMatrixMode怎么用?Java GL11.glMatrixMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.glMatrixMode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initGL
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Initialise the GL context
*/
protected void initGL() {
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
GL11.glClearDepth(1);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glViewport(0,0,screenWidth,screenHeight);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
enterOrtho();
}
示例2: enterSafeBlock
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Enter a safe block ensuring that all the OpenGL state that slick
* uses is safe before touching the GL state directly.
*/
public static void enterSafeBlock()
{
if (inSafe) {
return;
}
Renderer.get().flush();
lastUsed = TextureImpl.getLastBind();
TextureImpl.bindNone();
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
GL11.glPushClientAttrib(GL11.GL_ALL_CLIENT_ATTRIB_BITS);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix();
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPushMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
inSafe = true;
}
示例3: leaveSafeBlock
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Leave a safe block ensuring that all of Slick's OpenGL state is
* restored since the last enter.
*/
public static void leaveSafeBlock()
{
if (!inSafe) {
return;
}
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPopMatrix();
GL11.glPopClientAttrib();
GL11.glPopAttrib();
if (lastUsed != null) {
lastUsed.bind();
} else {
TextureImpl.bindNone();
}
inSafe = false;
}
示例4: initGL
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Initialise the GL context
*/
protected void initGL() {
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
GL11.glClearDepth(1);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glViewport(0,0,screenWidth,screenHeight);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
enterOrtho();
}
示例5: initDisplay
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.opengl.renderer.SGL#initDisplay(int, int)
*/
public void initDisplay(int width, int height) {
this.width = width;
this.height = height;
String extensions = GL11.glGetString(GL11.GL_EXTENSIONS);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
GL11.glClearDepth(1);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glViewport(0,0,width,height);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
示例6: renderGL
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Render the GL scene, this isn't efficient and if you know
* OpenGL I'm assuming you can see why. If not, you probably
* don't want to use this feature anyway
*/
public void renderGL() {
FloatBuffer pos = BufferUtils.createFloatBuffer(4);
pos.put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f}).flip();
FloatBuffer red = BufferUtils.createFloatBuffer(4);
red.put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f}).flip();
GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos);
GL11.glEnable(GL11.GL_LIGHT0);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
float h = (float) 600 / (float) 800;
GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
GL11.glTranslatef(0.0f, 0.0f, -40.0f);
GL11.glRotatef(rot,0,1,1);
GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red);
gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
}
示例7: enable
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.Graphics#enable()
*/
protected void enable() {
if (!valid) {
throw new RuntimeException("Attempt to use a destroy()ed offscreen graphics context.");
}
SlickCallable.enterSafeBlock();
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
GL11.glPushClientAttrib(GL11.GL_ALL_CLIENT_ATTRIB_BITS);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPushMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix();
bind();
initGL();
}
示例8: beginHand
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void beginHand()
{
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix();
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPushMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
useProgram(19);
checkGLError("beginHand");
checkFramebufferStatus("beginHand");
}
示例9: enterOrtho
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Enter the orthographic mode
*/
protected void enterOrtho() {
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0, screenWidth, 0, screenHeight, 1, -1);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
示例10: disable
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.Graphics#disable()
*/
protected void disable() {
GL.flush();
unbind();
GL11.glPopClientAttrib();
GL11.glPopAttrib();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
SlickCallable.leaveSafeBlock();
}
示例11: enterOrtho
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.opengl.renderer.SGL#enterOrtho(int, int)
*/
public void enterOrtho(int xsize, int ysize) {
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0, width, height, 0, 1, -1);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glTranslatef((width-xsize)/2,
(height-ysize)/2,0);
}
示例12: render
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void render()
{
//Make camera rotation matrix (no translation) to draw skybox.
GraphicsUtil.glLoadMatrix(camera.projMat, GL11.GL_PROJECTION);
GraphicsUtil.glLoadMatrix(Mat3.rotation(Quat.invert(camera.dir)), GL11.GL_MODELVIEW);
skybox.render();
//Load proper camera matrix to draw world.
GraphicsUtil.glLoadMatrix(camera.viewMat, GL11.GL_MODELVIEW);
floor.render();
space.render();
//Load screen matrix to draw HUD.
Vec2i res = getResolution();
if (res.x <= 0 || res.y <= 0) return;
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(-res.x*0.5f, res.x*0.5f, -res.y*0.5f, res.y*0.5f, -1.0f, 1.0f);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
if (menu == null && !displayMouse && interactionState == defaultState)
crosshair.renderCrosshair();
if (menu != null) menu.render(1.0f);
}
示例13: initGL
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Initialise the GL display
*
* @param width The width of the display
* @param height The height of the display
*/
private void initGL(int width, int height) {
try {
Display.setDisplayMode(new DisplayMode(width,height));
Display.create();
Display.setVSyncEnabled(true);
} catch (LWJGLException e) {
e.printStackTrace();
System.exit(0);
}
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
GL11.glClearDepth(1);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glViewport(0,0,width,height);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0, width, height, 0, 1, -1);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
示例14: matrixMode
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void matrixMode(int mode)
{
GL11.glMatrixMode(mode);
}
示例15: pingDrawGUIHandle
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
Called on world draw
note: used to be pingDrawGUIHandle()
*/
static void guiDraw(float delta) {
if (!initialized) return;
// show options
checkConfigMenu();
if (!isInMenu() && !wasInConfigMenu && wasKeyPressedThisFrame(keyShowOptions)) {
openConfigMenu();
}
wasInConfigMenu = isConfigMenuOpened();
// text overlay
if (!isHideGUI() && !isInOptions()) {
// set state
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPushMatrix(); GL11.glLoadIdentity();
GuiHelper.setOrtho();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix(); GL11.glLoadIdentity();
GL11.glTranslatef(0.0F, 0.0F, -2000F);
GL11.glDisable(GL11.GL_LIGHTING);
// draw messages
if (!isShowDebug() && (!isInMenu()
|| getMenu() instanceof GuiContainer
|| getMenu() instanceof GuiChat)) {
setMessage("tags", getTags());
printMessages(messagesTL, 2, 2);
printMessages(messagesTR,-2, 2);
printMessages(messagesBL, 2,-2);
printMessages(messagesBR,-2,-2);
/*
printMessage("tags", 2,2);
printMessage("view", 2,14);
printMessage("info", 2,26);
printMessage("error", 2,38);
printMessage("radar",-2,2);
*/
}
// notify mods
if (!isInMenu() || getMenu() instanceof GuiChat || getMenu() instanceof GuiContainer)
for (ZMod mod : zombesMods)
try {
mod.notifyGUIDraw(delta);
} catch (Exception e) {
err("in mod \""+mod.getName()+"\": gui draw failed", e);
}
// restore state
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
// modLoader compatibility
if (!ML_loaded) try {
ML_loaded = true;
ML_OnTick = Class.forName("ModLoader").getDeclaredMethod("onTick", new Class[]{ Float.TYPE, Minecraft.class }); // ModLoader.OnTick(tick, game);
} catch(Exception whatever) { ML_OnTick = null; }
if (ML_OnTick != null) getResult(ML_OnTick, null, delta, getMinecraft());
}