<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pandorawiki.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Butterman</id>
	<title>Pandora Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://pandorawiki.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Butterman"/>
	<link rel="alternate" type="text/html" href="https://pandorawiki.org/Special:Contributions/Butterman"/>
	<updated>2026-04-23T16:11:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.32.0-alpha</generator>
	<entry>
		<id>https://pandorawiki.org/index.php?title=GLES&amp;diff=2050</id>
		<title>GLES</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=GLES&amp;diff=2050"/>
		<updated>2010-01-17T22:18:04Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Unfortunately, the OpenGL ES takes away many of the functions that beginner programmers use. They do this, because a lot of those functions are plain rubbish for any high-end application. We're only covering ES 1.1 here, but the Pandora also supports ES 2.0, which, leaves you with a handful of functions, you have to do all of the matrix math on your own. Which can be really hard if you're not good at maths, I'll cover how to do that in a later tutorial. What you're learning here isn't just for the Pandora, you should use these new methods in your Windows/Linux code. These changes are being made to the core OpenGL too, so you're loosing all of this stuff soon enough. Which is silly, OpenGL is good because beginners can pick it up easily. But whatever, I'm not in charge.&lt;br /&gt;
&lt;br /&gt;
== The Basics ==&lt;br /&gt;
&lt;br /&gt;
glBegin() and glEnd()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
glBegin(GL_TRIANGLES);&lt;br /&gt;
&lt;br /&gt;
    glVertex3f(1,0,0);&lt;br /&gt;
    glVertex3f(0,1,0);&lt;br /&gt;
    glVertex3f(-1,0,0);&lt;br /&gt;
&lt;br /&gt;
glEnd();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You know what I just did? Yeah, I drew a triangle! Nope, you can't draw stuff like this in OpenGL ES 1.1, so how would one draw a triangle in ES? Bare with me while you read this if you don't understand it, I'll explain it in depth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GLfloat vertices[] = {1,0,0, 0,1,0, -1,0,0};&lt;br /&gt;
&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called drawing with a vertex array. Eww? Yeah, you would never draw like that in a real program, your vertex array would be stored already, you wouldn't have to define it every time you drew somthing. While it's messy for drawing primitives, it's really cool for drawing models, because your models vertices are generally stored in arrays like that already. I'll show you an example from TINCS after I explain this code.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
GLfloat vertices[] = {1,0,0, 0,1,0, -1,0,0};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This ''should'' be obvious, we're simply creating an array that stores the vertices of our triangle. It can be of any size, you can store as many vertices as you want. Note, how I space out every three numbers, this is because a vertex is made of X,Y,Z components. So we have our X, our Y, our Z then a space for the next three. You don't have to space it like this, it's mainly so you can see what's going on. &lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We need to do this before we start drawing, this tells OGL that we're going to feed it a vertex array from the client side (rather than the server, which is the graphics card).&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Ok, here is where we're telling OGL where to get it's vertices from. The first argument, tells OGL how many components (or floats) there are per vertex. Remember we talked about how we were spacing them out every 3 numbers? Here we're telling OGL that we did that! The next argument tells OpenGL that we're giving it floating point numbers. Now we have a &amp;quot;0&amp;quot;. This is called the stride, I could explain it in detail, but you don't need to understand it yet. Just leave it at 0. In the last argument we give OGL our vertex array!&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here is where the work is done. The first argument is telling OGL that we're drawing in triangles. (This can be GL_QUADS, GL_LINES, whatever!). The second is specifying where we want to start in the array we passed OGL earier. The last one is telling OpenGL how many vertices we want to draw. In this case, it's just the three.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Finally, we're disabling the vertex array state. We're done!&lt;br /&gt;
&lt;br /&gt;
So this is one of the ways to draw stuff in OpenGL. It's the next step up from glBegin and glEnd and it works fine in ES 1.1, so it works fine on the Pandora!&lt;br /&gt;
&lt;br /&gt;
== Drawing Textured Quads ==&lt;br /&gt;
&lt;br /&gt;
OpenGL can be great for speeding up your 2D application. One of the ways you do this, is by drawing with OpenGL rather than SDL. 2D games are made up of lots of sprites, which are just images that move about in a 2D world. You can use hardware acceleration to speed this up. If you're only planning on using 3D stuff on the Pandora, read this anyway, it introduces you to texturing with texture arrays and you're probably going to need to use sprites somewhere anyway. &lt;br /&gt;
&lt;br /&gt;
So, we can pick apart my method of sprite drawing in TINCS for this tutorial, I mainly use this function to draw text, once it's been rendered by SDL_ttf and converted into a OpenGL texture, but never mind any of that.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
static void DrawSprite(GLuint sprite, float X, float Y, float Z, float W, float H)&lt;br /&gt;
{&lt;br /&gt;
	glBindTexture(GL_TEXTURE_2D,sprite);&lt;br /&gt;
&lt;br /&gt;
	GLfloat box[] = {X,Y + H,Z,  X + W,Y + H,Z,     X + W, Y, Z,   X,Y,Z};&lt;br /&gt;
	GLfloat tex[] = {0,0, 1,0, 1,1, 0,1};&lt;br /&gt;
&lt;br /&gt;
	glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
	glEnableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
&lt;br /&gt;
	glVertexPointer(3, GL_FLOAT, 0,box);&lt;br /&gt;
	glTexCoordPointer(2, GL_FLOAT, 0, tex);&lt;br /&gt;
&lt;br /&gt;
	glDrawArrays(GL_QUADS,0,4);&lt;br /&gt;
		&lt;br /&gt;
	glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
	glDisableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Give it a good read, make sure you understand all of the stuff we've been over before and how it's applied in this example! Also, I'm not sure how this will fare in the 3D realm, I only use it when I'm in Ortho mode (2D, drawing ma GUI).&lt;br /&gt;
&lt;br /&gt;
Right!&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glBindTexture(GL_TEXTURE_2D,sprite);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As you can see here, binding the texture that's passed to the function to GL_TEXTURE_2D. You should understand this already. (If not, hit up NeHes tutorials!)&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
GLfloat tex[] = {0,0, 1,0, 1,1, 0,1};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is new too, what we've done, is got the texture co-ordinates that we would usually pass to OGL per-vertex. (glTexCoord2f() style) Then put them into a little array.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glEnableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Just like last time, we're enabling a state on the client (not the server), this one tells the GPU we want to pass a texture coordinate array too.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glTexCoordPointer(2, GL_FLOAT, 0, tex);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here we're passing the texture coordinates to OGL. Exactly like the vertex coordinates, except that the first argument (the size) is only two. This is because we only need two values per texture coordinate (a U and a V).&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDisableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We disable the texture coordinate array just like we did with the vertex array.&lt;br /&gt;
&lt;br /&gt;
There we go! That's not much harder than SDL blit is it? I guarantee it will make your app run a whole bunch faster too :D&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
This is all you need to know to use OpenGL on the Pandora. Note, you can't open your window like you would in SDL/Linux/Windows, it's a little bit different in OpenGL ES and I'll go over that in my [[Combining OpenGL ES 1.1 and SDL to create a window on the Pandora]] tutorial! Remember, you can and should use this knowledge for regular OpenGL!&lt;br /&gt;
&lt;br /&gt;
''I want to add one last section about drawing models once I've released the source to my model format loader/drawer''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=Combining_OpenGL_ES_1.1_and_SDL_to_create_a_window_on_the_Pandora&amp;diff=1087</id>
		<title>Combining OpenGL ES 1.1 and SDL to create a window on the Pandora</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=Combining_OpenGL_ES_1.1_and_SDL_to_create_a_window_on_the_Pandora&amp;diff=1087"/>
		<updated>2009-02-21T19:55:42Z</updated>

		<summary type="html">&lt;p&gt;Butterman: New page: Under Construction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Under Construction&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=GLES&amp;diff=1086</id>
		<title>GLES</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=GLES&amp;diff=1086"/>
		<updated>2009-02-21T19:55:27Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Please don't skim over this tutorial, then just email me because you don't understand something. This tutorial has to be read in its entirety or you wont get it. If you're not up for that, then go find some other code you can copy paste, ya lazy bum. If you do have questions, I hang around on #TINCS in &amp;quot;irc.quakenet.org&amp;quot; or you can email me on &amp;quot;jack@sorok.co.uk&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Unfortunately, the OpenGL ES takes away many of the functions that beginner programmers use. They do this, because a lot of those functions are plain rubbish for any high-end application. We're only covering ES 1.1 here, but the Pandora also supports ES 2.0, which, leaves you with a handful of functions, you have to do all of the matrix math on your own. Which can be really hard if you're not good at maths, I'll cover how to do that in a later tutorial. What you're learning here isn't just for the Pandora, you should use these new methods in your Windows/Linux code. These changes are being made to the core OpenGL too, so you're loosing all of this stuff soon enough. Which is silly, OpenGL is good because beginners can pick it up easily. But whatever, I'm not in charge.&lt;br /&gt;
&lt;br /&gt;
== The Basics ==&lt;br /&gt;
&lt;br /&gt;
glBegin() and glEnd()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
glBegin(GL_TRIANGLES);&lt;br /&gt;
&lt;br /&gt;
    glVertex3f(1,0,0);&lt;br /&gt;
    glVertex3f(0,1,0);&lt;br /&gt;
    glVertex3f(-1,0,0);&lt;br /&gt;
&lt;br /&gt;
glEnd();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You know what I just did? Yeah, I drew a triangle! Nope, you can't draw stuff like this in OpenGL ES 1.1, so how would one draw a triangle in ES? Bare with me while you read this if you don't understand it, I'll explain it in depth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GLfloat vertices[] = {1,0,0, 0,1,0, -1,0,0};&lt;br /&gt;
&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called drawing with a vertex array. Eww? Yeah, you would never draw like that in a real program, your vertex array would be stored already, you wouldn't have to define it every time you drew somthing. While it's messy for drawing primitives, it's really cool for drawing models, because your models vertices are generally stored in arrays like that already. I'll show you an example from TINCS after I explain this code.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
GLfloat vertices[] = {1,0,0, 0,1,0, -1,0,0};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This ''should'' be obvious, we're simply creating an array that stores the vertices of our triangle. It can be of any size, you can store as many vertices as you want. Note, how I space out every three numbers, this is because a vertex is made of X,Y,Z components. So we have our X, our Y, our Z then a space for the next three. You don't have to space it like this, it's mainly so you can see what's going on. &lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We need to do this before we start drawing, this tells OGL that we're going to feed it a vertex array from the client side (rather than the server, which is the graphics card).&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Ok, here is where we're telling OGL where to get it's vertices from. The first argument, tells OGL how many components (or floats) there are per vertex. Remember we talked about how we were spacing them out every 3 numbers? Here we're telling OGL that we did that! The next argument tells OpenGL that we're giving it floating point numbers. Now we have a &amp;quot;0&amp;quot;. This is called the stride, I could explain it in detail, but you don't need to understand it yet. Just leave it at 0. In the last argument we give OGL our vertex array!&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here is where the work is done. The first argument is telling OGL that we're drawing in triangles. (This can be GL_QUADS, GL_LINES, whatever!). The second is specifying where we want to start in the array we passed OGL earier. The last one is telling OpenGL how many vertices we want to draw. In this case, it's just the three.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Finally, we're disabling the vertex array state. We're done!&lt;br /&gt;
&lt;br /&gt;
So this is one of the ways to draw stuff in OpenGL. It's the next step up from glBegin and glEnd and it works fine in ES 1.1, so it works fine on the Pandora!&lt;br /&gt;
&lt;br /&gt;
== Drawing Textured Quads ==&lt;br /&gt;
&lt;br /&gt;
OpenGL can be great for speeding up your 2D application. One of the ways you do this, is by drawing with OpenGL rather than SDL. 2D games are made up of lots of sprites, which are just images that move about in a 2D world. You can use hardware acceleration to speed this up. If you're only planning on using 3D stuff on the Pandora, read this anyway, it introduces you to texturing with texture arrays and you're probably going to need to use sprites somewhere anyway. &lt;br /&gt;
&lt;br /&gt;
So, we can pick apart my method of sprite drawing in TINCS for this tutorial, I mainly use this function to draw text, once it's been rendered by SDL_ttf and converted into a OpenGL texture, but never mind any of that.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
static void DrawSprite(GLuint sprite, float X, float Y, float Z, float W, float H)&lt;br /&gt;
{&lt;br /&gt;
	glBindTexture(GL_TEXTURE_2D,sprite);&lt;br /&gt;
&lt;br /&gt;
	GLfloat box[] = {X,Y + H,Z,  X + W,Y + H,Z,     X + W, Y, Z,   X,Y,Z};&lt;br /&gt;
	GLfloat tex[] = {0,0, 1,0, 1,1, 0,1};&lt;br /&gt;
&lt;br /&gt;
	glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
	glEnableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
&lt;br /&gt;
	glVertexPointer(3, GL_FLOAT, 0,box);&lt;br /&gt;
	glTexCoordPointer(2, GL_FLOAT, 0, tex);&lt;br /&gt;
&lt;br /&gt;
	glDrawArrays(GL_QUADS,0,4);&lt;br /&gt;
		&lt;br /&gt;
	glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
	glDisableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Give it a good read, make sure you understand all of the stuff we've been over before and how it's applied in this example! Also, I'm not sure how this will fare in the 3D realm, I only use it when I'm in Ortho mode (2D, drawing ma GUI).&lt;br /&gt;
&lt;br /&gt;
Right!&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glBindTexture(GL_TEXTURE_2D,sprite);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As you can see here, binding the texture that's passed to the function to GL_TEXTURE_2D. You should understand this already. (If not, hit up NeHes tutorials!)&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
GLfloat tex[] = {0,0, 1,0, 1,1, 0,1};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is new too, what we've done, is got the texture co-ordinates that we would usually pass to OGL per-vertex. (glTexCoord2f() style) Then put them into a little array.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glEnableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Just like last time, we're enabling a state on the client (not the server), this one tells the GPU we want to pass a texture coordinate array too.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glTexCoordPointer(2, GL_FLOAT, 0, tex);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here we're passing the texture coordinates to OGL. Exactly like the vertex coordinates, except that the first argument (the size) is only two. This is because we only need two values per texture coordinate (a U and a V).&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDisableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We disable the texture coordinate array just like we did with the vertex array.&lt;br /&gt;
&lt;br /&gt;
There we go! That's not much harder than SDL blit is it? I guarantee it will make your app run a whole bunch faster too :D&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
This is all you need to know to use OpenGL on the Pandora. Note, you can't open your window like you would in SDL/Linux/Windows, it's a little bit different in OpenGL ES and I'll go over that in my [[Combining OpenGL ES 1.1 and SDL to create a window on the Pandora]] tutorial! Remember, you can and should use this knowledge for regular OpenGL!&lt;br /&gt;
&lt;br /&gt;
''I want to add one last section about drawing models once I've released the source to my model format loader/drawer''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=GLES&amp;diff=1085</id>
		<title>GLES</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=GLES&amp;diff=1085"/>
		<updated>2009-02-21T19:51:13Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Please don't skim over this tutorial, then just email me because you don't understand something. This tutorial has to be read in its entirety or you wont get it. If you're not up for that, then go find some other code you can copy paste, ya lazy bum. If you do have questions, I hang around on #TINCS in &amp;quot;irc.quakenet.org&amp;quot; or you can email me on &amp;quot;jack@sorok.co.uk&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Unfortunately, the OpenGL ES takes away many of the functions that beginner programmers use. They do this, because a lot of those functions are plain rubbish for any high-end application. We're only covering ES 1.1 here, but the Pandora also supports ES 2.0, which, leaves you with a handful of functions, you have to do all of the matrix math on your own. Which can be really hard if you're not good at maths, I'll cover how to do that in a later tutorial. What you're learning here isn't just for the Pandora, you should use these new methods in your Windows/Linux code. These changes are being made to the core OpenGL too, so you're loosing all of this stuff soon enough. Which is silly, OpenGL is good because beginners can pick it up easily. But whatever, I'm not in charge.&lt;br /&gt;
&lt;br /&gt;
== The Basics ==&lt;br /&gt;
&lt;br /&gt;
glBegin() and glEnd()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
glBegin(GL_TRIANGLES);&lt;br /&gt;
&lt;br /&gt;
    glVertex3f(1,0,0);&lt;br /&gt;
    glVertex3f(0,1,0);&lt;br /&gt;
    glVertex3f(-1,0,0);&lt;br /&gt;
&lt;br /&gt;
glEnd();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You know what I just did? Yeah, I drew a triangle! Nope, you can't draw stuff like this in OpenGL ES 1.1, so how would one draw a triangle in ES? Bare with me while you read this if you don't understand it, I'll explain it in depth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GLfloat vertices[] = {1,0,0, 0,1,0, -1,0,0};&lt;br /&gt;
&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called drawing with a vertex array. Eww? Yeah, you would never draw like that in a real program, your vertex array would be stored already, you wouldn't have to define it every time you drew somthing. While it's messy for drawing primitives, it's really cool for drawing models, because your models vertices are generally stored in arrays like that already. I'll show you an example from TINCS after I explain this code.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
GLfloat vertices[] = {1,0,0, 0,1,0, -1,0,0};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This ''should'' be obvious, we're simply creating an array that stores the vertices of our triangle. It can be of any size, you can store as many vertices as you want. Note, how I space out every three numbers, this is because a vertex is made of X,Y,Z components. So we have our X, our Y, our Z then a space for the next three. You don't have to space it like this, it's mainly so you can see what's going on. &lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We need to do this before we start drawing, this tells OGL that we're going to feed it a vertex array from the client side (rather than the server, which is the graphics card).&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Ok, here is where we're telling OGL where to get it's vertices from. The first argument, tells OGL how many components (or floats) there are per vertex. Remember we talked about how we were spacing them out every 3 numbers? Here we're telling OGL that we did that! The next argument tells OpenGL that we're giving it floating point numbers. Now we have a &amp;quot;0&amp;quot;. This is called the stride, I could explain it in detail, but you don't need to understand it yet. Just leave it at 0. In the last argument we give OGL our vertex array!&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here is where the work is done. The first argument is telling OGL that we're drawing in triangles. (This can be GL_QUADS, GL_LINES, whatever!). The second is specifying where we want to start in the array we passed OGL earier. The last one is telling OpenGL how many vertices we want to draw. In this case, it's just the three.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Finally, we're disabling the vertex array state. We're done!&lt;br /&gt;
&lt;br /&gt;
So this is one of the ways to draw stuff in OpenGL. It's the next step up from glBegin and glEnd and it works fine in ES 1.1, so it works fine on the Pandora!&lt;br /&gt;
&lt;br /&gt;
== Drawing Textured Quads ==&lt;br /&gt;
&lt;br /&gt;
OpenGL can be great for speeding up your 2D application. One of the ways you do this, is by drawing with OpenGL rather than SDL. 2D games are made up of lots of sprites, which are just images that move about in a 2D world. You can use hardware acceleration to speed this up. If you're only planning on using 3D stuff on the Pandora, read this anyway, it introduces you to texturing with texture arrays and you're probably going to need to use sprites somewhere anyway. &lt;br /&gt;
&lt;br /&gt;
So, we can pick apart my method of sprite drawing in TINCS for this tutorial, I mainly use this function to draw text, once it's been rendered by SDL_ttf and converted into a OpenGL texture, but never mind any of that.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
static void DrawSprite(GLuint sprite, float X, float Y, float Z, float W, float H)&lt;br /&gt;
{&lt;br /&gt;
	glBindTexture(GL_TEXTURE_2D,sprite);&lt;br /&gt;
&lt;br /&gt;
	GLfloat box[] = {X,Y + H,Z,  X + W,Y + H,Z,     X + W, Y, Z,   X,Y,Z};&lt;br /&gt;
	GLfloat tex[] = {0,0, 1,0, 1,1, 0,1};&lt;br /&gt;
&lt;br /&gt;
	glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
	glEnableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
&lt;br /&gt;
	glVertexPointer(3, GL_FLOAT, 0,box);&lt;br /&gt;
	glTexCoordPointer(2, GL_FLOAT, 0, tex);&lt;br /&gt;
&lt;br /&gt;
	glDrawArrays(GL_QUADS,0,4);&lt;br /&gt;
		&lt;br /&gt;
	glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
	glDisableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Give it a good read, make sure you understand all of the stuff we've been over before and how it's applied in this example! Also, I'm not sure how this will fare in the 3D realm, I only use it when I'm in Ortho mode (2D, drawing ma GUI).&lt;br /&gt;
&lt;br /&gt;
Right!&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glBindTexture(GL_TEXTURE_2D,sprite);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As you can see here, binding the texture that's passed to the function to GL_TEXTURE_2D. You should understand this already. (If not, hit up NeHes tutorials!)&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
GLfloat tex[] = {0,0, 1,0, 1,1, 0,1};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is new too, what we've done, is got the texture co-ordinates that we would usually pass to OGL per-vertex. (glTexCoord2f() style) Then put them into a little array.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glEnableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Just like last time, we're enabling a state on the client (not the server), this one tells the GPU we want to pass a texture coordinate array too.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glTexCoordPointer(2, GL_FLOAT, 0, tex);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here we're passing the texture coordinates to OGL. Exactly like the vertex coordinates, except that the first argument (the size) is only two. This is because we only need two values per texture coordinate (a U and a V).&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDisableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We disable the texture coordinate array just like we did with the vertex array.&lt;br /&gt;
&lt;br /&gt;
There we go! That's not much harder than SDL blit is it? I guarantee it will make your app run a whole bunch faster too :D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=GLES&amp;diff=1084</id>
		<title>GLES</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=GLES&amp;diff=1084"/>
		<updated>2009-02-21T19:44:26Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Please don't skim over this tutorial, then just email me because you don't understand something. This tutorial has to be read in its entirety or you wont get it. If you're not up for that, then go find some other code you can copy paste, ya lazy bum. If you do have questions, I hang around on #TINCS in &amp;quot;irc.quakenet.org&amp;quot; or you can email me on &amp;quot;jack@sorok.co.uk&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Unfortunately, the OpenGL ES takes away many of the functions that beginner programmers use. They do this, because a lot of those functions are plain rubbish for any high-end application. We're only covering ES 1.1 here, but the Pandora also supports ES 2.0, which, leaves you with a handful of functions, you have to do all of the matrix math on your own. Which can be really hard if you're not good at maths, I'll cover how to do that in a later tutorial. What you're learning here isn't just for the Pandora, you should use these new methods in your Windows/Linux code. These changes are being made to the core OpenGL too, so you're loosing all of this stuff soon enough. Which is silly, OpenGL is good because beginners can pick it up easily. But whatever, I'm not in charge.&lt;br /&gt;
&lt;br /&gt;
== The Basics ==&lt;br /&gt;
&lt;br /&gt;
glBegin() and glEnd()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
glBegin(GL_TRIANGLES);&lt;br /&gt;
&lt;br /&gt;
    glVertex3f(1,0,0);&lt;br /&gt;
    glVertex3f(0,1,0);&lt;br /&gt;
    glVertex3f(-1,0,0);&lt;br /&gt;
&lt;br /&gt;
glEnd();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You know what I just did? Yeah, I drew a triangle! Nope, you can't draw stuff like this in OpenGL ES 1.1, so how would one draw a triangle in ES? Bare with me while you read this if you don't understand it, I'll explain it in depth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GLfloat vertices[] = {1,0,0, 0,1,0, -1,0,0};&lt;br /&gt;
&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called drawing with a vertex array. Eww? Yeah, you would never draw like that in a real program, your vertex array would be stored already, you wouldn't have to define it every time you drew somthing. While it's messy for drawing primitives, it's really cool for drawing models, because your models vertices are generally stored in arrays like that already. I'll show you an example from TINCS after I explain this code.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
GLfloat vertices[] = {1,0,0, 0,1,0, -1,0,0};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This ''should'' be obvious, we're simply creating an array that stores the vertices of our triangle. It can be of any size, you can store as many vertices as you want. Note, how I space out every three numbers, this is because a vertex is made of X,Y,Z components. So we have our X, our Y, our Z then a space for the next three. You don't have to space it like this, it's mainly so you can see what's going on. &lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We need to do this before we start drawing, this tells OGL that we're going to feed it a vertex array from the client side (rather than the server, which is the graphics card).&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Ok, here is where we're telling OGL where to get it's vertices from. The first argument, tells OGL how many components (or floats) there are per vertex. Remember we talked about how we were spacing them out every 3 numbers? Here we're telling OGL that we did that! The next argument tells OpenGL that we're giving it floating point numbers. Now we have a &amp;quot;0&amp;quot;. This is called the stride, I could explain it in detail, but you don't need to understand it yet. Just leave it at 0. In the last argument we give OGL our vertex array!&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here is where the work is done. The first argument is telling OGL that we're drawing in triangles. (This can be GL_QUADS, GL_LINES, whatever!). The second is specifying where we want to start in the array we passed OGL earier. The last one is telling OpenGL how many vertices we want to draw. In this case, it's just the three.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Finally, we're disabling the vertex array state. We're done!&lt;br /&gt;
&lt;br /&gt;
So this is one of the ways to draw stuff in OpenGL. It's the next step up from glBegin and glEnd and it works fine in ES 1.1, so it works fine on the Pandora!&lt;br /&gt;
&lt;br /&gt;
== Drawing Textured Quads ==&lt;br /&gt;
&lt;br /&gt;
OpenGL can be great for speeding up your 2D application. One of the ways you do this, is by drawing with OpenGL rather than SDL. 2D games are made up of lots of sprites, which are just images that move about in a 2D world. You can use hardware acceleration to speed this up. If you're only planning on using 3D stuff on the Pandora, read this anyway, it introduces you to texturing with texture arrays and you're probably going to need to use sprites somewhere anyway. &lt;br /&gt;
&lt;br /&gt;
So, we can pick apart my method of sprite drawing in TINCS for this tutorial, I mainly use this function to draw text, once it's been rendered by SDL_ttf and converted into a OpenGL texture, but never mind any of that.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
static void DrawSprite(GLuint sprite, float X, float Y, float Z, float W, float H)&lt;br /&gt;
{&lt;br /&gt;
	glLoadIdentity();&lt;br /&gt;
&lt;br /&gt;
	glBindTexture(GL_TEXTURE_2D,sprite);&lt;br /&gt;
&lt;br /&gt;
	GLfloat box[] = {X,Y + H,Z,  X + W,Y + H,Z,     X + W, Y, Z,   X,Y,Z};&lt;br /&gt;
	GLfloat tex[] = {0,0, 1,0, 1,1, 0,1};&lt;br /&gt;
&lt;br /&gt;
	glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
	glEnableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
&lt;br /&gt;
	glVertexPointer(3, GL_FLOAT, 0,box);&lt;br /&gt;
	glTexCoordPointer(2, GL_FLOAT, 0, tex);&lt;br /&gt;
&lt;br /&gt;
	glDrawArrays(GL_QUADS,0,4);&lt;br /&gt;
		&lt;br /&gt;
	glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
	glDisableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Give it a good read, make sure you understand all of the stuff we've been over before and how it's applied in this example!&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=GLES&amp;diff=1083</id>
		<title>GLES</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=GLES&amp;diff=1083"/>
		<updated>2009-02-21T19:43:57Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Please don't skim over this tutorial, then just email me because you don't understand something. This tutorial has to be read in its entirety or you wont get it. If you're not up for that, then go find some other code you can copy paste, ya lazy bum. If you do have questions, I hang around on #TINCS in &amp;quot;irc.quakenet.org&amp;quot; or you can email me on &amp;quot;jack@sorok.co.uk&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Unfortunately, the OpenGL ES takes away many of the functions that beginner programmers use. They do this, because a lot of those functions are plain rubbish for any high-end application. We're only covering ES 1.1 here, but the Pandora also supports ES 2.0, which, leaves you with a handful of functions, you have to do all of the matrix math on your own. Which can be really hard if you're not good at maths, I'll cover how to do that in a later tutorial. What you're learning here isn't just for the Pandora, you should use these new methods in your Windows/Linux code. These changes are being made to the core OpenGL too, so you're loosing all of this stuff soon enough. Which is silly, OpenGL is good because beginners can pick it up easily. But whatever, I'm not in charge.&lt;br /&gt;
&lt;br /&gt;
== The Basics ==&lt;br /&gt;
&lt;br /&gt;
glBegin() and glEnd()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
glBegin(GL_TRIANGLES);&lt;br /&gt;
&lt;br /&gt;
    glVertex3f(1,0,0);&lt;br /&gt;
    glVertex3f(0,1,0);&lt;br /&gt;
    glVertex3f(-1,0,0);&lt;br /&gt;
&lt;br /&gt;
glEnd();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You know what I just did? Yeah, I drew a triangle! Nope, you can't draw stuff like this in OpenGL ES 1.1, so how would one draw a triangle in ES? Bare with me while you read this if you don't understand it, I'll explain it in depth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GLfloat vertices[] = {1,0,0, 0,1,0, -1,0,0};&lt;br /&gt;
&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called drawing with a vertex array. Eww? Yeah, you would never draw like that in a real program, your vertex array would be stored already, you wouldn't have to define it every time you drew somthing. While it's messy for drawing primitives, it's really cool for drawing models, because your models vertices are generally stored in arrays like that already. I'll show you an example from TINCS after I explain this code.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
GLfloat vertices[] = {1,0,0, 0,1,0, -1,0,0};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This ''should'' be obvious, we're simply creating an array that stores the vertices of our triangle. It can be of any size, you can store as many vertices as you want. Note, how I space out every three numbers, this is because a vertex is made of X,Y,Z components. So we have our X, our Y, our Z then a space for the next three. You don't have to space it like this, it's mainly so you can see what's going on. &lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We need to do this before we start drawing, this tells OGL that we're going to feed it a vertex array from the client side (rather than the server, which is the graphics card).&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Ok, here is where we're telling OGL where to get it's vertices from. The first argument, tells OGL how many components (or floats) there are per vertex. Remember we talked about how we were spacing them out every 3 numbers? Here we're telling OGL that we did that! The next argument tells OpenGL that we're giving it floating point numbers. Now we have a &amp;quot;0&amp;quot;. This is called the stride, I could explain it in detail, but you don't need to understand it yet. Just leave it at 0. In the last argument we give OGL our vertex array!&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here is where the work is done. The first argument is telling OGL that we're drawing in triangles. (This can be GL_QUADS, GL_LINES, whatever!). The second is specifying where we want to start in the array we passed OGL earier. The last one is telling OpenGL how many vertices we want to draw. In this case, it's just the three.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Finally, we're disabling the vertex array state. We're done!&lt;br /&gt;
&lt;br /&gt;
So this is one of the ways to draw stuff in OpenGL. It's the next step up from glBegin and glEnd and it works fine in ES 1.1, so it works fine on the Pandora!&lt;br /&gt;
&lt;br /&gt;
== Drawing Textured Quads ==&lt;br /&gt;
&lt;br /&gt;
OpenGL can be great for speeding up your 2D application. One of the ways you do this, is by drawing with OpenGL rather than SDL. 2D games are made up of lots of sprites, which are just images that move about in a 2D world. You can use hardware acceleration to speed this up. If you're only planning on using 3D stuff on the Pandora, read this anyway, it introduces you to texturing with texture arrays and you're probably going to need to use sprites somewhere anyway. &lt;br /&gt;
&lt;br /&gt;
So, we can pick apart my method of sprite drawing in TINCS for this tutorial, I mainly use this function to draw text, once it's been rendered by SDL_ttf and converted into a OpenGL texture, but never mind any of that.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
	static void DrawSprite(GLuint sprite, float X, float Y, float Z, float W, float H)&lt;br /&gt;
	{&lt;br /&gt;
		glLoadIdentity();&lt;br /&gt;
&lt;br /&gt;
		glBindTexture(GL_TEXTURE_2D,sprite);&lt;br /&gt;
&lt;br /&gt;
		GLfloat box[] = {X,Y + H,Z,  X + W,Y + H,Z,     X + W, Y, Z,   X,Y,Z};&lt;br /&gt;
		GLfloat tex[] = {0,0, 1,0, 1,1, 0,1};&lt;br /&gt;
&lt;br /&gt;
		glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
		glEnableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
&lt;br /&gt;
		glVertexPointer(3, GL_FLOAT, 0,box);&lt;br /&gt;
		glTexCoordPointer(2, GL_FLOAT, 0, tex);&lt;br /&gt;
&lt;br /&gt;
		glDrawArrays(GL_QUADS,0,4);&lt;br /&gt;
		&lt;br /&gt;
		glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
		glDisableClientState(GL_TEXTURE_COORD_ARRAY);&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Give it a good read, make sure you understand all of the stuff we've been over before and how it's applied in this example!&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=GLES&amp;diff=1082</id>
		<title>GLES</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=GLES&amp;diff=1082"/>
		<updated>2009-02-20T19:04:19Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Please don't skim over this tutorial, then just email me because you don't understand something. This tutorial has to be read in its entirety or you wont get it. If you're not up for that, then go find some other code you can copy paste, ya lazy bum. If you do have questions, I hang around on #TINCS in &amp;quot;irc.quakenet.org&amp;quot; or you can email me on &amp;quot;jack@sorok.co.uk&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Unfortunately, the OpenGL ES takes away many of the functions that beginner programmers use. They do this, because a lot of those functions are plain rubbish for any high-end application. We're only covering ES 1.1 here, but the Pandora also supports ES 2.0, which, leaves you with a handful of functions, you have to do all of the matrix math on your own. Which can be really hard if you're not good at maths, I'll cover how to do that in a later tutorial. What you're learning here isn't just for the Pandora, you should use these new methods in your Windows/Linux code. These changes are being made to the core OpenGL too, so you're loosing all of this stuff soon enough. Which is silly, OpenGL is good because beginners can pick it up easily. But whatever, I'm not in charge.&lt;br /&gt;
&lt;br /&gt;
== The Basics ==&lt;br /&gt;
&lt;br /&gt;
glBegin() and glEnd()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
glBegin(GL_TRIANGLES);&lt;br /&gt;
&lt;br /&gt;
    glVertex3f(1,0,0);&lt;br /&gt;
    glVertex3f(0,1,0);&lt;br /&gt;
    glVertex3f(-1,0,0);&lt;br /&gt;
&lt;br /&gt;
glEnd();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You know what I just did? Yeah, I drew a triangle! Nope, you can't draw stuff like this in OpenGL ES 1.1, so how would one draw a triangle in ES? Bare with me while you read this if you don't understand it, I'll explain it in depth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GLfloat vertices[] = {1,0,0, 0,1,0, -1,0,0};&lt;br /&gt;
&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called drawing with a vertex array. Eww? Yeah, you would never draw like that in a real program, your vertex array would be stored already, you wouldn't have to define it every time you drew somthing. While it's messy for drawing primitives, it's really cool for drawing models, because your models vertices are generally stored in arrays like that already. I'll show you an example from TINCS after I explain this code.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
GLfloat vertices[] = {1,0,0, 0,1,0, -1,0,0};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This ''should'' be obvious, we're simply creating an array that stores the vertices of our triangle. It can be of any size, you can store as many vertices as you want. Note, how I space out every three numbers, this is because a vertex is made of X,Y,Z components. So we have our X, our Y, our Z then a space for the next three. You don't have to space it like this, it's mainly so you can see what's going on. &lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We need to do this before we start drawing, this tells OGL that we're going to feed it a vertex array from the client side (rather than the server, which is the graphics card).&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Ok, here is where we're telling OGL where to get it's vertices from. The first argument, tells OGL how many components (or floats) there are per vertex. Remember we talked about how we were spacing them out every 3 numbers? Here we're telling OGL that we did that! The next argument tells OpenGL that we're giving it floating point numbers. Now we have a &amp;quot;0&amp;quot;. This is called the stride, I could explain it in detail, but you don't need to understand it yet. Just leave it at 0. In the last argument we give OGL our vertex array!&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here is where the work is done. The first argument is telling OGL that we're drawing in triangles. (This can be GL_QUADS, GL_LINES, whatever!). The second is specifying where we want to start in the array we passed OGL earier. The last one is telling OpenGL how many vertices we want to draw. In this case, it's just the three.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Finally, we're disabling the vertex array state. We're done!&lt;br /&gt;
&lt;br /&gt;
So this is one of the ways to draw stuff in OpenGL. It's the next step up from glBegin and glEnd and it works fine in ES 1.1, so it works fine on the Pandora!&lt;br /&gt;
&lt;br /&gt;
== Drawing Textured Quads ==&lt;br /&gt;
&lt;br /&gt;
OpenGL can be great for speeding up your 2D application. One of the ways you do this, is by drawing with OpenGL rather than SDL. 2D games are made up of lots of sprites, which are just images that move about in a 2D world. You can use hardware acceleration to speed this up. If you're only planning on using 3D stuff on the Pandora, read this anyway, it introduces you to texturing with texture arrays and you're probably going to need to use sprites somewhere anyway. &lt;br /&gt;
&lt;br /&gt;
So, we can pick apart my method of sprite drawing in TINCS for this tutorial, I mainly use this function to draw text, once it's been rendered by SDL_ttf and converted into a OpenGL texture, but never mind any of that.&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=GLES&amp;diff=1081</id>
		<title>GLES</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=GLES&amp;diff=1081"/>
		<updated>2009-02-17T20:38:52Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Please don't skim over this tutorial, then just email me because you don't understand something. This tutorial has to be read in its entirety or you wont get it. If you're not up for that, then go find some other code you can copy paste, ya lazy bum. If you do have questions, I hang around on #TINCS in &amp;quot;irc.quakenet.org&amp;quot; or you can email me on &amp;quot;jack@sorok.co.uk&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Unfortunately, the OpenGL ES takes away many of the functions that beginner programmers use. They do this, because a lot of those functions are plain rubbish for any high-end application. We're only covering ES 1.1 here, but the Pandora also supports ES 2.0, which, leaves you with a handful of functions, you have to do all of the matrix math on your own. Which can be really hard if you're not good at maths, I'll cover how to do that in a later tutorial. What you're learning here isn't just for the Pandora, you should use these new methods in your Windows/Linux code. These changes are being made to the core OpenGL too, so you're loosing all of this stuff soon enough. Which is silly, OpenGL is good because beginners can pick it up easily. But whatever, I'm not in charge.&lt;br /&gt;
&lt;br /&gt;
== The Basics ==&lt;br /&gt;
&lt;br /&gt;
glBegin() and glEnd()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
glBegin(GL_TRIANGLES);&lt;br /&gt;
&lt;br /&gt;
    glVertex3f(1,0,0);&lt;br /&gt;
    glVertex3f(0,1,0);&lt;br /&gt;
    glVertex3f(-1,0,0);&lt;br /&gt;
&lt;br /&gt;
glEnd();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You know what I just did? Yeah, I drew a triangle! Nope, you can't draw stuff like this in OpenGL ES 1.1, so how would one draw a triangle in ES? Bare with me while you read this if you don't understand it, I'll explain it in depth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GLfloat vertices[] = {1,0,0 0,1,0 -1,0,0};&lt;br /&gt;
&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called drawing with a vertex array. Eww? Yeah, you would never draw like that in a real program, your vertex array would be stored already, you wouldn't have to define it every time you drew somthing. While it's messy for drawing primitives, it's really cool for drawing models, because your models vertices are generally stored in arrays like that already. I'll show you an example from TINCS after I explain this code.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
GLfloat vertices[] = {1,0,0 0,1,0 -1,0,0};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This ''should'' be obvious, we're simply creating an array that stores the vertices of our triangle. It can be of any size, you can store as many vertices as you want. Note, how I space out every three numbers, this is because a vertex is made of X,Y,Z components. So we have our X, our Y, our Z then a space for the next three. You don't have to space it like this, it's mainly so you can see what's going on. &lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We need to do this before we start drawing, this tells OGL that we're going to feed it a vertex array from the client side (rather than the server, which is the graphics card).&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Ok, here is where we're telling OGL where to get it's vertices from. The first argument, tells OGL how many components (or floats) there are per vertex. Remember we talked about how we were spacing them out every 3 numbers? Here we're telling OGL that we did that! The next argument tells OpenGL that we're giving it floating point numbers. Now we have a &amp;quot;0&amp;quot;. This is called the stride, I could explain it in detail, but you don't need to understand it yet. Just leave it at 0. In the last argument we give OGL our vertex array!&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here is where the work is done. The first argument is telling OGL that we're drawing in triangles. (This can be GL_QUADS, GL_LINES, whatever!). The second is specifying where we want to start in the array we passed OGL earier. The last one is telling OpenGL how many vertices we want to draw. In this case, it's just the three.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Finally, we're disabling the vertex array state. We're done!&lt;br /&gt;
&lt;br /&gt;
So this is one of the ways to draw stuff in OpenGL. It's the next step up from glBegin and glEnd and it works fine in ES 1.1, so it works fine on the Pandora!&lt;br /&gt;
&lt;br /&gt;
== Drawing Textured Quads ==&lt;br /&gt;
&lt;br /&gt;
OpenGL can be great for speeding up your 2D application. One of the ways you do this, is by drawing with OpenGL rather than SDL. 2D games are made up of lots of sprites, which are just images that move about in a 2D world. You can use hardware acceleration to speed this up. If you're only planning on using 3D stuff on the Pandora, read this anyway, it introduces you to texturing with texture arrays and you're probably going to need to use sprites somewhere anyway. &lt;br /&gt;
&lt;br /&gt;
So, we can pick apart my method of sprite drawing in TINCS for this tutorial, I mainly use this function to draw text, once it's been rendered by SDL_ttf and converted into a OpenGL texture, but never mind any of that.&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=GLES&amp;diff=1080</id>
		<title>GLES</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=GLES&amp;diff=1080"/>
		<updated>2009-02-17T18:46:26Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Please don't skim over this tutorial, then just email me because you don't understand something. This tutorial has to be read in its entirety or you wont get it. If you're not up for that, then go find some other code you can copy paste, ya lazy bum. If you do have questions, I hang around on #TINCS in &amp;quot;irc.quakenet.org&amp;quot; or you can email me on &amp;quot;jack@sorok.co.uk&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Unfortunately, the OpenGL ES takes away many of the functions that beginner programmers use. They do this, because a lot of those functions are plain rubbish for any high-end application. We're only covering ES 1.1 here, but the Pandora also supports ES 2.0, which, leaves you with a handful of functions, you have to do all of the matrix math on your own. Which can be really hard if you're not good at maths, I'll cover how to do that in a later tutorial. What you're learning here isn't just for the Pandora, you should use these new methods in your Windows/Linux code. These changes are being made to the core OpenGL too, so you're loosing all of this stuff soon enough. Which is silly, OpenGL is good because beginners can pick it up easily. But whatever, I'm not in charge.&lt;br /&gt;
&lt;br /&gt;
== The Basics ==&lt;br /&gt;
&lt;br /&gt;
glBegin() and glEnd()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
glBegin(GL_TRIANGLES);&lt;br /&gt;
&lt;br /&gt;
    glVertex3f(1,0,0);&lt;br /&gt;
    glVertex3f(0,1,0);&lt;br /&gt;
    glVertex3f(-1,0,0);&lt;br /&gt;
&lt;br /&gt;
glEnd();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You know what I just did? Yeah, I drew a triangle! Nope, you can't draw stuff like this in OpenGL ES 1.1, so how would one draw a triangle in ES? Bare with me while you read this if you don't understand it, I'll explain it in depth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GLfloat vertices[] = {1,0,0 0,1,0 -1,0,0};&lt;br /&gt;
&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called drawing with a vertex array. Eww? Yeah, you would never draw like that in a real program, your vertex array would be stored already, you wouldn't have to define it every time you drew somthing. While it's messy for drawing primitives, it's really cool for drawing models, because your models vertices are generally stored in arrays like that already. I'll show you an example from TINCS after I explain this code.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
GLfloat vertices[] = {1,0,0 0,1,0 -1,0,0};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This ''should'' be obvious, we're simply creating an array that stores the vertices of our triangle. It can be of any size, you can store as many vertices as you want. Note, how I space out every three numbers, this is because a vertex is made of X,Y,Z components. So we have our X, our Y, our Z then a space for the next three. &lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We need to do this before we start drawing, this tells OGL that we're going to feed it a vertex array from the client side (rather than the server, which is the graphics card).&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Ok, here is where we're telling OGL where to get it's vertices from. The first argument, tells OGL how many components (or floats) there are per vertex. Remember we talked about how we were spacing them out every 3 numbers? Here we're telling OGL that we did that! The next argument tells OpenGL that we're giving it floating point numbers. Now we have a &amp;quot;0&amp;quot;. This is called the stride, I could explain it in detail, but you don't need to understand it yet. Just leave it at 0. In the last argument we give OGL our vertex array!&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here is where the work is done. The first argument is telling OGL that we're drawing in triangles. (This can be GL_QUADS, GL_LINES, whatever!). The second is specifying where we want to start in the array we passed OGL earier. The last one is telling OpenGL how many vertices we want to draw. In this case, it's just the three.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Finally, we're disabling the vertex array state. We're done!&lt;br /&gt;
&lt;br /&gt;
So this is one of the ways to draw stuff in OpenGL. It's the next step up from glBegin and glEnd and it works fine in ES 1.1, so it works fine on the Pandora!&lt;br /&gt;
&lt;br /&gt;
== Drawing Textured Quads ==&lt;br /&gt;
&lt;br /&gt;
OpenGL can be great for speeding up your 2D application. One of the ways you do this, is by drawing with OpenGL rather than SDL. 2D games are made up of lots of sprites, which are just images that move about in a 2D world. You can use hardware acceleration to speed this up. If you're only planning on using 3D stuff on the Pandora, read this anyway, it introduces you to texturing with texture arrays and you're probably going to need to use sprites somewhere anyway. &lt;br /&gt;
&lt;br /&gt;
So, we can pick apart my method of sprite drawing in TINCS for this tutorial, I mainly use this function to draw text, once it's been rendered by SDL_ttf and converted into a OpenGL texture, but never mind any of that.&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=GLES&amp;diff=1079</id>
		<title>GLES</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=GLES&amp;diff=1079"/>
		<updated>2009-02-17T14:48:49Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Please don't skim over this tutorial, then just email me because you don't understand something. This tutorial has to be read in its entirety or you wont get it. If you're not up for that, then go find some other code you can copy paste, ya lazy bum. If you do have questions, I hang around on #TINCS in &amp;quot;irc.quakenet.org&amp;quot; or you can email me on &amp;quot;jack@sorok.co.uk&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Unfortunately, the OpenGL ES takes away many of the functions that beginner programmers use. They do this, because a lot of those functions are plain rubbish for any high-end application. We're only covering ES 1.1 here, but the Pandora also supports ES 2.0, which, leaves you with a handful of functions, you have to do all of the matrix math on your own. Which can be really hard if you're not good at maths, I'll cover how to do that in a later tutorial. What you're learning here isn't just for the Pandora, you should use these new methods in your Windows/Linux code. These changes are being made to the core OpenGL too, so you're loosing all of this stuff soon enough. Which is silly, OpenGL is good because beginners can pick it up easily. But whatever, I'm not in charge.&lt;br /&gt;
&lt;br /&gt;
== The Basics ==&lt;br /&gt;
&lt;br /&gt;
glBegin() and glEnd()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
glBegin(GL_TRIANGLES);&lt;br /&gt;
&lt;br /&gt;
    glVertex3f(1,0,0);&lt;br /&gt;
    glVertex3f(0,1,0);&lt;br /&gt;
    glVertex3f(-1,0,0);&lt;br /&gt;
&lt;br /&gt;
glEnd();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You know what I just did? Yeah, I drew a triangle! Nope, you can't draw stuff like this in OpenGL ES 1.1, so how would one draw a triangle in ES? Bare with me while you read this if you don't understand it, I'll explain it in depth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GLfloat vertices[] = {1,0,0 0,1,0 -1,0,0};&lt;br /&gt;
&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called drawing with a vertex array. Eww? Yeah, you would never draw like that in a real program, your vertex array would be stored already, you wouldn't have to define it every time you drew somthing. While it's messy for drawing primitives, it's really cool for drawing models, because your models vertices are generally stored in arrays like that already. I'll show you an example from TINCS after I explain this code.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
GLfloat vertices[] = {1,0,0 0,1,0 -1,0,0};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This ''should'' be obvious, we're simply creating an array that stores the vertices of our triangle. It can be of any size, you can store as many vertices as you want. Note, how I space out every three numbers, this is because a vertex is made of X,Y,Z components. So we have our X, our Y, our Z then a space for the next three. &lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We need to do this before we start drawing, this tells OGL that we're going to feed it a vertex array from the client side (rather than the server, which is the graphics card).&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Ok, here is where we're telling OGL where to get it's vertices from. The first argument, tells OGL how many components (or floats) there are per vertex. Remember we talked about how we were spacing them out every 3 numbers? Here we're telling OGL that we did that! The next argument tells OpenGL that we're giving it floating point numbers. Now we have a &amp;quot;0&amp;quot;. This is called the stride, I could explain it in detail, but you don't need to understand it yet. Just leave it at 0. In the last argument we give OGL our vertex array!&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here is where the work is done. The first argument is telling OGL that we're drawing in triangles. (This can be GL_QUADS, GL_LINES, whatever!). The second is specifying where we want to start in the array we passed OGL earier. The last one is telling OpenGL how many vertices we want to draw. In this case, it's just the three.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Finally, we're disabling the vertex array state. We're done!&lt;br /&gt;
&lt;br /&gt;
So this is one of the ways to draw stuff in OpenGL. It's the next step up from glBegin and glEnd and it works fine in ES 1.1, so it works fine on the Pandora!&lt;br /&gt;
&lt;br /&gt;
I have to go out now, but this tutorial should be finished this week.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=Development&amp;diff=1078</id>
		<title>Development</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=Development&amp;diff=1078"/>
		<updated>2009-02-17T13:49:36Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Getting your code onto the Pandora==&lt;br /&gt;
&lt;br /&gt;
*[[Setting up a cross-compiler]]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
&lt;br /&gt;
*[[PXML|PXML file structure guide]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=Development&amp;diff=1077</id>
		<title>Development</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=Development&amp;diff=1077"/>
		<updated>2009-02-17T13:49:25Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Getting your code onto the Pandora==&lt;br /&gt;
&lt;br /&gt;
*[[Setting up a cross-compiler]]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
&lt;br /&gt;
[[PXML|PXML file structure guide]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=Development_tutorials&amp;diff=1076</id>
		<title>Development tutorials</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=Development_tutorials&amp;diff=1076"/>
		<updated>2009-02-17T13:49:07Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== SDL Tutorials ==&lt;br /&gt;
&lt;br /&gt;
These tutorials assume you know the basics of C++ programming, and know your way around a C++ compiler.&lt;br /&gt;
&lt;br /&gt;
* [http://www.lazyfoo.net/SDL_tutorials/index.php Lazy Foo's Tutorials].  Not Pandora specific, but a good guide to getting your programming environment set up, along with many SDL tutorials.&lt;br /&gt;
* [http://iki.fi/sol/gp/ Sol's Graphics for beginners].  Not Pandora specific, but a good place to get started with SDL graphics coding.&lt;br /&gt;
&lt;br /&gt;
==OpenGL on the Pandora==&lt;br /&gt;
&lt;br /&gt;
*[[OpenGL ES 1.1 Tutorial]]&lt;br /&gt;
&lt;br /&gt;
*[[OpenGL ES 2.0 Tutorial]]&lt;br /&gt;
&lt;br /&gt;
*[[Combining OpenGL ES 1.1 and SDL to create a window on the Pandora]]&lt;br /&gt;
&lt;br /&gt;
== The Kernel ==&lt;br /&gt;
* [[Kernel build instructions|Compiling the Kernel from Git]]&lt;br /&gt;
* [[Kernel interface|Kernel Interface]]&lt;br /&gt;
&lt;br /&gt;
== Matchbox Window Manager ==&lt;br /&gt;
&lt;br /&gt;
* [[Matchbox|Matchbox version]]&lt;br /&gt;
* [[xoo on ubuntu|Setting up xoo on Ubuntu 8.04/8.10]] (Theme Testing and Development)&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Development Tools]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=Development&amp;diff=1075</id>
		<title>Development</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=Development&amp;diff=1075"/>
		<updated>2009-02-17T13:48:45Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Getting your code onto the Pandora==&lt;br /&gt;
&lt;br /&gt;
[[Setting up a cross-compiler]]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
&lt;br /&gt;
[[PXML|PXML file structure guide]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=Cross-compiler&amp;diff=1074</id>
		<title>Cross-compiler</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=Cross-compiler&amp;diff=1074"/>
		<updated>2009-02-17T13:47:53Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''I'm still sorting this out myself, I'm going to give a short tutorial about compiling something from the Windows command line, the rest will be explained when the Pandora is released''&lt;br /&gt;
&lt;br /&gt;
What you need:  &lt;br /&gt;
&lt;br /&gt;
- Patience&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To compile your applications to the ARM architecture you're going to need a cross-compiler. Luckily, Code-Sourcery hosts a bunch of cross-compiling suites for various platforms on their site, some editions have to be paid for, but they do have &amp;quot;lite&amp;quot; editions without support that are completely free.&lt;br /&gt;
&lt;br /&gt;
Head up onto here, http://www.codesourcery.com/sgpp/lite/arm/releases/2007q3&lt;br /&gt;
&lt;br /&gt;
You want the  &amp;quot;ARM GNU/Linux&amp;quot; option, then choose whichever operating system you're running bellow.&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=Development&amp;diff=1073</id>
		<title>Development</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=Development&amp;diff=1073"/>
		<updated>2009-02-17T13:45:43Z</updated>

		<summary type="html">&lt;p&gt;Butterman: /* OpenGL on the Pandora */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Getting your code onto the Pandora==&lt;br /&gt;
&lt;br /&gt;
[[Setting up a cross-compiler]]&lt;br /&gt;
&lt;br /&gt;
==OpenGL on the Pandora==&lt;br /&gt;
&lt;br /&gt;
[[OpenGL ES 1.1 Tutorial]]&lt;br /&gt;
&lt;br /&gt;
[[OpenGL ES 2.0 Tutorial]]&lt;br /&gt;
&lt;br /&gt;
[[Combining OpenGL ES 1.1 and SDL to create a window on the Pandora]]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
&lt;br /&gt;
[[PXML|PXML file structure guide]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=Development&amp;diff=1072</id>
		<title>Development</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=Development&amp;diff=1072"/>
		<updated>2009-02-17T13:45:29Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Getting your code onto the Pandora==&lt;br /&gt;
&lt;br /&gt;
[[Setting up a cross-compiler]]&lt;br /&gt;
&lt;br /&gt;
==OpenGL on the Pandora==&lt;br /&gt;
&lt;br /&gt;
[[OpenGL ES 1.1 Tutorial]]&lt;br /&gt;
[[OpenGL ES 2.0 Tutorial]]&lt;br /&gt;
[[Combining OpenGL ES 1.1 and SDL to create a window on the Pandora]]&lt;br /&gt;
&lt;br /&gt;
[[PXML|PXML file structure guide]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=Development&amp;diff=1071</id>
		<title>Development</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=Development&amp;diff=1071"/>
		<updated>2009-02-17T13:44:43Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Getting your code onto the Pandora==&lt;br /&gt;
&lt;br /&gt;
[[Setting up a cross-compiler]]&lt;br /&gt;
&lt;br /&gt;
==OpenGL on the Pandora==&lt;br /&gt;
&lt;br /&gt;
[[OpenGL ES 1.1 Tutorial]]&lt;br /&gt;
&lt;br /&gt;
[[PXML|PXML file structure guide]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=GLES&amp;diff=1070</id>
		<title>GLES</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=GLES&amp;diff=1070"/>
		<updated>2009-02-17T13:42:38Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Please don't skim over this tutorial, then just email me because you don't understand something. This tutorial has to be read in its entirety or you wont get it. If you're not up for that, then go find some other code you can copy paste, ya lazy bum. If you do have questions, I hang around on #TINCS in &amp;quot;irc.quakenet.org&amp;quot; or you can email me on &amp;quot;jack@sorok.co.uk&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Unfortunately, the OpenGL ES takes away many of the functions that beginner programmers use. They do this, because a lot of those functions are plain rubbish for any high-end application. We're only covering ES 1.1 here, but the Pandora also supports ES 2.0, which, leaves you with a handful of functions, you have to do all of the matrix math on your own. Which can be really hard if you're not good at maths, I'll cover how to do that in a later tutorial. What you're learning here isn't just for the Pandora, you should use these new methods in your Windows/Linux code. These changes are being made to the core OpenGL too, so you're loosing all of this stuff soon enough. Which is silly, OpenGL is good because beginners can pick it up easily. But whatever, I'm not in charge.&lt;br /&gt;
&lt;br /&gt;
== The Basics ==&lt;br /&gt;
&lt;br /&gt;
glBegin() and glEnd()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
glBegin(GL_TRIANGLES);&lt;br /&gt;
&lt;br /&gt;
    glVertex3f(1,0,0);&lt;br /&gt;
    glVertex3f(0,1,0);&lt;br /&gt;
    glVertex3f(-1,0,0);&lt;br /&gt;
&lt;br /&gt;
glEnd();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You know what I just did? Yeah, I drew a triangle! Nope, you can't draw stuff like this in OpenGL ES 1.1, so how would one draw a triangle in ES? Bare with me while you read this if you don't understand it, I'll explain it in depth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GLfloat vertices[] = {1,0,0 0,1,0 -1,0,0};&lt;br /&gt;
&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called drawing with a vertex array. Eww? Yeah, you would never draw like that in a real program, your vertex array would be stored already, you wouldn't have to define it every time you drew somthing. While it's messy for drawing primitives, it's really cool for drawing models, because your models vertices are generally stored in arrays like that already. I'll show you an example from TINCS after I explain this code.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
GLfloat vertices[] = {1,0,0 0,1,0 -1,0,0};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This ''should'' be obvious, we're simply creating an array that stores the vertices of our triangle. It can be of any size, you can store as many vertices as you want. Note, how I space out every three numbers, this is because a vertex is made of X,Y,Z components. So we have our X, our Y, our Z then a space for the next three. &lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We need to do this before we start drawing, this tells OGL that we're going to feed it a vertex array from the client side (rather than the server, which is the graphics card).&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Ok, here is where we're telling OGL where to get it's vertices from. The first argument, tells OGL how many components (or floats) there are per vertex. Remember we talked about how we were spacing them out every 3 numbers? Here we're telling OGL that we did that! The next argument tells OpenGL that we're giving it floating point numbers. Now we have a &amp;quot;0&amp;quot;. This is called the stride, I could explain it in detail, but you don't need to understand it yet. Just leave it at 0. In the last argument we give OGL our vertex array!&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here is where the work is done. The first argument is telling OGL that we're drawing in triangles. (This can be GL_QUADS, GL_LINES, whatever!). The second is specifying where we want to start in the array we passed OGL earier. The last one is telling OpenGL how many vertices we want to draw. In this case, it's just the three.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Finally, we're disabling the vertex array state. We're done!&lt;br /&gt;
&lt;br /&gt;
So this is one of the ways to draw stuff in OpenGL. It's the next step up from glBegin and glEnd and it works fine in ES 1.1, so it works fine on the Pandora!&lt;br /&gt;
&lt;br /&gt;
I have to go out now, but this tutorial should be finished this week.&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=GLES&amp;diff=1069</id>
		<title>GLES</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=GLES&amp;diff=1069"/>
		<updated>2009-02-17T13:41:05Z</updated>

		<summary type="html">&lt;p&gt;Butterman: New page: ''Please don't skim over this tutorial, then just email me because you don't understand something. This tutorial has to be read in its entirety or you wont get it. If you're not up for tha...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Please don't skim over this tutorial, then just email me because you don't understand something. This tutorial has to be read in its entirety or you wont get it. If you're not up for that, then go find some other code you can copy paste, ya lazy bum. If you do have questions, I hang around on #TINCS in &amp;quot;irc.quakenet.org&amp;quot; or you can email me on &amp;quot;jack@sorok.co.uk&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Unfortunately, the OpenGL ES takes away many of the functions that beginner programmers use. They do this, because a lot of those functions are plain rubbish for any high-end application. We're only covering ES 1.1 here, but the Pandora also supports ES 2.0, which, leaves you with a handful of functions, you have to do all of the matrix math on your own. Which can be really hard if you're not good at maths, I'll cover how to do that in a later tutorial. What you're learning here isn't just for the Pandora, you should use these new methods in your Windows/Linux code. These changes are being made to the core OpenGL too, so you're loosing all of this stuff soon enough. Which is silly, OpenGL is good because beginners can pick it up easily. But whatever, I'm not in charge.&lt;br /&gt;
&lt;br /&gt;
== The Basics ==&lt;br /&gt;
&lt;br /&gt;
glBegin() and glEnd()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
glBegin(GL_TRIANGLES);&lt;br /&gt;
&lt;br /&gt;
    glVertex3f(1,0,0);&lt;br /&gt;
    glVertex3f(0,1,0);&lt;br /&gt;
    glVertex3f(-1,0,0);&lt;br /&gt;
&lt;br /&gt;
glEnd();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You know what I just did? Yeah, I drew a triangle! Nope, you can't draw stuff like this in OpenGL ES 1.1, so how would one draw a triangle in ES? Bare with me while you read this if you don't understand it, I'll explain it in depth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GLfloat vertices[] = {1,0,0 0,1,0 -1,0,0};&lt;br /&gt;
&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called drawing with a vertex array. Eww? Yeah, you would never draw like that in a real program. While it's messy for drawing primitives, it's really cool for drawing models, because your models vertices are generally stored in arrays like that already. I'll show you an example from TINCS after I explain this code.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
GLfloat vertices[] = {1,0,0 0,1,0 -1,0,0};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This ''should'' be obvious, we're simply creating an array that stores the vertices of our triangle. It can be of any size, you can store as many vertices as you want. Note, how I space out every three numbers, this is because a vertex is made of X,Y,Z components. So we have our X, our Y, our Z then a space for the next three. &lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glEnableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We need to do this before we start drawing, this tells OGL that we're going to feed it a vertex array from the client side (rather than the server, which is the graphics card).&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glVertexPointer(3, GL_FLOAT, 0, vertices);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Ok, here is where we're telling OGL where to get it's vertices from. The first argument, tells OGL how many components (or floats) there are per vertex. Remember we talked about how we were spacing them out every 3 numbers? Here we're telling OGL that we did that! The next argument tells OpenGL that we're giving it floating point numbers. Now we have a &amp;quot;0&amp;quot;. This is called the stride, I could explain it in detail, but you don't need to understand it yet. Just leave it at 0. In the last argument we give OGL our vertex array!&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDrawArrays(GL_TRIANGLES, 0, 3);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here is where the work is done. The first argument is telling OGL that we're drawing in triangles. (This can be GL_QUADS, GL_LINES, whatever!). The second is specifying where we want to start in the array we passed OGL earier. The last one is telling OpenGL how many vertices we want to draw. In this case, it's just the three.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
glDisableClientState(GL_VERTEX_ARRAY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Finally, we're disabling the vertex array state. We're done!&lt;br /&gt;
&lt;br /&gt;
So this is one of the ways to draw stuff in OpenGL. It's the next step up from glBegin and glEnd and it works fine in ES 1.1, so it works fine on the Pandora!&lt;br /&gt;
&lt;br /&gt;
I have to go out now, but this tutorial should be finished this week.&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=Development&amp;diff=1068</id>
		<title>Development</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=Development&amp;diff=1068"/>
		<updated>2009-02-17T12:55:53Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Setting up a cross-compiler]]&lt;br /&gt;
&lt;br /&gt;
[[OpenGL ES 1.1 Tutorial]]&lt;br /&gt;
&lt;br /&gt;
[[PXML|PXML file structure guide]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=Cross-compiler&amp;diff=1067</id>
		<title>Cross-compiler</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=Cross-compiler&amp;diff=1067"/>
		<updated>2009-02-17T12:50:57Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What you need:  &lt;br /&gt;
&lt;br /&gt;
- Patience&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To compile your applications to the ARM architecture you're going to need a cross-compiler. Luckily, Code-Sourcery hosts a bunch of cross-compiling suites for various platforms on their site, some editions have to be paid for, but they do have &amp;quot;lite&amp;quot; editions without support that are completely free.&lt;br /&gt;
&lt;br /&gt;
Head up onto here, http://www.codesourcery.com/sgpp/lite/arm/releases/2007q3&lt;br /&gt;
&lt;br /&gt;
You want the  &amp;quot;ARM GNU/Linux&amp;quot; option, then choose whichever operating system you're running bellow.&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=Cross-compiler&amp;diff=1066</id>
		<title>Cross-compiler</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=Cross-compiler&amp;diff=1066"/>
		<updated>2009-02-17T12:50:26Z</updated>

		<summary type="html">&lt;p&gt;Butterman: /* Setting up a cross compiler */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;nowiki&amp;gt;What you need:&lt;br /&gt;
- Patience&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile your applications to the ARM architecture you're going to need a cross-compiler. Luckily, Code-Sourcery hosts a bunch of cross-compiling suites for various platforms on their site, some editions have to be paid for, but they do have &amp;quot;lite&amp;quot; editions without support that are completely free.&lt;br /&gt;
&lt;br /&gt;
Head up onto here, http://www.codesourcery.com/sgpp/lite/arm/releases/2007q3&lt;br /&gt;
&lt;br /&gt;
You want the  &amp;quot;ARM GNU/Linux&amp;quot; option, then choose whichever operating system you're running bellow.&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=Cross-compiler&amp;diff=1065</id>
		<title>Cross-compiler</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=Cross-compiler&amp;diff=1065"/>
		<updated>2009-02-17T12:50:08Z</updated>

		<summary type="html">&lt;p&gt;Butterman: New page: == Setting up a cross compiler ==  What you need: - Patience   To compile your applications to the ARM architecture you're going to need a cross-compiler. Luckily, Code-Sourcery hosts a bu...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Setting up a cross compiler ==&lt;br /&gt;
&lt;br /&gt;
What you need:&lt;br /&gt;
- Patience&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To compile your applications to the ARM architecture you're going to need a cross-compiler. Luckily, Code-Sourcery hosts a bunch of cross-compiling suites for various platforms on their site, some editions have to be paid for, but they do have &amp;quot;lite&amp;quot; editions without support that are completely free.&lt;br /&gt;
&lt;br /&gt;
Head up onto here, http://www.codesourcery.com/sgpp/lite/arm/releases/2007q3&lt;br /&gt;
&lt;br /&gt;
You want the  &amp;quot;ARM GNU/Linux&amp;quot; option, then choose whichever operating system you're running bellow.&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
	<entry>
		<id>https://pandorawiki.org/index.php?title=Development&amp;diff=1064</id>
		<title>Development</title>
		<link rel="alternate" type="text/html" href="https://pandorawiki.org/index.php?title=Development&amp;diff=1064"/>
		<updated>2009-02-17T12:41:16Z</updated>

		<summary type="html">&lt;p&gt;Butterman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[[Setting up a cross-compiler]]&lt;br /&gt;
&lt;br /&gt;
[[PXML|PXML file structure guide]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Butterman</name></author>
		
	</entry>
</feed>