ilut_main.c
Upload User: wmy0603
Upload Date: 2022-05-02
Package Size: 1808k
Code Size: 1k
Development Platform:

Visual C++

  1. //-----------------------------------------------------------------------------
  2. //
  3. // ImageLib Utility Toolkit Sources
  4. // Copyright (C) 2000-2002 by Denton Woods
  5. // Last modified: 05/28/2001 <--Y2K Compliant! =]
  6. //
  7. // Filename: src-ILUT/src/ilut_main.c
  8. //
  9. // Description: Startup functions
  10. //
  11. //-----------------------------------------------------------------------------
  12. #include "ilut_internal.h"
  13. #ifdef _WIN32
  14. #ifndef IL_STATIC_LIB
  15. //#define WIN32_LEAN_AND_MEAN
  16. #include <windows.h>
  17. #ifdef _WIN32
  18. #if (defined(IL_USE_PRAGMA_LIBS))
  19. #if defined(_MSC_VER) || defined(__BORLANDC__)
  20. #pragma comment(lib, "ILU.lib")
  21. #endif
  22. #endif
  23. #endif
  24. BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
  25. {
  26. hModule;  lpReserved;
  27. // only initialize when attached to a new process. setup can cause errors in OpenIL
  28. // when called on a per thread basis
  29. if (ul_reason_for_call == DLL_PROCESS_ATTACH) {
  30. //ilutInit();
  31. }
  32. return TRUE;
  33. }
  34. #endif
  35. #else  // Should check if gcc?
  36. // Should be able to condense this...
  37. static void GccMain() __attribute__((constructor));
  38. static void GccMain()
  39. {
  40. //ilutInit();
  41. }
  42. #endif
  43. void ILAPIENTRY ilutInit()
  44. {
  45. ilutDefaultStates();  // Set states to their defaults
  46. // Can cause crashes if DevIL is not initialized yet
  47. #ifdef ILUT_USE_OPENGL
  48. ilutGLInit();  // default renderer is OpenGL
  49. #endif
  50. #ifdef ILUT_USE_DIRECTX8
  51. ilutD3D8Init();
  52. #endif
  53. #ifdef ILUT_USE_DIRECTX9
  54. ilutD3D9Init();
  55. #endif
  56. return;
  57. }