Global.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifdef WIN32
  2. #include <Windows.h>
  3. #include <GdiPlus.h>
  4. #pragma comment( lib, "gdiplus.lib" )
  5. #endif
  6. #define Global
  7. #include "Fenster.h"
  8. #include "Maus.h"
  9. #include "Globals.h"
  10. #include "Thread.h"
  11. #include "Model3DList.h"
  12. #include "TexturList.h"
  13. void Framework::initFramework()
  14. {
  15. if( istInitialisiert )
  16. return;
  17. Gdiplus::GdiplusStartupInput gdiplusStartupInput;
  18. ULONG_PTR gdiplusToken;
  19. Gdiplus::GdiplusStartup( &gdiplusToken, &gdiplusStartupInput, 0 );
  20. msgExit = 0;
  21. MausTrack = 1;
  22. for( int i = 0; i < 255; ++i )
  23. TastenStand[ i ] = 0;
  24. for( int i = 0; i < 3; ++i )
  25. MausStand[ i ] = 0;
  26. thRegister = new ThreadRegister();
  27. Model3DList::init();
  28. m3dRegister = new Model3DList();
  29. TexturList::init();
  30. texturRegister = new TexturList();
  31. istInitialisiert = 1;
  32. }
  33. void Framework::releaseFramework()
  34. {
  35. if( !istInitialisiert )
  36. return;
  37. delete thRegister;
  38. m3dRegister->release();
  39. Model3DList::destroy();
  40. texturRegister->release();
  41. TexturList::destroy();
  42. istInitialisiert = 0;
  43. }
  44. const Framework::Punkt &Framework::getMausPos()
  45. {
  46. return mausPos;
  47. }
  48. bool Framework::getMausStand( int taste )
  49. {
  50. return MausStand[ taste ];
  51. }
  52. void Framework::setTastenStand( unsigned char taste, bool st )
  53. {
  54. TastenStand[ taste ] = st;
  55. }
  56. bool Framework::getTastenStand( unsigned char taste )
  57. {
  58. return TastenStand[ taste ];
  59. }
  60. bool Framework::istThreadOk( Thread *t )
  61. {
  62. return thRegister->isThread( t );
  63. }
  64. // Gibt das Model3DData Register des Frameworks ohne erhöhten reference Counter zurück
  65. Framework::Model3DList *Framework::zM3DRegister()
  66. {
  67. return m3dRegister;
  68. }
  69. // Gibt das Textur Register des Frameworks ohne erhöhten reference Counter zurück
  70. Framework::TexturList *Framework::zTexturRegister()
  71. {
  72. return texturRegister;
  73. }