#include "lvkrn.h"
L_LVKRN_API L_INT L_VecGetViewport(pVector, pViewport)
const pVECTORHANDLE pVector; |
pointer to a vector handle |
L_RECT * pViewport; |
pointer to a structure |
Gets the current view port.
Parameter |
Description |
pVector |
Pointer to a vector handle. |
pViewport |
Pointer to a RECT structure to be updated with the current view port data. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Use this function to get the view port associated with the specified vector handle.
If pVector is attached to a window, you must call this function when processing WM_SIZE messages, since the VECTOR library needs to know when the window size has changed (DirectX), or when the double buffer mode is selected in the current VECTOR engine.
This function and L_VecSetCamera are required to complete the projection process from the vector image onto a 2D surface.
Required DLLs and Libraries
LVKRN For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Functions: |
This example will get current view port value and shows it in a message box.
L_INT VecGetViewportExample(pVECTORHANDLE pVector)
{
L_INT nRet;
RECT rect;
L_TCHAR szBuffer[ 80 ];
/* Get viewport */
nRet = L_VecGetViewport( pVector, &rect );
if(nRet != SUCCESS)
return nRet;
/* Format in a buffer */
wsprintf( szBuffer, TEXT("%d, %d, %d, %d"), rect.left, rect.top, rect.right, rect.bottom );
/* Show in a message box */
MessageBox( NULL, szBuffer, TEXT("Viewport"), 0 );
return SUCCESS;
}