stack overflow creating a vertex buffer?
Code:
//Initialize ARB
glGenBuffersARB(1, &bufferIdentifier);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, bufferIdentifier);
int bufferLength = m_maxParticles * 3 * 4 * sizeof(GLfloat);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, bufferLength, NULL, GL_STREAM_DRAW_ARB);
GLenum er = glGetError();It's producing an error value of 1283, which is 0x0503 and a GL_STACK_OVERFLOW error. Unless my math is off, what's going on here? It's not a memory error, and it shouldn't be, since even with 10000 particles that's only a half a megabyte, and with 128 megabytes of VRAM, that's not even a dent.
the stack overflow can only come from glPushMatrix, I believe. Those calls aren't at fault. Use the OpenGL profiler's break on error functionality to find the real culprit.
Huh, yeah, you're right. I found a glPushMatrix in another part of my code that I accidentaly wrote glPushMatrix when I was trying to pop it back off. Odd thing is, it's never caused a problem and that bit of code has been in there since the beginning. Will a GL_STACK_OVERFLOW error just disallow any further stack manipulations instead of terminate the program?
yup.
you should always check for GL errors at least once per frame.
you should always check for GL errors at least once per frame.
How does glGetError determine which error it produces? If there are multiple errors, does it return the most recent or the most important(program terminating errors)?
There can be multiple errors flagged simultaneously. They are returned in unspecified order.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Vertex buffer generation and rendering iphone | eliscool | 2 | 2,378 |
Dec 17, 2008 05:57 PM Last Post: ThemsAllTook |
|
| New Apple Render to Vertex Buffer Sample | OneSadCookie | 13 | 6,672 |
Oct 15, 2006 01:10 AM Last Post: OneSadCookie |
|

