¡@

Home 

2014/10/15 ¤U¤È 10:08:27

iphone Programming Glossary: erasebuffer

Erase using brush in GLPaint

http://stackoverflow.com/questions/4048811/erase-using-brush-in-glpaint

green brushColourGreen blue brushColourBlue above the code Render the vertex array glVertexPointer 2 GL_FLOAT 0 eraseBuffer glDrawArrays GL_POINTS 0 vertexCount Note you'll need to implement isEraserBrushType and store brushColourRed brushColourGreen..

Undo drawing in Paint Application

http://stackoverflow.com/questions/6689600/undo-drawing-in-paint-application

Erase NO glColor4f app.rg app.bg app.gg kBrushOpacity void drawErase CGPoint start toPoint CGPoint end static GLfloat eraseBuffer NULL static NSUInteger eraseMax 64 NSUInteger vertexCount 0 count i EAGLContext setCurrentContext context glBindFramebufferOES.. scale 1.0 self.contentScaleFactor start.x scale start.y scale end.x scale end.y scale Allocate vertex array buffer if eraseBuffer NULL eraseBuffer malloc eraseMax 2 sizeof GLfloat Add points to the buffer so there are drawing points every X pixels count.. start.x scale start.y scale end.x scale end.y scale Allocate vertex array buffer if eraseBuffer NULL eraseBuffer malloc eraseMax 2 sizeof GLfloat Add points to the buffer so there are drawing points every X pixels count MAX ceilf sqrtf..