Game Development Reference
In-Depth Information
*pwidth = width;
*pheight = height;
// let the sound and input subsystems know about the new window
ri.Vid_NewWindow (width, height);
return rserr_ok;
}
// vid_so.c
qboolean VID_GetModeInfo( int *width, int *height, int mode )
{
if ( mode < 0 || mode >= VID_NUM_MODES )
return false;
*width = vid_modes[mode].width;
*height = vid_modes[mode].height;
return true;
}
/**
* VID_NewWindow
*/
void VID_NewWindow ( int width, int height)
{
viddef.width = width;
viddef.height = height;
//tell java about it
jni_init_video (width, height);
}
For Android, you have defined a set of resolutions that include all possible sizes for the
different types of Android devices out there with this code:
#ifdef ANDROID
{ "Mode 0: 256x256", 256, 256, 0 },
{ "Mode 1: 320x320", 320, 320, 1 },
{ "Mode 2: 480x320", 480, 320, 2 },
{ "Mode 3: 569x320", 569, 320, 3 },
{ "Mode 4: 800x480", 800, 480, 4 },
...
#endif
When the Quake II engine starts up, GLimp_SetMode will be invoked. Here, you must get the
screen resolution by calling
ri.Vid_GetModeInfo( &width, &height, mode )
 
Search WWH ::




Custom Search