Gets the current view port.
#include "ltvkrn.h"
L_LVKRN_API L_INT L_VecGetViewport(pVector, pViewport)
Pointer to a vector handle.
Pointer to a RECT structure to be updated with the current view port data.
Value | Meaning |
---|---|
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.
This example will get current view port value and shows it in a message box.
L_LTVKRNTEX_API 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;
}