コード例 #1
0
            public MyRenderer(BasicCustomVideoRenderer parent)
            {
                this.mCustomVideoRenderer = parent;

                ByteBuffer bb = ByteBuffer.allocateDirect(mXYZCoords.Length * 4);

                bb.order(ByteOrder.nativeOrder());
                mVertexBuffer = bb.asFloatBuffer();
                mVertexBuffer.put(mXYZCoords);
                mVertexBuffer.position(0);

                ByteBuffer tb = ByteBuffer.allocateDirect(mUVCoords.Length * 4);

                tb.order(ByteOrder.nativeOrder());
                mTextureBuffer = tb.asFloatBuffer();
                mTextureBuffer.put(mUVCoords);
                mTextureBuffer.position(0);

                ByteBuffer dlb = ByteBuffer.allocateDirect(mVertexIndex.Length * 2);

                dlb.order(ByteOrder.nativeOrder());
                mDrawListBuffer = dlb.asShortBuffer();
                mDrawListBuffer.put(mVertexIndex);
                mDrawListBuffer.position(0);
            }
コード例 #2
0
			public MyRenderer(BasicCustomVideoRenderer parent)
			{

				this.mCustomVideoRenderer = parent;

				ByteBuffer bb = ByteBuffer.allocateDirect(mXYZCoords.Length * 4);
				bb.order(ByteOrder.nativeOrder());
				mVertexBuffer = bb.asFloatBuffer();
				mVertexBuffer.put(mXYZCoords);
				mVertexBuffer.position(0);

				ByteBuffer tb = ByteBuffer.allocateDirect(mUVCoords.Length * 4);
				tb.order(ByteOrder.nativeOrder());
				mTextureBuffer = tb.asFloatBuffer();
				mTextureBuffer.put(mUVCoords);
				mTextureBuffer.position(0);

				ByteBuffer dlb = ByteBuffer.allocateDirect(mVertexIndex.Length * 2);
				dlb.order(ByteOrder.nativeOrder());
				mDrawListBuffer = dlb.asShortBuffer();
				mDrawListBuffer.put(mVertexIndex);
				mDrawListBuffer.position(0);
			}