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.

53 lines
797 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #include "GMath.h"
  2. #include "CArrayBuffer.h"
  3. #include "CDataView.h"
  4. int main() {
  5. CArrayBuffer buffer(16);
  6. CDataView view0(&buffer, 0, buffer.byteLength());
  7. view0.setFloat32(8, 99.99);
  8. view0.setUint16(8 + 4, 2048);
  9. printf("%f\n", view0.getFloat32(8));
  10. printf("%d\n", view0.getUint16(8+4));
  11. CDataView view1(&buffer, 8, 18);
  12. printf("%f\n", view1.getFloat32(0));
  13. printf("%d\n", view1.getUint16(4));
  14. /*float a[] = {
  15. 2, 2, 2, 2,
  16. 3, 3, 3, 3,
  17. 4, 4, 4, 4,
  18. 5, 5, 5, 5
  19. };
  20. GMatrix A(4, 4, a);
  21. float b[] = {
  22. 2,
  23. 2,
  24. 2,
  25. 2
  26. };
  27. GMatrix B(4, 1, b);
  28. cout << A*B << endl;*/
  29. /*float a[] = {
  30. 1,0,
  31. 1,4
  32. };
  33. GMatrix A(2, 2, a);
  34. float c[] = {
  35. 0,1,
  36. 1,0
  37. };
  38. GMatrix C(2, 2, c);
  39. cout << A*A << endl;*/
  40. return 0;
  41. }