#步骤
ruby dk.rb init
ruby dk.rb install
jekyll build
jekyll build --watch
jekyll build -w
jekyll serve
jekyll serve --watch
jekyll serve -w
ERROR: Could not find a valid gem 'jekyll' (>= 0), here is why:
Unable to download data from https://rubygems.org/ -
Errno::ETIMEDOUT: Operation timed out - connect(2) (https://rubygems.org/latest_specs.4.8.gz)
$ gem sources --remove https://rubygems.org/
$ gem sources -a http://ruby.taobao.org/
$ gem sources -l
*** CURRENT SOURCES ***
http://ruby.taobao.org
$ gem install jekyll
ByteOrder bOrder = vertexData.order();
if (bOrder == ByteOrder.BIG_ENDIAN) {
// is big endian
} else {
// ByteOrder.LITTLE_ENDIAN
}
// use native order
byteBuffer.order(ByteOrder.nativeOrder())
java.lang.IllegalArgumentException: Must use a native order direct Buffer
float[] tableVerticesWithTriangles = {
// first triangle.
-0.5f, -0.5f, 0.5f, 0.5f, -0.5f, 0.5f,
// second triangle.
-0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f,
// middle line
-0.5f, 0f, 0.5f, 0f,
// two points
0f, -0.25f, 0f, 0.25f
};
FloatBuffer vertexData = ByteBuffer.allocate(tableVerticesWithTriangles.length * BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();
// ... when pass the vertexData to OpenGL memory:
vertexData.position(0);
// crash here: "java.lang.IllegalArgumentException: Must use a native order direct Buffer"
glVertexAttribPointer(aPostionLocation, POSITION_COMPONENT_COUNT, GL_FLOAT, false, 0, vertexData);
// this is ok. use allocateDirect.
// The vertBuff buffer needs to be direct so that it isn't moved around in memory. [from StackOverflow](http://stackoverflow.com/questions/11012669/opengl-es-rendereing-error)
// You need to use the allocateDirect(int) method from the ByteBuffer class.
vertexData = ByteBuffer.allocateDirect(tableVerticesWithTriangles.length * BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();