Jump to content
  • Advertisement

Blips

Member
  • Content count

    33
  • Joined

  • Last visited

Everything posted by Blips

  1. I've been wracking my head trying to figure this out for some time now and it's clear that I need some outside help.   I have some VBOs/IBOs that I render through the following method. Batch objects just group data based on common textures: - (void)render { // if the buffer is empty, don't waste time if ([indexBuffer getCurrentSize] <= 0) return; //binding shared buffer objects glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, [indexBuffer getID]); glBindBuffer(GL_ARRAY_BUFFER, [vertexBuffer getID]); glVertexPointer(3, GL_FLOAT, sizeof(struct Vertex), (char *)NULL + 0); glTexCoordPointer(2, GL_FLOAT, sizeof(struct Vertex), (char *)NULL + 12); glNormalPointer(GL_FLOAT, sizeof(struct Vertex), (char *)NULL + 20); glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(struct Vertex), (char *)NULL + 32); DynamicArray *renderBatches = [indexBuffer getRenderBatches]; RenderBatch *batch; for (int i = 0; i < [indexBuffer getActiveBatchCount]; i++) { batch = (RenderBatch *)[renderBatches get:i]; [BufferManager setTextureID:[batch getTextureID]]; // render the subset batch of geometry glDrawElements(GL_TRIANGLES, [batch getIndexCount], GL_UNSIGNED_SHORT, (GLvoid *)[batch getIndexBatchOffset]); } glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, 0); } IBOs are setup via: - (void)build { glGenBuffers(1, &bufferID); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferID); glBufferData(GL_ELEMENT_ARRAY_BUFFER, bufferSize, NULL, GL_DYNAMIC_DRAW); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); curBufferSize = bufferSize; } While VBOs are setup via: - (void)build { glGenBuffers(1, &bufferID); glBindBuffer(GL_ARRAY_BUFFER, bufferID); glBufferData(GL_ARRAY_BUFFER, bufferSize, NULL, GL_DYNAMIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); curBufferSize = bufferSize; } IBOs get data with: - (void)updateData:(GraphicElement *)ge_ { RenderBatch *batch; GLuint textureID; //updating the index offset of the ge [ge_ setIndexOffset:curBufferSize / sizeof(unsigned short)]; glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferID); glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, curBufferSize, [ge_ getIndexCount] * sizeof(unsigned short), [ge_ getIndices]); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); // working with render batches textureID = [[[ge_ getElement] getParent] getOpenGLTextureID]; // if first graphic element if (activeBatchCount == 0) { // pseudocode: create first batch } // otherwise try and match new graphic element's texture id with batch already in use else { // pseudocode: find batch with matching texture id, or create new batch } curBufferSize += [ge_ getIndexCount] * sizeof(unsigned short); } VBOs get data from: - (void)updateData:(GraphicElement *)ge_ { glBindBuffer(GL_ARRAY_BUFFER, bufferID); glBufferSubData(GL_ARRAY_BUFFER, curBufferSize, [ge_ getVertexCount] * sizeof(struct Vertex), [ge_ getVertices]); glBindBuffer(GL_ARRAY_BUFFER, 0); curBufferSize += [ge_ getVertexCount] * sizeof(struct Vertex); } Now, for the actual problem: Visually, there are no issues at all. The game renders perfectly and is 100% stable. However, when running the OpenGL ES Analyzer, I get thousands of the following warning: "Your application made a drawing call using a buffer that contains uninitialized data. If a draw call uses uninitialized data, the rendering results are incorrect and unpredictable. One way to fix this issue is to provide the buffer data to any BufferData calls instead of a NULL pointer." Example of Responsible Command column: glDrawElements(GL_TRIANGLES, 1056, GL_UNSIGNED_SHORT, NULL) I'm working with OpenGL ES 1.1 (I plan on moving on to 2.0 or 3.0 for my next game) and the OpenGL instrument was running on an iPad Air with iOS 7.x.   If anyone has any insight into how to correct these warnings, that would be amazingly helpful!
  2. Pandemic 2.5, an expanded and refined version of my popular flash game Pandemic 2, has hit the App Store today for iPads, iPhones and iPod Touches. So far the response has been great, but since this is my first commercial effort, I'm attempting to branch out and reach as many people as possible without spending money I don't have on marketing. Brief feature highlights: Create your very own custom disease and watch as it spreads across the world through the human population. Combine real symptoms to produce the most infectious and deadly disease the world has ever seen. Select from Viral, Bacterial or Parasitic disease classes based on your play-style. Outmaneuver governments, health organizations and doctors as the human world tries to prevent the spread of your disease through vaccine research, quarantines, body disposal, martial laws and more. Be opportunistic: take advantage of natural disasters whenever and wherever they may strike. Unlock achievements and compare highscores will full Game Center support. Purchase once for just $0.99, and enjoy the game on any of your devices. More info and screens available on my site: www.darkrealmstudios.com Link to Pandemic 2.5 in the App Store: http://itunes.apple....37492?ls=1&mt=8 And a special thank you to GameDev and its members for their insight and help!
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!