Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

VidMode.c

Go to the documentation of this file.
00001 /****************************************************************************************/
00002 /*  VidMode.c                                                                           */
00003 /*                                                                                      */
00004 /*  Author: Mike Sandige                                                                */
00005 /*  Description:                                                                        */
00006 /*                                                                                      */
00007 /*  Copyright (c) 1997, 1999, Eclipse Entertainment; All rights reserved.               */
00008 /*                                                                                      */
00009 /*  See the accompanying file LICENSE.TXT for terms on the use of this library.         */
00010 /*  This library is distributed in the hope that it will be useful but WITHOUT          */
00011 /*  ANY WARRANTY OF ANY KIND and without any implied warranty of MERCHANTABILITY        */
00012 /*  or FITNESS FOR ANY PURPOSE.  Refer to LICENSE.TXT for more details.                 */
00013 /*                                                                                      */
00014 /****************************************************************************************/
00015 
00016 #include <assert.h>
00017 
00018 #include "VidMode.h"
00019 
00020 
00021 
00022 #define WIDTH(V)  ((V)>>16)
00023 #define HEIGHT(V) ((V)&0xFFFF)
00024 #define PACK(W,H)  (((W)<<16) + (H))
00025 
00026 void VidMode_GetResolution (const VidMode V, int *Width, int *Height)
00027 {
00028         int W,H;
00029         assert( Width  != NULL );
00030         assert( Height != NULL );
00031         W = WIDTH(V);
00032         H = HEIGHT(V);
00033         
00034         assert( W >= 320  );
00035         assert( W <  8000 );
00036         assert( H >= 200  );
00037         assert( H <  8000 ); 
00038 
00039         *Width = W;
00040         *Height = H;
00041 }
00042         
00043 geBoolean VidMode_SetResolution (VidMode *V, int Width, int Height)
00044 {
00045         assert( V != NULL );
00046         
00047         if      (               ( Width  < 320  ) 
00048                         ||  ( Width  > 8000 ) 
00049                         ||  ( Height < 200  ) 
00050                         ||  ( Height > 8000 )
00051                 )
00052                 return GE_FALSE;
00053         
00054         *V = PACK(Width,Height);
00055         return GE_TRUE;
00056 }
00057 

Generated on Tue Sep 30 12:36:37 2003 for GTestAndEngine by doxygen 1.3.2