当前位置: 首页>>代码示例>>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;未经允许,请勿转载。