SDL_cpuinfo.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. SDL - Simple DirectMedia Layer
  3. Copyright (C) 1997-2010 Sam Lantinga
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  15. Sam Lantinga
  16. [email protected]
  17. */
  18. /**
  19. * \file SDL_cpuinfo.h
  20. *
  21. * CPU feature detection for SDL.
  22. */
  23. #ifndef _SDL_cpuinfo_h
  24. #define _SDL_cpuinfo_h
  25. #include "SDL_stdinc.h"
  26. #include "begin_code.h"
  27. /* Set up for C function definitions, even when using C++ */
  28. #ifdef __cplusplus
  29. /* *INDENT-OFF* */
  30. extern "C" {
  31. /* *INDENT-ON* */
  32. #endif
  33. /**
  34. * This function returns the number of CPU cores available.
  35. */
  36. extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
  37. /**
  38. * This function returns true if the CPU has the RDTSC instruction.
  39. */
  40. extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
  41. /**
  42. * This function returns true if the CPU has MMX features.
  43. */
  44. extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
  45. /**
  46. * This function returns true if the CPU has MMX Ext.\ features.
  47. */
  48. extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void);
  49. /**
  50. * This function returns true if the CPU has 3DNow!\ features.
  51. */
  52. extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
  53. /**
  54. * This function returns true if the CPU has 3DNow!\ Ext.\ features.
  55. */
  56. extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void);
  57. /**
  58. * This function returns true if the CPU has SSE features.
  59. */
  60. extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
  61. /**
  62. * This function returns true if the CPU has SSE2 features.
  63. */
  64. extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
  65. /**
  66. * This function returns true if the CPU has AltiVec features.
  67. */
  68. extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
  69. /* Ends C function definitions when using C++ */
  70. #ifdef __cplusplus
  71. /* *INDENT-OFF* */
  72. }
  73. /* *INDENT-ON* */
  74. #endif
  75. #include "close_code.h"
  76. #endif /* _SDL_cpuinfo_h */
  77. /* vi: set ts=4 sw=4 expandtab: */