Globals.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #ifndef Globals_H
  2. #define Globals_H
  3. #include "Critical.h"
  4. #include "Point.h"
  5. #ifdef WIN32
  6. # include "Mouse.h"
  7. #endif
  8. #ifndef Global
  9. # define Global extern
  10. #endif
  11. struct HINSTANCE__; //! windows.h
  12. namespace Framework
  13. {
  14. class ThreadRegister; //! Thread.h
  15. class Thread; //! Thread.h
  16. class Model3DList; //! Model3DList.h
  17. class TexturList; //! TextureList.h
  18. class Datei; //! File.h
  19. class DLLRegister; //! DLLRegister.h
  20. namespace Logging
  21. {
  22. class LoggingHandler; //! LoggingHandler.h
  23. }
  24. #ifdef WIN32
  25. class Maus; //! Mouse.h
  26. class WFensterArray; //! Window.h
  27. Global WFensterArray WFensterA;
  28. Global bool MausTrack;
  29. Global Maus MausZeiger;
  30. Global bool msgExit;
  31. #endif
  32. Global bool MausStand[3];
  33. Global bool istInitialisiert;
  34. Global ThreadRegister* thRegister;
  35. Global Critical logC;
  36. Global HINSTANCE__* _hinst;
  37. Global DLLRegister* dlls;
  38. Global bool debugDX;
  39. Global bool cursorVisible;
  40. Global Logging::LoggingHandler* loggingHandler;
  41. #ifdef WIN32
  42. //! Returns the mouse coordinates on the screen
  43. DLLEXPORT Punkt getMausPos();
  44. //! Sets the position of the mouse on the screen
  45. DLLEXPORT void setMausPos(const Punkt& pos);
  46. #endif
  47. //! Returns whether a mouse button is currently pressed
  48. //! \param taste The button to check
  49. //! Example: getMausStand( M_Links ); (Requires include <MouseEvent.h>)
  50. DLLEXPORT bool getMausStand(int taste);
  51. //! Returns whether a keyboard key is currently pressed
  52. //! \param taste The key to check
  53. //! Example: getTastenStand( T_Enter ); (Requires include
  54. //! <KeyboardEvent.h>)
  55. DLLEXPORT bool getTastenStand(unsigned char taste);
  56. //! Initializes the framework.
  57. //! Called automatically in the framework's (WinMain)
  58. DLLEXPORT void initFramework(HINSTANCE__* hInst = 0);
  59. //! Releases the memory used by (initFramework).
  60. //! Called automatically in the framework's (WinMain)
  61. DLLEXPORT void releaseFramework();
  62. //! Checks whether a specific pointer points to a valid Thread object
  63. //! \param t The pointer to check
  64. //! \return 1 if the pointer is valid. 0 if the pointer does not
  65. //! point to an existing Thread object
  66. DLLEXPORT bool istThreadOk(Thread* t);
  67. //! Returns the framework's thread register
  68. DLLEXPORT ThreadRegister* getThreadRegister();
  69. //! Returns the DLL register containing all currently dynamically loaded
  70. //! DLL files
  71. DLLEXPORT DLLRegister* getDLLRegister();
  72. //! Sets DirectX to debug mode
  73. DLLEXPORT void setDebugDX(bool debug);
  74. #ifdef WIN32
  75. //! Returns a reference to the mouse
  76. DLLEXPORT Maus& getMaus();
  77. //! Sets the mouse cursor visibility
  78. DLLEXPORT void setShowCursor(bool visible);
  79. #endif
  80. } // namespace Framework
  81. #endif