當前位置: 首頁>>代碼示例>>Java>>正文


Java GLAllocation.createDirectIntBuffer方法代碼示例

本文整理匯總了Java中net.minecraft.client.renderer.GLAllocation.createDirectIntBuffer方法的典型用法代碼示例。如果您正苦於以下問題:Java GLAllocation.createDirectIntBuffer方法的具體用法?Java GLAllocation.createDirectIntBuffer怎麽用?Java GLAllocation.createDirectIntBuffer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.client.renderer.GLAllocation的用法示例。


在下文中一共展示了GLAllocation.createDirectIntBuffer方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: makeMipmapBuffers

import net.minecraft.client.renderer.GLAllocation; //導入方法依賴的package包/類
public static IntBuffer[] makeMipmapBuffers(Dimension[] p_makeMipmapBuffers_0_, int[][] p_makeMipmapBuffers_1_)
{
    if (p_makeMipmapBuffers_0_ == null)
    {
        return null;
    }
    else
    {
        IntBuffer[] aintbuffer = new IntBuffer[p_makeMipmapBuffers_0_.length];

        for (int i = 0; i < p_makeMipmapBuffers_0_.length; ++i)
        {
            Dimension dimension = p_makeMipmapBuffers_0_[i];
            int j = dimension.width * dimension.height;
            IntBuffer intbuffer = GLAllocation.createDirectIntBuffer(j);
            int[] aint = p_makeMipmapBuffers_1_[i];
            intbuffer.clear();
            intbuffer.put(aint);
            intbuffer.clear();
            aintbuffer[i] = intbuffer;
        }

        return aintbuffer;
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:26,代碼來源:Mipmaps.java

示例2: makeMipmapBuffers

import net.minecraft.client.renderer.GLAllocation; //導入方法依賴的package包/類
public static IntBuffer[] makeMipmapBuffers(Dimension[] mipmapDimensions, int[][] mipmapDatas)
{
    if (mipmapDimensions == null)
    {
        return null;
    }
    else
    {
        IntBuffer[] mipmapBuffers = new IntBuffer[mipmapDimensions.length];

        for (int i = 0; i < mipmapDimensions.length; ++i)
        {
            Dimension dim = mipmapDimensions[i];
            int bufLen = dim.width * dim.height;
            IntBuffer buf = GLAllocation.createDirectIntBuffer(bufLen);
            int[] data = mipmapDatas[i];
            buf.clear();
            buf.put(data);
            buf.clear();
            mipmapBuffers[i] = buf;
        }

        return mipmapBuffers;
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:26,代碼來源:Mipmaps.java

示例3: begin

import net.minecraft.client.renderer.GLAllocation; //導入方法依賴的package包/類
public void begin()
{
    // Remember current framebuffer.
    lastFramebuffer = GL11.glGetInteger( GL30.GL_FRAMEBUFFER_BINDING );

    // Render to our texture
    GL30.glBindFramebuffer( GL30.GL_FRAMEBUFFER,
                            framebufferID );

    // Remember viewport info.
    lastViewport = GLAllocation.createDirectIntBuffer( 16 );
    GL11.glGetInteger( GL11.GL_VIEWPORT,
                       lastViewport );
    GL11.glViewport( 0,
                     0,
                     renderTextureSize,
                     renderTextureSize );

    GL11.glMatrixMode( GL11.GL_MODELVIEW );
    GL11.glPushMatrix();
    GL11.glLoadIdentity();

    // Remember current texture.
    lastTexture = GL11.glGetInteger( GL11.GL_TEXTURE_BINDING_2D );

    GL11.glClearColor( 0,
                       0,
                       0,
                       0 );
    GL11.glClear( GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT );
    GL11.glCullFace( GL11.GL_FRONT );
    GL11.glEnable( GL11.GL_DEPTH_TEST );
    GL11.glEnable( GL11.GL_LIGHTING );
    GL11.glEnable( GL12.GL_RESCALE_NORMAL );
}
 
開發者ID:Maxwolf,項目名稱:MC-MineAPI.Java,代碼行數:36,代碼來源:FBOHelper.java

示例4: begin

import net.minecraft.client.renderer.GLAllocation; //導入方法依賴的package包/類
public void begin() {
    checkGlErrors("FBO Begin Init");

    // Remember current framebuffer.
    lastFramebuffer = GL11.glGetInteger(GL30.GL_FRAMEBUFFER_BINDING);

    // Render to our texture
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, framebufferID);

    // Remember viewport info.
    lastViewport = GLAllocation.createDirectIntBuffer(16);
    GL11.glGetInteger(GL11.GL_VIEWPORT, lastViewport);
    GL11.glViewport(0, 0, renderTextureSize, renderTextureSize);

    GlStateManager.matrixMode(GL11.GL_MODELVIEW);
    GlStateManager.pushMatrix();
    GlStateManager.loadIdentity();

    // Remember current texture.
    lastTexture = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);

    GlStateManager.clearColor(0, 0, 0, 0);
    GlStateManager.clear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
    GlStateManager.enableDepth();
    //GlStateManager.depthFunc(GL11.GL_ALWAYS);
    GlStateManager.enableLighting();
    GlStateManager.enableRescaleNormal();

    checkGlErrors("FBO Begin Final");
}
 
開發者ID:Kobata,項目名稱:item-render,代碼行數:31,代碼來源:FBOHelper.java

示例5: project2D

import net.minecraft.client.renderer.GLAllocation; //導入方法依賴的package包/類
/**
* Converts a Minecraft world coordinate to a screen coordinate
*
* The world coordinate is the absolute location of a 3d vector
* in the Minecraft world relative to the world origin.
* <p>
* Note that the return value will be scaled to match the current
* GUI resolution of Minecraft.
*
* @param  x  X coordinate in the Minecraft world
* @param  y  Y coordinate in the Minecraft world
* @param  z  Z coordinate in the Minecraft world
* @return Returns a {@link Vector2f} representing a 2D location on the screen,
* or null if the vector fails to be converted.
*/
  public static Vector2f project2D(final float x, final float y, final float z)
  {
  	/**
  	 * Buffer that will hold the screen coordinates
  	 */
      FloatBuffer screen_coords = GLAllocation.createDirectFloatBuffer(3);
      
      /**
       * Buffer that holds the transformation matrix of the view port
       */
      IntBuffer viewport = GLAllocation.createDirectIntBuffer(16);
      
      /**
       * Buffer that holds the transformation matrix of the model view
       */
      FloatBuffer modelview = GLAllocation.createDirectFloatBuffer(16);
      
      /**
       * Buffer that holds the transformation matrix of the projection
       */
      FloatBuffer projection = GLAllocation.createDirectFloatBuffer(16);
      
      /**
       * the return value of the gluProject call
       */
      boolean ret;
      
      
      screen_coords.clear();
      modelview.clear();
      projection.clear();
      
      viewport.clear();

      GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelview);
      GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, projection);
      GL11.glGetInteger(GL11.GL_VIEWPORT, viewport);

      ret = GLU.gluProject(x, y, z, modelview, projection, viewport, screen_coords);
      
      if (ret)
      {
          return new Vector2f(screen_coords.get(0), screen_coords.get(1));
      }

      return null;
  }
 
開發者ID:sabarjp,項目名稱:ShoulderSurfing,代碼行數:63,代碼來源:VectorConverter.java

示例6: project2D

import net.minecraft.client.renderer.GLAllocation; //導入方法依賴的package包/類
/**
* Converts a Minecraft world coordinate to a screen coordinate
*
* The world coordinate is the absolute location of a 3d vector
* in the Minecraft world relative to the world origin.
* <p>
* Note that the return value will be scaled to match the current
* GUI resolution of Minecraft.
*
* @param  x  X coordinate in the Minecraft world
* @param  y  Y coordinate in the Minecraft world
* @param  z  Z coordinate in the Minecraft world
* @return Returns a {@link Vector2f} representing a 2D location on the screen,
* or null if the vector fails to be converted.
*/
  public static Vector2f project2D(float x, float y, float z)
  {
  	/**
  	 * Buffer that will hold the screen coordinates
  	 */
      FloatBuffer screen_coords = GLAllocation.createDirectFloatBuffer(3);
      
      /**
       * Buffer that holds the transformation matrix of the view port
       */
      IntBuffer viewport = GLAllocation.createDirectIntBuffer(16);
      
      /**
       * Buffer that holds the transformation matrix of the model view
       */
      FloatBuffer modelview = GLAllocation.createDirectFloatBuffer(16);
      
      /**
       * Buffer that holds the transformation matrix of the projection
       */
      FloatBuffer projection = GLAllocation.createDirectFloatBuffer(16);
      
      /**
       * the return value of the gluProject call
       */
      boolean ret;
      
      
      screen_coords.clear();
      modelview.clear();
      projection.clear();
      
      viewport.clear();

      GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelview);
      GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, projection);
      GL11.glGetInteger(GL11.GL_VIEWPORT, viewport);

      ret = GLU.gluProject(x, y, z, modelview, projection, viewport, screen_coords);
      
      if (ret)
      {
          return new Vector2f(screen_coords.get(0), screen_coords.get(1));
      }

      return null;
  }
 
開發者ID:sabarjp,項目名稱:ShoulderSurfing,代碼行數:63,代碼來源:VectorConverter.java

示例7: directIntBuffer

import net.minecraft.client.renderer.GLAllocation; //導入方法依賴的package包/類
/**
 * Asks for a new directly backed IntBuffer
 *
 * @param size
 *            the number of buffer elements (ints)
 * @return a new direct int buffer
 */
public static IntBuffer directIntBuffer(int size) {
	return GLAllocation.createDirectIntBuffer(size);
}
 
開發者ID:WorldSEnder,項目名稱:MCAnm,代碼行數:11,代碼來源:Utils.java


注:本文中的net.minecraft.client.renderer.GLAllocation.createDirectIntBuffer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。