PC 側の localhost (127.0.0.1) に繋げたい!
10.0.2.2 「special alias to your host loopback interface」glDrawArrays vs glDrawElements vs glArrayElement
多すぎるのでまとめたい◯glDrawElements
三角形の描画はいいが色は汚い
https://groups.google.com/forum/?hl=ja#!topic/android-developers/bOmY6wYr5dA
http://wisdom.sakura.ne.jp/system/opengl/gl9.html
http://objective-audio.jp/2009/07/ngmoco-opengl.html
"OpenGLで作るiPhone SDKゲームプログラミング"のdrawTextureをglDrawArrays から glDrawElements にしてみる。
const GLfloat squareVertices[] = { -0.5f*width + x, -0.5f*height + y, // (1) 0.5f*width + x, -0.5f*height + y, // (2) -0.5f*width + x, 0.5f*height + y, // (3) 0.5f*width + x, 0.5f*height + y, // (4) };
矩形を構成する四つの頂点の座標は4点ある
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
こいつを
GLubyte indices[] = { 0 , 1 , 2 , 3 }; glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_BYTE, indices);
こうする