Example #1
0
 public void Build(ImGui gui)
 {
     owner = gui;
     if (source != null && gui.isBuilding)
     {
         var rect = source.TranslateRect(sourceRect, gui);
         if (ShoudBuild(source, sourceRect, gui, rect))
         {
             var contentSize = contents.CalculateState(width, gui.pixelsPerUnit);
             var position    = CalculatePosition(gui, rect, contentSize);
             var parentRect  = new Rect(position, contentSize);
             gui.DrawPanel(parentRect, contents);
         }
         else
         {
             source = null;
         }
     }
 }
Example #2
0
        internal void Render()
        {
            if (!repaintRequired && nextRepaintTime > Ui.time)
            {
                return;
            }
            if (nextRepaintTime <= Ui.time)
            {
                nextRepaintTime = long.MaxValue;
            }
            OnRepaint();
            repaintRequired = false;
            if (rootGui.IsRebuildRequired())
            {
                rootGui.CalculateState(size.X, pixelsPerUnit);
            }

            MainRender();
            SDL.SDL_RenderPresent(renderer);
        }