tb_config.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. // ================================================================================
  2. // == This file is a part of Turbo Badger. (C) 2011-2014, Emil Segerås ==
  3. // == See tb_core.h for more information. ==
  4. // ================================================================================
  5. //
  6. // This file contains defines for the default configuration of Turbo Badger.
  7. // You may change these here, but to make upgrades easier it's better to create a
  8. // copy of this file in a include path that is searched before Turbo Badger during
  9. // build (F.ex the solution directory for Visual Studio).
  10. #ifndef TB_CONFIG_H
  11. #define TB_CONFIG_H
  12. /** Enable for some handy runtime debugging, enabled by modifying
  13. the various settings in g_tb_debug. A settings window can be
  14. shown by calling ShowDebugInfoSettingsWindow. */
  15. #ifndef NDEBUG
  16. #define TB_RUNTIME_DEBUG_INFO
  17. #endif
  18. #ifndef NDEBUG
  19. /** Enable compilation of unit tests. */
  20. #define TB_UNIT_TESTING
  21. #endif
  22. /** Enable if the focus state should automatically be set on edit fields even
  23. when using the pointer. It is normally set only while moving focus by keyboard. */
  24. //#define TB_ALWAYS_SHOW_EDIT_FOCUS
  25. /** Enable to use premultiplied alpha. Warning: This is not handled everywhere in
  26. the default backends, so consider it an experimental and unfinished feature! */
  27. //#define TB_PREMULTIPLIED_ALPHA
  28. /** Enable to support TBBF fonts (Turbo Badger Bitmap Fonts) */
  29. #define TB_FONT_RENDERER_TBBF
  30. /** Enable to support truetype fonts using freetype. */
  31. //#define TB_FONT_RENDERER_FREETYPE
  32. /** Enable to support truetype fonts using stb_truetype.h (http://nothings.org/).
  33. It's a *very unsafe* font library. Use only with fonts distributed with your
  34. app, that you know work! Freetype generates much prettier glyphs (using
  35. hinting) but is a lot larger. This implementation is kept here as alternative
  36. as long as it compiles. */
  37. // #define TB_FONT_RENDERER_STB
  38. /** Enable to support image loading using stb_image.c (http://nothings.org/).
  39. It's a *very unsafe* image library. Use only with images distributed with
  40. your app, that you know work! */
  41. #define TB_IMAGE_LOADER_STB
  42. /** Enable to get TBRendererBatcher, an helper class for renderers that
  43. implements batching of draw operations. Subclasses of TBRendererBatcher
  44. can be done super easily, and still do batching. */
  45. #define TB_RENDERER_BATCHER
  46. /** Enable renderer using OpenGL. This renderer depends on TB_RENDERER_BATCHER.
  47. It is using GL version 1.1, */
  48. #define TB_RENDERER_GL
  49. /** Enable renderer using OpenGL ES. This renderer depends on TB_RENDERER_GL.
  50. It is using GL ES version 1. */
  51. //#define TB_RENDERER_GLES_1
  52. /** The width of the font glyph cache. Must be a power of two. */
  53. #define TB_GLYPH_CACHE_WIDTH 512
  54. /** The height of the font glyph cache. Must be a power of two. */
  55. #define TB_GLYPH_CACHE_HEIGHT 512
  56. // == Optional features ===========================================================
  57. /** Enable support for TBImage, TBImageManager, TBImageWidget. */
  58. #define TB_IMAGE
  59. // == Additional configuration of platform implementations ========================
  60. /** Define for posix implementation of TBFile. */
  61. //#define TB_FILE_POSIX
  62. /** Defines for implementations of TBClipboard. */
  63. //#define TB_CLIPBOARD_DUMMY // Cross platform. Not integrating with the OS.
  64. //#define TB_CLIPBOARD_GLFW // Cross platform using glfw API.
  65. //#define TB_CLIPBOARD_WINDOWS
  66. /** Defines for implementations of TBSystem. */
  67. //#define TB_SYSTEM_LINUX
  68. //#define TB_SYSTEM_WINDOWS
  69. //#define TB_SYSTEM_ANDROID
  70. /** Defines for additional platform specific issues. */
  71. //#define TB_TARGET_WINDOWS
  72. //#define TB_TARGET_MACOSX
  73. //#define TB_TARGET_LINUX
  74. // == Setting some defaults for platform implementations ==========================
  75. #if defined(_WIN32) || defined(__WIN32__) || defined(__WINDOWS__)
  76. #define TB_FILE_POSIX
  77. #define TB_TARGET_WINDOWS
  78. #define TB_CLIPBOARD_WINDOWS
  79. #define TB_SYSTEM_WINDOWS
  80. #endif
  81. #if defined(__linux) || defined(__linux__)
  82. #define TB_FILE_POSIX
  83. #define TB_TARGET_LINUX
  84. #define TB_SYSTEM_LINUX
  85. #define TB_CLIPBOARD_DUMMY
  86. #endif
  87. #ifdef EMSCRIPTEN
  88. #define TB_FILE_POSIX
  89. #define TB_TARGET_EMSCRIPTEN
  90. #define TB_SYSTEM_LINUX
  91. #define TB_CLIPBOARD_DUMMY
  92. #endif
  93. #ifdef MACOSX
  94. #define TB_FILE_POSIX
  95. #define TB_TARGET_MACOSX
  96. #define TB_SYSTEM_LINUX
  97. #define TB_CLIPBOARD_DUMMY
  98. #endif
  99. #if defined(ANDROID) || defined(__ANDROID__)
  100. #define TB_SYSTEM_ANDROID
  101. #define TB_CLIPBOARD_DUMMY
  102. #endif
  103. #endif // TB_CONFIG_H