¡@

Home 

2014/10/15 ¤U¤È 10:09:38

iphone Programming Glossary: glcolor4f

Drawing into OpenGL ES framebuffer and getting UIImage from it on iPhone

http://stackoverflow.com/questions/10936157/drawing-into-opengl-es-framebuffer-and-getting-uiimage-from-it-on-iphone

colorRenderbuffer should I do this glEnableClientState GL_VERTEX_ARRAY glVertexPointer 2 GL_FLOAT 0 line glColor4f 1.0 0.0 0.0 1.0 glLineWidth 10 glDrawArrays GL_LINES 0 2 draw line with two points myContext presentRenderbuffer GL_RENDERBUFFER_OES..

Applying brightness and contrast with OpenGL ES

http://stackoverflow.com/questions/1506299/applying-brightness-and-contrast-with-opengl-es

GL_TEXTURE_ENV GL_TEXTURE_ENV_MODE GL_COMBINE if brightness 1.0f glTexEnvi GL_TEXTURE_ENV GL_COMBINE_RGB GL_ADD glColor4f brightness 1 brightness 1 brightness 1 brightness 1 else glTexEnvi GL_TEXTURE_ENV GL_COMBINE_RGB GL_SUBTRACT glColor4f 1.. glColor4f brightness 1 brightness 1 brightness 1 brightness 1 else glTexEnvi GL_TEXTURE_ENV GL_COMBINE_RGB GL_SUBTRACT glColor4f 1 brightness 1 brightness 1 brightness 1 brightness glTexEnvi GL_TEXTURE_ENV GL_SRC0_RGB GL_TEXTURE glTexEnvi GL_TEXTURE_ENV.. GL_RGB_SCALE 2 glTexEnvi GL_TEXTURE_ENV GL_COMBINE_ALPHA GL_REPLACE glTexEnvi GL_TEXTURE_ENV GL_SRC0_ALPHA GL_PREVIOUS glColor4f h h h 0.75 0.5 h 2x extrapolation validateTexEnv glDrawArrays GL_TRIANGLE_STRIP 0 4 Restore state glDisable GL_TEXTURE_2D..

OpenGL ES render to texture, then draw texture

http://stackoverflow.com/questions/1649222/opengl-es-render-to-texture-then-draw-texture

glClear GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT glEnableClientState GL_TEXTURE_COORD_ARRAY glEnable GL_TEXTURE_2D glColor4f 1 1 1 1 texture drawInRect CGRectMake 0 0 320 480 glDisableClientState GL_TEXTURE_COORD_ARRAY glDisable GL_TEXTURE_2D self..

How do I create blurred text in an iPhone view?

http://stackoverflow.com/questions/227305/how-do-i-create-blurred-text-in-an-iphone-view

0 .x glTexCoordPointer 2 GL_FLOAT sizeof V2fT2f quad 0 .s glTexEnvi GL_TEXTURE_ENV GL_TEXTURE_ENV_MODE GL_MODULATE glColor4f 1.0 5 1.0 5 1.0 5 1.0 validateTexEnv glDrawArrays GL_TRIANGLE_STRIP 0 4 Pass two accumulate two rotated linear samples glTexParameteri.. glTexEnvi GL_TEXTURE_ENV GL_COMBINE_ALPHA GL_REPLACE glTexEnvi GL_TEXTURE_ENV GL_SRC0_ALPHA GL_PRIMARY_COLOR glColor4f 0.5 0.5 0.5 2.0 5 validateTexEnv glDrawArrays GL_TRIANGLE_STRIP 0 4 Pass three accumulate two rotated linear samples for..

OpenGL ES; rendering texture created from CGBitmapContext

http://stackoverflow.com/questions/2713890/opengl-es-rendering-texture-created-from-cgbitmapcontext

primitives glMatrixMode GL_PROJECTION glLoadIdentity glOrthof 0 xSize 0 ySize 1.0f 1.0f glMatrixMode GL_MODELVIEW glColor4f 1.0f 1.0f 1.0f 1.0f glEnable GL_TEXTURE_2D glBlendFunc GL_ONE GL_SRC_COLOR GLuint texture 1 glGenTextures 1 texture 0 glBindTexture..

Erase using brush in GLPaint

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

CGPoint start toPoint CGPoint end method by having the condition if isEraserBrushType glBlendFunc GL_ONE GL_ZERO glColor4f 0 0 0 0.0 else glBlendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA self setBrushColorWithRed brushColourRed green brushColourGreen..

OpenGL ES 1.1: How to change texture color without losing luminance?

http://stackoverflow.com/questions/4361023/opengl-es-1-1-how-to-change-texture-color-without-losing-luminance

color of in code so any color can be used. So I have only one texture that basically has luminance. I've been using glColor4f 1f 0f 0f 1f to apply the color. Every blendfunc I've tried that has come close to working ends up like the last picture.. android opengl es share improve this question Here is a solution that might be close to what you're looking for glColor4f 1.0f 0.0f 0.0f 1.0f glActiveTexture GL_TEXTURE0 glEnable GL_TEXTURE_2D glBindTexture GL_TEXTURE_2D spriteTexture glTexEnvi..

Can example “GLImageProcessing” work with multi filters

http://stackoverflow.com/questions/4375479/can-example-glimageprocessing-work-with-multi-filters

GL_COMBINE static GLfloat constColor 4 0.1 0.2 0.3 0.4 if t 1.0f glTexEnvi GL_TEXTURE_ENV GL_COMBINE_RGB GL_ADD glColor4f t 1 t 1 t 1 t 1 constColor 0 t 1 constColor 1 t 1 constColor 2 t 1 constColor 3 t 1 else glTexEnvi GL_TEXTURE_ENV GL_COMBINE_RGB.. GL_RGB_SCALE 2 glTexEnvi GL_TEXTURE_ENV GL_COMBINE_ALPHA GL_REPLACE glTexEnvi GL_TEXTURE_ENV GL_SRC0_ALPHA GL_PREVIOUS glColor4f h h h 0.75 0.5 h 2x extrapolation validateTexEnv glDrawArrays GL_TRIANGLE_STRIP 0 4 save to file snapshot result test3.jpg..

Getting a Maya Model into the iPhone

http://stackoverflow.com/questions/4675475/getting-a-maya-model-into-the-iphone

glVertexPointer 3 GL_FLOAT sizeof vertices 0 6 vertices 0 glNormalPointer GL_FLOAT sizeof vertices 0 6 vertices 3 glColor4f R G B 1 range 0 1 glDrawArrays GL_TRIANGLES 0 numVertices number of floats in array divided by 6 glDisableClientState GL_VERTEX_ARRAY..

Undo drawing in Paint Application

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

self playRayundo void playRayundo artbrushAppDelegate app artbrushAppDelegate UIApplication sharedApplication delegate glColor4f app.r1g app.b1g app.g1g 0 NSLog @ f app.r1g if undo NULL for int l 0 l undo count l replays my writRay 1 because of location.. objectAtIndex l objectAtIndex p CGPointValue toPoint undo objectAtIndex l objectAtIndex p 1 CGPointValue Erase NO glColor4f app.rg app.bg app.gg kBrushOpacity void drawErase CGPoint start toPoint CGPoint end static GLfloat eraseBuffer NULL static..

How to draw a line with Cocos2d-iPhone

http://stackoverflow.com/questions/691648/how-to-draw-a-line-with-cocos2d-iphone

onto the Layer uding drawLine. Here's by current attempt. @implementation MyLayer id init self super init if self nil glColor4f 0.8 1.0 0.76 1.0 glLineWidth 2.0f CocosNode line drawLine 10.0f 100.0f 400.0f 27.0f self addChild line z 1 return self @end.. I'm doing it wrong but hopefully you can see my reasoning. I've also tried this id init self super init if self nil glColor4f 0.8 1.0 0.76 1.0 glLineWidth 2.0f drawLine 10.0f 100.0f 400.0f 27.0f return self Which doesn't give me an error but it doesn't..