我需要了解大約3件事情才能開始使用OpenGL 2.0 ES。我需要做的事情大概有3件事情要做openGL 2.0讓我難過
- 如何爲2D視和整理我的紋理前後
- 如何加載紋理爲2D圖像。
- 如何移動該圖像(翻譯它)。
三(編輯):但是我可以看到它是一個簡單的着色器和頂點attrib被設置。
我需要了解大約3件事情才能開始使用OpenGL 2.0 ES。我需要做的事情大概有3件事情要做openGL 2.0讓我難過
三(編輯):但是我可以看到它是一個簡單的着色器和頂點attrib被設置。
我建議您閱讀documentation並查看SDK中的相關示例(從SDK管理器下載樣本並搜索StaticTriangleRenderer.java
)。這就是說,儘管潛在的管道知識對任何嚴重問題都很重要,但我建議你看看libgdx
和其他框架。 Libgdx
特別讓開發真的容易和照顧你煩人的位。您還可以獲得(某些)跨平臺兼容性,但我無法證實其質量。
// setup and load the texture, PSEUDOCODE
在這裏看到:2 Textures, 1 Shader - OpenGL ES 2.0
// You could make a "flatter" view by setting nearVal and farVal to a small number
void glOrtho( GLdouble left,
GLdouble right,
GLdouble bottom,
GLdouble top,
GLdouble nearVal,
GLdouble farVal);
CGRect rect = view.bounds;
glOrthof(-1.0, // Left
1.0, // Right
-1.0/(rect.size.width/rect.size.height), // Bottom
1.0/(rect.size.width/rect.size.height), // Top
0.01, // Near
0.05); // Far
// Then set the viewport
glViewport(0, 0, rect.size.width, rect.size.height);
// To translate use this PSEUDOCODE
glTranslate(x, y, z);
嘿@KnowMonster,檢查了這一點:http://opengles2learning.blogspot.co.uk/2011/05/first-experience-with-opengl-es2 -on_15.html – Zippy 2013-04-10 22:49:01
這看起來像一個很好的博客幫助人,謝謝! – mathacka 2013-04-12 00:44:13