Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Difference between windowed mode and full screen
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Difference between windowed mode and full screen



Being a bit of an OpenGL newbie, I don't understand why the following code wouldn't capture full screen:


CGDisplayShowCursor(displays[i]);
CGLSetCurrentContext( glContextObjs[i] ) ;
CGLSetFullScreen( glContextObjs[i] ) ;

glReadBuffer(GL_FRONT);

/* Read framebuffer into our bitmap */
glFinish(); /* Finish all OpenGL commands */
glPixelStorei(GL_PACK_ALIGNMENT, 4); /* Force 4-byte alignment */
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
glPixelStorei(GL_PACK_SKIP_ROWS, 0);
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);

if(texName == 0) {
glGenTextures(1, &texName);
}
glEnable(GL_TEXTURE_RECTANGLE_EXT);
glBindTexture(GL_TEXTURE_RECTANGLE_EXT, texName);
glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_STORAGE_HINT_APPLE, GL_STORAGE_SHARED_APPLE);


glTexImage2D(GL_TEXTURE_RECTANGLE_EXT,
0,
GL_RGBA,
width,
height,
0,
GL_BGRA,
ARGB_IMAGE_TYPE,
[[result frame] rawData]);

glCopyTexSubImage2D( GL_TEXTURE_RECTANGLE_EXT,
0,
clip.texelOffsets.x,
clip.texelOffsets.y,
clip.captureArea.origin.x,
clip.captureArea.origin.y,
(int)clip.captureArea.size.width,
(int)clip.captureArea.size.height);
glFlush();
glGetTexImage(GL_TEXTURE_RECTANGLE_EXT, 0, GL_BGRA, ARGB_IMAGE_TYPE, [[result frame] rawData]);
glFlush();


What direction do I need to head, in order to also capture a full screen Open GL app?
An example of my 'newbiness' - I don't even know if the glTexImage2D and glCopyTexSubImage2D calls are still suitable in a full screen context.
Would someone mind pointing me in the right direction?


Kind Regards,
---
Neil Clayton
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
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 © 2011 Apple Inc. All rights reserved.