Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
IRS_Update.c
/******************************************************************************\ |
Module: IRS_Update.c |
Purpose: update metahandler functions |
Author: Sun-Inn Shih |
Copyright (C) 1993-96 Apple Computer, Inc. All rights reserved. |
\*****************************************************************************/ |
#include <QD3D.h> |
#include <QD3DDrawContext.h> |
#include <QD3DView.h> |
#include "IRS_Update.h" |
/* |
* IRS_Update_Matrix_localToFrustum |
*/ |
TQ3Status IRS_Update_Matrix_localToFrustum( |
TQ3ViewObject pView, |
irsData *irsdata, |
TQ3Matrix4x4 *pData) |
{ |
irsdata->localToFrustum = *pData; |
irsdata->XScale = 1.0f ; |
irsdata->YScale = 1.0f ; |
irsdata->XOffset = 0 ; |
irsdata->YOffset = 0 ; |
TQ3DrawContextObject DrawContext ; |
if ( Q3View_GetDrawContext ( pView , &DrawContext ) != kQ3Failure ) |
{ |
TQ3DrawContextData Data ; |
if ( Q3DrawContext_GetData ( DrawContext , &Data ) != kQ3Failure ) |
{ |
irsdata->XScale = ( Data.pane.max.x - Data.pane.min.x ) / 2.0f ; |
irsdata->YScale = ( Data.pane.max.y - Data.pane.min.y ) / 2.0f ; |
irsdata->XOffset = Data.pane.min.x + irsdata->XScale ; |
irsdata->YOffset = Data.pane.max.y - irsdata->YScale ; |
} |
} |
return kQ3Success; |
} |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14