Hey - just starting out trying to get some openGL into my iphone app and came across this error for this bit of code:
static const GLfloat pyramidVertices[] = {
0.0f, 1.0f, 0.0f,
-1.0f, -1.0f, 1.0f,
1.0f, -1.0f, 1.0f,
1.0f, -1.0f, -1.0f,
-1.0f, -1.0f, -1.0f
};
am I not including something I should be? Withou...
I have this for now:
//Setup a move to the current position.
glLoadIdentity();
glTranslatef(squarePosition.x, squarePosition.y, 0);
//A simple base texture for "diffuse map".
glBindTexture(GL_TEXTURE_2D, spriteTexture[0]); //Bind.
//Draw vertex/texture into the framebuffer.
glVertexPointer(2, GL_FLOAT, 0, spriteVer...
Hello,
I have created a simlpe Opengl ES application, a sphere bouncing back and forth in a room. When running on simulator it works fine. I have configured the simulator to be HW 3.0, from xCode I chose Simulator - 3.0|Debug. Since I only have a 3G, not 3Gs, I assume this should give the same result?
What can the reason be and how th...
Hi!
with
glMatrixMode(GL_TEXTURE);
..some matrix operations...
i can change the current texture transformation matrix. However - it seems it affects not all texture units (i'm using multitexturing)
how can i change the texture matrix for different texture units?
thanks!
...
Hello,
Following this : http://stackoverflow.com/questions/2125354/best-approach-for-oldschool-2d-zelda-like-game
I got a simple 2D tiles generator working, im reading an int map[100][100] filled with either 1's or 0's and draw tiles according to their tile id, 0 is water, 1 grass.
Im using some basic Numpad control handler, using a c...
I have a texture from this PNG:
And another from this PNG:
They both have the same blend function:
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
I want to see them on one single polygon first. I just couldn't find a simple example of this. Draw them to different polygons works perfect, but I just cannot "merge" them into one text...
I want to clip specific area from texture and given set of coordinates.
So I can use CGContextMoveToPoint and CGContextAddLineToPoint to clip it:
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(NULL, pageWidth, 480, 8, 4 * pageWidth, colorSpace, kCGImageAlphaPremultipliedFirst);...
I'm porting an iPhone app to Android, and I need to use OpenGL framebuffers. I have a Nexus One, and a call to glGet(GL_EXTENSIONS) shows that the Nexus One supports the same framebuffer extension as the iPhone. However, I can't seem to call functions related to the OpenGL extension in my GLSurfaceView. When I call a simple framebuffer g...
I have a texture with transparency (the white triangle with that lighting information), and just can't make it's alpha variable.
The drawing code, with the missing piece:
//Place polygon vertices to the bottom left within the view.
glLoadIdentity();
glTranslatef(centerX, centerY, 0);
//Draw "diffuse" layer.
glBindTexture(G...
I want to clip some closed path area from texture image in OpenGL ES and iPhone SDK.
I found that it can be done with planes and glClipPlanef function something like this:
glClipPlanef(GL_CLIP_PLANE0, v);
glEnable(GL_CLIP_PLANE0);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glDisable(GL_CLIP_PLANE0);
where v is a const GLfloat array...
I'm planning making a game for AppStore, so I'm studying GLES.
But, GLES 1.1 and 2.0 APIs are different about handling in some features.(and limitations)
I have not enough time to consider both of them, I have to choosing one.
2.0 is clearly better in developer's view, but I'm worry about it's market share. I wish most users moved on ne...
I am doing a little experiment with OpenGL ES on Nexus One. Got a problem about the full screen resolution. It seems like I can never get the real full resolution of Nexus One, which is 480*800. I am using an orthogonal projection and just want to draw a simple triangle with identity model view matrix:
@Override
public void sizeChange...
I saw this Google IO session: http://code.google.com/intl/iw/events/io/2009/sessions/WritingRealTimeGamesAndroid.html
He says that the draw_texture function is the fastest and VBO is 2nd faster.
But I don't understand how to use it(the draw_texture method or the VBO way).
Any suggestion?
...
Hi, I am very new to OpenGL ES. I am implementing some demo app to load multiple textures on the screen. For demo purpose I have loaded 2 textures in 2 different locations on the screen using glTranslatef() and glBindTextures() twice.
Now I am able to see 2 different images on the screen. Now I want to move one particular texture across...
I'm learning GLES. There are many pair functions like glClientActiveTexture/glActiveTexture.
What's the difference of them? (Especially the case of glClientActiveTexture)
...
Looking to do classic OpenGL mouse picking in ES. I'd prefer not to use third party libs, GLU ports and OpenGL name stacks, etc, are out. This pretty much leaves inverse view transformation and ray intersection, correct?
I've gotten pretty far with the help of:
http://trac.bookofhook.com/bookofhook/trac.cgi/wiki/MousePicking
http://ei...
Hello, all!
I need in antialiasing in iPhone 3G (OpenGL ES1.1), NOT iPhone 3Gs with OpenGL ES.2.0.
I've draw 3d model and have next: pixels on the edges of the model look like teeth.
I've try set any filters for texture, but this filters making ONLY texture INSIDE look better.
How can i make good antialising ?
May be i should use any ...
Can you blend Java and native OpenGL calls. For instance having the setup happen in the onSurfaceCreated, but having the onDraw call into native code (or even both)? I'm having trouble getting native code to render, but can't tell if this could be a problem or if I'm throwing c++ exceptions, but they don't bubble up...
private stati...
Hello everyone, this is my question.
I'm developing a game on iPhone with OpenGL ES. I began my development using the Xcode template OpenGL ES Application, with one EAGLView, etc.
My menu view and game view use the same OGL view but now I want to add score ranking so I need a keyboard and a text field to write name, and some labels or ...
I understand that an upgrade to the iPhone OS upgraded the OpenGL ES version support from 1.1 to 2.0. What I haven't been able to find is whether effort should be made to use 1.1 for backwards compatibility with older devices.
Xcode seems to suggest I using 2.0, since it only seems to include that version.
Should I use 2.0 and not loo...