Advertisement
dcomicboy

createcamera

Feb 9th, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. uint32 nWidth, nHeight;
  2.     ObjectCreateStruct objCreate;
  3.    
  4.    
  5.     g_pLTClient->GetSurfaceDims(g_pLTClient->GetScreenSurface(), &nWidth, &nHeight);
  6.    
  7.    
  8.     objCreate.Clear();
  9.     objCreate.m_ObjectType = OT_CAMERA;
  10.     m_hObject = g_pLTClient->CreateObject(&objCreate);
  11.    
  12.     if (NULL == m_hObject)
  13.         return LT_ERROR;
  14.    
  15.     g_pLTClient->SetCameraRect(m_hObject, false, 0, 0, nWidth, nHeight);
  16.    
  17.    
  18.     float fFovX = MATH_PI/2.0f;
  19.     float fFovY = (fFovX * nHeight) / nWidth;
  20.     g_pLTClient->SetCameraFOV(m_hObject, fFovX, fFovY);
  21.    
  22.     return LT_OK;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement