Hello,
I have another question born out of ignorance of OpenGL.
I have rendered a textured Quad using the following code:
// Image Size
float tW = (float)[pix pwidth] ; // Texture Width
float tH = (float)[pix pheight] ; // Texture Height
// rect is the rectangle of the Window
float sW = rect.size.width; // Screen Width
float sH = rect.size.height; // Screen Height
// Zoom/Scale the image based on the largest dimension to fit
the
viewing area
float tzoom = -1.0f * (tH>tW?sH:sW) / (tH>tW?tH:tW);
// Get CGL_Context for Obj-C only (using CGLMacros.h)
// CGLContextObj cgl_ctx = [nsgl_ctx CGLContextObj];
glMatrixMode (GL_MODELVIEW);
glLoadIdentity();
// Move Camera
glScalef (-tzoom * 2.0f /sW, -tzoom * -2.0f / sH, 1.0f);
glRotatef (0.0f, 0.0f, 0.0f, 1.0f); // rotate matrix for image
rotation
glTranslatef( -0.5f*tW, -0.5f*tH, -1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(TEXTURE);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glBindTexture(TEXTURE, *textureBuffer);
// Draw Quad
glBegin(GL_QUADS);
{
glColor4f (1.0f, 1.0f, 1.0f, 1.0f);
glTexCoord3d(0.0, 0.0, 0.0); glVertex3d(0.0,
0.0, 0.0);
glTexCoord3d(0.0, 1.0, 0.0); glVertex3d(0.0,
(double)tH, 0.0);
glTexCoord3d(1.0, 1.0, 0.0);
glVertex3d((double)tW, (double)tH,
0.0);
glTexCoord3d(1.0, 0.0, 0.0);
glVertex3d((double)tW, 0.0, 0.0);
}
glEnd();
Specifically, using glScalef as a ratio of image to screen so that it
will always fit.
How do I achieve the same thing with Equalizer? Can I get the
dimensions of window?
This is probably something simple I'm not seeing.
-Stephen
_______________________________________________
eq-dev mailing list
[email protected]
http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev
http://www.equalizergraphics.com