¡@

Home 

2014/10/15 ¤U¤È 10:13:56

iphone Programming Glossary: setcurrentcontext

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

init if self initializing context myContext EAGLContext alloc initWithAPI kEAGLRenderingAPIOpenGLES2 EAGLContext setCurrentContext myContext self setupOpenGL creating buffers return self void setupOpenGL int width 256 int height 256 generating buffers.. @ failed to make complete framebuffer object x status UIImage renderImage int width 256 int height 256 EAGLContext setCurrentContext myContext glEnable GL_DEPTH_TEST clear color cyan glClearColor 0.0f 1.0f 1.0f 1.0f glClear GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT..

How do I blend two textures with different co-ordinates in OpenGL ES 2.0 on iPhone?

http://stackoverflow.com/questions/12242443/how-do-i-blend-two-textures-with-different-co-ordinates-in-opengl-es-2-0-on-ipho

textures in one rectangle the first image I used the following code.. Objective C code... void display EAGLContext setCurrentContext context glBindFramebuffer GL_FRAMEBUFFER targetFBO glUseProgram program glActiveTexture GL_TEXTURE2 glBindTexture GL_TEXTURE_2D..

UITableView & UIScrollview stop cocos2d animations

http://stackoverflow.com/questions/15185720/uitableview-uiscrollview-stop-cocos2d-animations

make black screen i shows everything but still bad performance. CCGLView openGLview CCGLView self view EAGLContext setCurrentContext openGLview.context self drawScene dispatch_semaphore_signal frameRenderingSemaphore else CCGLView openGLview CCGLView self.. drawScene dispatch_semaphore_signal frameRenderingSemaphore else CCGLView openGLview CCGLView self view EAGLContext setCurrentContext openGLview.context self drawScene dispatch_semaphore_signal frameRenderingSemaphore iphone ios objective c uitableview.. DISPATCH_TIME_NOW 0 return if useCocoaFriendlyRendering dispatch_async frameRenderingDispatchQueue ^ EAGLContext setCurrentContext openGLView_.context self drawScene dispatch_semaphore_signal frameRenderingSemaphore else EAGLContext setCurrentContext..

OpenGL ES Simple Undo Last Drawing

http://stackoverflow.com/questions/2708055/opengl-es-simple-undo-last-drawing

a simple undo of last drawing action on the iPhone screen. I draw by first preparing the frame buffer EAGLContext setCurrentContext context glBindFramebufferOES GL_FRAMEBUFFER_OES viewFramebuffer I then prepare the vertex array and draw this way glVertexPointer..

Why is my EAGLVIew not rendering anymore in iOS 4.2?

http://stackoverflow.com/questions/4270320/why-is-my-eaglview-not-rendering-anymore-in-ios-4-2

2 I'm using OpenGL ES 1.1 and not 2.0. Here is what I do in EAGLView's layoutSubViews void layoutSubviews EAGLContext setCurrentContext _context self destroyFramebuffer self createFramebuffer self drawView And this is my createFramebuffer BOOL createFramebuffer..

Request a DepthBuffer in OpenGL ES for iPhone

http://stackoverflow.com/questions/4361516/request-a-depthbuffer-in-opengl-es-for-iphone

for creating the frame buffer. Initially it'll say void createFramebuffer if context defaultFramebuffer EAGLContext setCurrentContext context Create default framebuffer object. glGenFramebuffers 1 defaultFramebuffer glBindFramebuffer GL_FRAMEBUFFER defaultFramebuffer.. it to the frame buffer. So in total untested void createFramebuffer if context defaultFramebuffer EAGLContext setCurrentContext context Create default framebuffer object. glGenFramebuffers 1 defaultFramebuffer glBindFramebuffer GL_FRAMEBUFFER defaultFramebuffer..

CADisplayLink OpenGL rendering breaks UIScrollView behaviour

http://stackoverflow.com/questions/5944050/cadisplaylink-opengl-rendering-breaks-uiscrollview-behaviour

frameRenderingSemaphore DISPATCH_TIME_NOW 0 return dispatch_async openGLESContextQueue ^ EAGLContext setCurrentContext context Render here dispatch_semaphore_signal frameRenderingSemaphore where frameRenderingSemaphore is created earlier as..

Undo drawing in Paint Application

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

CGPoint end static GLfloat eraseBuffer NULL static NSUInteger eraseMax 64 NSUInteger vertexCount 0 count i EAGLContext setCurrentContext context glBindFramebufferOES GL_FRAMEBUFFER_OES viewFramebuffer Convert locations from Points to Pixels CGFloat scale 1.0..

Record the drawing as a m4v video file - OpenGL

http://stackoverflow.com/questions/9661259/record-the-drawing-as-a-m4v-video-file-opengl

end static GLfloat vertexBuffer NULL static NSUInteger vertexMax 64 NSUInteger vertexCount 0 count i EAGLContext setCurrentContext context glBindFramebufferOES GL_FRAMEBUFFER_OES viewFramebuffer Convert locations from Points to Pixels CGFloat scale self.contentScaleFactor.. viewRenderbuffer context presentRenderbuffer GL_RENDERBUFFER_OES Erases the screen void erase EAGLContext setCurrentContext context Clear the buffer glBindFramebufferOES GL_FRAMEBUFFER_OES viewFramebuffer glClearColor 0.0 0.0 0.0 0.0 glClear GL_COLOR_BUFFER_BIT.. nil context EAGLContext alloc initWithAPI kEAGLRenderingAPIOpenGLES1 if context EAGLContext setCurrentContext context self release return nil Create a texture from an image First create a UIImage object from the data in a image..

Draw a straight line using OpenGL ES in iPhone?

http://stackoverflow.com/questions/9736887/draw-a-straight-line-using-opengl-es-in-iphone

view GLKView self.view view.context self.context view.drawableDepthFormat GLKViewDrawableDepthFormat24 EAGLContext setCurrentContext self.context self setupGL void glkView GLKView view drawInRect CGRect rect NSLog @ DrawInRect Method EAGLContext setCurrentContext.. self.context self setupGL void glkView GLKView view drawInRect CGRect rect NSLog @ DrawInRect Method EAGLContext setCurrentContext self.context This method is calling multiple times.... glClearColor 0.65f 0.65f 0.65f 1.0f glClear GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT.. GLSL Shader code. The template creates a setupGL function which I modified to look like this void setupGL EAGLContext setCurrentContext self.context self.effect GLKBaseEffect alloc init autorelease Let's color the line self.effect.useConstantColor GL_TRUE..