[ Previous | Next | Contents | Glossary | Home | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

keepaspect Subroutine

Purpose

Specifies the aspect ratio of a window.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void keepaspect(Int32 x, Int32 y)

FORTRAN Syntax

SUBROUTINE KEEPAS(x, y)
INTEGER*4 x, y

Description

The keepaspect subroutine specifies the aspect ratio of a window. It is called at the beginning of a graphics program, but only takes effect when the winopen subroutine is called. The resulting window maintains the aspect ratio specified in the keepaspect subroutine, even if the window changes size.

For example, keepaspect(1,1) always results in a square window. The keepaspect subroutine can also be called in conjunction with the winconstraints subroutine to modify the enforced aspect ratio after the window is created.

With the keepaspect subroutine, the programmer can prevent the user from resizing a window to an aspect ratio that is different from the specified ratio.

Note: This subroutine cannot be used to add to a display list.

Parameters

x Specifies the horizontal proportion of the aspect ratio.
y Specifies the vertical proportion of the aspect ratio.

Example

The example C language program colored.c uses the keepaspect subroutine to restrict a window to a specific aspect ratio.

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

Files

/usr/include/gl/gl.h Contains C language constant and variable type definitions for GL.
/usr/include/gl/fgl.h Contains FORTRAN constant and variable type definitions for GL.

Related Information

Specifying pixel values to be added to a window with the fudge subroutine.

Constraining the location and size of a window with the prefposition subroutine.

Constraining the size of a window with the prefsize subroutine.

Binding window constraints to the current window with the winconstraints subroutine.

Creating a window with the winopen subroutine.

Creating and Managing Windows.


[ Previous | Next | Contents | Glossary | Home | Search ]