Browse Source

Removed ViewId style from ImGui.

Branimir Karadžić 7 years ago
parent
commit
0d502588d0

+ 0 - 1
3rdparty/dear-imgui/imgui.cpp

@@ -6690,7 +6690,6 @@ static const ImGuiStyleVarInfo GStyleVarInfo[] =
     { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, GrabMinSize) },        // ImGuiStyleVar_GrabMinSize
     { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, GrabMinSize) },        // ImGuiStyleVar_GrabMinSize
     { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, GrabRounding) },       // ImGuiStyleVar_GrabRounding
     { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, GrabRounding) },       // ImGuiStyleVar_GrabRounding
     { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ButtonTextAlign) },    // ImGuiStyleVar_ButtonTextAlign
     { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ButtonTextAlign) },    // ImGuiStyleVar_ButtonTextAlign
-    { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ViewId) },
 };
 };
 
 
 static const ImGuiStyleVarInfo* GetStyleVarInfo(ImGuiStyleVar idx)
 static const ImGuiStyleVarInfo* GetStyleVarInfo(ImGuiStyleVar idx)

+ 1 - 4
3rdparty/dear-imgui/imgui.h

@@ -887,7 +887,6 @@ enum ImGuiStyleVar_
     ImGuiStyleVar_GrabMinSize,         // float     GrabMinSize
     ImGuiStyleVar_GrabMinSize,         // float     GrabMinSize
     ImGuiStyleVar_GrabRounding,        // float     GrabRounding
     ImGuiStyleVar_GrabRounding,        // float     GrabRounding
     ImGuiStyleVar_ButtonTextAlign,     // ImVec2    ButtonTextAlign
     ImGuiStyleVar_ButtonTextAlign,     // ImVec2    ButtonTextAlign
-    ImGuiStyleVar_ViewId,              // uint8_t
     ImGuiStyleVar_COUNT
     ImGuiStyleVar_COUNT
 
 
     // Obsolete names (will be removed)
     // Obsolete names (will be removed)
@@ -988,7 +987,6 @@ struct ImGuiStyle
     float       ScrollbarSize;              // Width of the vertical scrollbar, Height of the horizontal scrollbar.
     float       ScrollbarSize;              // Width of the vertical scrollbar, Height of the horizontal scrollbar.
     float       ScrollbarRounding;          // Radius of grab corners for scrollbar.
     float       ScrollbarRounding;          // Radius of grab corners for scrollbar.
     float       GrabMinSize;                // Minimum width/height of a grab box for slider/scrollbar.
     float       GrabMinSize;                // Minimum width/height of a grab box for slider/scrollbar.
-    float       ViewId;
     float       GrabRounding;               // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
     float       GrabRounding;               // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
     ImVec2      ButtonTextAlign;            // Alignment of button text when button is larger than text. Defaults to (0.5f,0.5f) for horizontally+vertically centered.
     ImVec2      ButtonTextAlign;            // Alignment of button text when button is larger than text. Defaults to (0.5f,0.5f) for horizontally+vertically centered.
     ImVec2      DisplayWindowPadding;       // Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows.
     ImVec2      DisplayWindowPadding;       // Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows.
@@ -1496,9 +1494,8 @@ struct ImDrawCmd
     ImTextureID     TextureId;              // User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas.
     ImTextureID     TextureId;              // User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas.
     ImDrawCallback  UserCallback;           // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
     ImDrawCallback  UserCallback;           // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
     void*           UserCallbackData;       // The draw callback code can access this.
     void*           UserCallbackData;       // The draw callback code can access this.
-    unsigned short  ViewId;
 
 
-    ImDrawCmd() { ElemCount = 0; ClipRect.x = ClipRect.y = ClipRect.z = ClipRect.w = 0.0f; TextureId = NULL; UserCallback = NULL; UserCallbackData = NULL; ViewId = 0; }
+    ImDrawCmd() { ElemCount = 0; ClipRect.x = ClipRect.y = ClipRect.z = ClipRect.w = 0.0f; TextureId = NULL; UserCallback = NULL; UserCallbackData = NULL; }
 };
 };
 
 
 // Vertex index (override with '#define ImDrawIdx unsigned int' inside in imconfig.h)
 // Vertex index (override with '#define ImDrawIdx unsigned int' inside in imconfig.h)

+ 0 - 2
3rdparty/dear-imgui/imgui_draw.cpp

@@ -371,7 +371,6 @@ void ImDrawList::AddDrawCmd()
     ImDrawCmd draw_cmd;
     ImDrawCmd draw_cmd;
     draw_cmd.ClipRect = GetCurrentClipRect();
     draw_cmd.ClipRect = GetCurrentClipRect();
     draw_cmd.TextureId = GetCurrentTextureId();
     draw_cmd.TextureId = GetCurrentTextureId();
-    draw_cmd.ViewId = (unsigned short)(GImGui->Style.ViewId);
 
 
     IM_ASSERT(draw_cmd.ClipRect.x <= draw_cmd.ClipRect.z && draw_cmd.ClipRect.y <= draw_cmd.ClipRect.w);
     IM_ASSERT(draw_cmd.ClipRect.x <= draw_cmd.ClipRect.z && draw_cmd.ClipRect.y <= draw_cmd.ClipRect.w);
     CmdBuffer.push_back(draw_cmd);
     CmdBuffer.push_back(draw_cmd);
@@ -506,7 +505,6 @@ void ImDrawList::ChannelsSplit(int channels_count)
             ImDrawCmd draw_cmd;
             ImDrawCmd draw_cmd;
             draw_cmd.ClipRect = _ClipRectStack.back();
             draw_cmd.ClipRect = _ClipRectStack.back();
             draw_cmd.TextureId = _TextureIdStack.back();
             draw_cmd.TextureId = _TextureIdStack.back();
-            draw_cmd.ViewId = (unsigned short)(GImGui->Style.ViewId);
             _Channels[i].CmdBuffer.push_back(draw_cmd);
             _Channels[i].CmdBuffer.push_back(draw_cmd);
         }
         }
     }
     }

+ 1 - 3
examples/common/imgui/imgui.cpp

@@ -183,7 +183,7 @@ struct OcornutImguiContext
 					bgfx::setTexture(0, s_tex, th);
 					bgfx::setTexture(0, s_tex, th);
 					bgfx::setVertexBuffer(0, &tvb, 0, numVertices);
 					bgfx::setVertexBuffer(0, &tvb, 0, numVertices);
 					bgfx::setIndexBuffer(&tib, offset, cmd->ElemCount);
 					bgfx::setIndexBuffer(&tib, offset, cmd->ElemCount);
-					bgfx::submit(cmd->ViewId, program);
+					bgfx::submit(m_viewId, program);
 				}
 				}
 
 
 				offset += cmd->ElemCount;
 				offset += cmd->ElemCount;
@@ -409,14 +409,12 @@ struct OcornutImguiContext
 #endif // USE_ENTRY
 #endif // USE_ENTRY
 
 
 		ImGui::NewFrame();
 		ImGui::NewFrame();
-		ImGui::PushStyleVar(ImGuiStyleVar_ViewId, (float)_viewId);
 
 
 		ImGuizmo::BeginFrame();
 		ImGuizmo::BeginFrame();
 	}
 	}
 
 
 	void endFrame()
 	void endFrame()
 	{
 	{
-		ImGui::PopStyleVar(1);
 		ImGui::Render();
 		ImGui::Render();
 		render(ImGui::GetDrawData() );
 		render(ImGui::GetDrawData() );
 	}
 	}