Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rendering OpenGL into iSight-Video-Stream



Hello,

I'm trying the following thing:

I want to capture video-stream from my isight-cam and render some OpenGL polygons on the video-stream, so that I actualy see both video-stream and the rendered object. The difference is that I don't use GLUT but AGL and a carbon-window to draw on. So far I have done the following steps being inspired by ARToolKit implementation:

- creating new GWorldPtr using QTNewGWorld with k32ARGBPixelFormat
- calling the usual SG routines (SGInitialize, SGSetDataRef, SGSetGWolrd, SGNewChannel, SGSetChannelBounds, SGSetChannelUsage, SGSetDataProc , SGStartRecord)
- creating an AGLPixelFormat with the attributes: { AGL_RGBA, AGL_DOUBLEBUFFER, AGL_STENCIL_SIZE, 8, AGL_SAMPLE_BUFFERS_ARB, 1, AGL_SAMPLES_ARB, 4, AGL_NO_RECOVERY, AGL_NONE }
- creating AGLContext on that pixFmt
- saving current graphics-port to carbon-window port
- aglSetDrawable and aglSetCurrentContext
- initializing GL by aglSetCurrentContext, glMatrixMode(GL_MODELVIEW), glLoadIdentity(), glMatrixMode(GL_PROJECTION), glLoadIdentity(), glOrtho(...), glViewPort(...), glDisable(GL_STENCIL_TEST),
glStencilFunc(GL_ALWAYS, 0, 0), glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP)
- GetPixBaseAddress from the created GWorldPtr and drawing it by using glDrawPixels periodicaly in an EventLoopTimer
- aglSwapBuffers


At this point I see the video-stream on the carbon-window but I have problems rendering a simple 2d quad on the window simultaneously.
What I tried after the swapBuffers call was:


- glMatrixMode(GL_MODELVIEW)
- glLoadIdentity();
- glCallList(simpleQuad) (I have created a list with 4 vertices)
- aglSwapBuffers

But the I just see the Quad and no video-stream anymore.

I'm not that experienced with OpenGL (so please don't destroy me completely;)), especially not in using different bufffers like stencil and depthbuffer. I was so happy if you could give me any hints.

Thanks a lot!!

Milo

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.