Browse Source

FAQ update

omar 7 years ago
parent
commit
7adac4ab3e
3 changed files with 7 additions and 1 deletions
  1. 1 0
      README.md
  2. 1 1
      imconfig.h
  3. 5 0
      imgui.cpp

+ 1 - 0
README.md

@@ -238,6 +238,7 @@ The library started its life and is best known as "ImGui" only due to the fact t
 <b>How can I tell whether to dispatch mouse/keyboard to imgui or to my application?</b>
 <b>How can I tell whether to dispatch mouse/keyboard to imgui or to my application?</b>
 <br><b>How can I display an image? What is ImTextureID, how does it works?</b>
 <br><b>How can I display an image? What is ImTextureID, how does it works?</b>
 <br><b>How can I have multiple widgets with the same label or without a label? A primer on labels and the ID Stack.</b>
 <br><b>How can I have multiple widgets with the same label or without a label? A primer on labels and the ID Stack.</b>
+<br><b>How can I use my own math types instead of ImVec2/ImVec4?</b>
 <br><b>How can I load a different font than the default?</b>
 <br><b>How can I load a different font than the default?</b>
 <br><b>How can I easily use icons in my application?</b>
 <br><b>How can I easily use icons in my application?</b>
 <br><b>How can I load multiple fonts?</b>
 <br><b>How can I load multiple fonts?</b>

+ 1 - 1
imconfig.h

@@ -48,7 +48,7 @@
 //#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
 //#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
 //#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
 //#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
 
 
-//---- Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4.
+//---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4.
 // This will be inlined as part of ImVec2 and ImVec4 class declarations.
 // This will be inlined as part of ImVec2 and ImVec4 class declarations.
 /*
 /*
 #define IM_VEC2_CLASS_EXTRA                                                 \
 #define IM_VEC2_CLASS_EXTRA                                                 \

+ 5 - 0
imgui.cpp

@@ -32,6 +32,7 @@
    - How can I tell whether to dispatch mouse/keyboard to imgui or to my application?
    - How can I tell whether to dispatch mouse/keyboard to imgui or to my application?
    - How can I display an image? What is ImTextureID, how does it works?
    - How can I display an image? What is ImTextureID, how does it works?
    - How can I have multiple widgets with the same label or without a label? A primer on labels and the ID Stack.
    - How can I have multiple widgets with the same label or without a label? A primer on labels and the ID Stack.
+   - How can I use my own math types instead of ImVec2/ImVec4? 
    - How can I load a different font than the default?
    - How can I load a different font than the default?
    - How can I easily use icons in my application?
    - How can I easily use icons in my application?
    - How can I load multiple fonts?
    - How can I load multiple fonts?
@@ -685,6 +686,10 @@
       e.g. when displaying a list of objects, using indices or pointers as ID will preserve the
       e.g. when displaying a list of objects, using indices or pointers as ID will preserve the
        node open/closed state differently. See what makes more sense in your situation!
        node open/closed state differently. See what makes more sense in your situation!
 
 
+ Q: How can I use my own math types instead of ImVec2/ImVec4? 
+ A: You can edit imconfig.h and setup the IM_VEC2_CLASS_EXTRA/IM_VEC4_CLASS_EXTRA macros to add implicit type conversions.
+    This way you'll be able to use your own types everywhere, e.g. passsing glm::vec2 to ImGui functions instead of ImVec2.
+
  Q: How can I load a different font than the default?
  Q: How can I load a different font than the default?
  A: Use the font atlas to load the TTF/OTF file you want:
  A: Use the font atlas to load the TTF/OTF file you want:
       ImGuiIO& io = ImGui::GetIO();
       ImGuiIO& io = ImGui::GetIO();