Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
800 B

  1. #include "stdafx.h"
  2. #include "sqplus.h"
  3. #include "DXSquirrel_Binds.h"
  4. WNDCLASSEX gWC;
  5. LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
  6. IDirect3D9 * gpD3D = NULL;
  7. BOOL DXSquirrel_Initialize()
  8. {
  9. WNDCLASSEX t = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,
  10. GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
  11. _T("DXSquirrel"), NULL };
  12. gWC = t;
  13. RegisterClassEx( &gWC );
  14. SquirrelVM::Init();
  15. if( NULL == ( gpD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) )
  16. return FALSE;
  17. //initializes classes
  18. _INIT_STATIC_NAMESPACE(DX);
  19. _INIT_CLASS(Device);
  20. _INIT_CLASS(Vector3);
  21. _INIT_CLASS(Matrix);
  22. _INIT_CLASS(BaseMesh);
  23. _INIT_CLASS(Mesh);
  24. //
  25. return TRUE;
  26. }
  27. void DXSquirrel_Shutdown()
  28. {
  29. if(gpD3D) {
  30. gpD3D->Release();
  31. }
  32. }