569 std::stable_sort(m_BufferT,m_BufferT+m_Textures.
NumVertices,cmp1);
571 std::stable_sort(m_BufferP,m_BufferP+m_Points.
NumVertices,cmpgeneral<PointVertex>);
573 std::stable_sort(m_BufferL,m_BufferL+m_Lines.
NumVertices,cmpgeneral<LineVertex>);
575 std::stable_sort(m_BufferTR,m_BufferTR+m_Triangles.
NumVertices,cmpgeneral<TriangleVertex>);
577 int min_texture_layer,min_point_layer,min_line_layer,min_triangle_layer,min_text_layer;
583 min_texture_layer=GetTexturesMinLayer();
584 min_point_layer=GetPointsMinLayer();
585 min_line_layer=GetLinesMinLayer();
586 min_triangle_layer=GetTrianglesMinLayer();
589 if(min_texture_layer!=std::numeric_limits<int>::max())
590 RenderTextures(post_processing,std::min({min_point_layer,min_line_layer,min_triangle_layer,min_text_layer}));
591 if(min_point_layer!=std::numeric_limits<int>::max())
592 RenderPoints(std::min({min_texture_layer,min_line_layer,min_triangle_layer,min_text_layer}));
593 if(min_line_layer!=std::numeric_limits<int>::max())
594 RenderLines(std::min({min_texture_layer,min_point_layer,min_triangle_layer,min_text_layer}));
595 if(min_triangle_layer!=std::numeric_limits<int>::max())
596 RenderTriangles(std::min({min_texture_layer,min_point_layer,min_line_layer,min_text_layer}));
597 if(min_text_layer!=std::numeric_limits<int>::max())
598 TEXT_QUEUE->
Render(std::min({min_texture_layer,min_point_layer,min_line_layer,min_triangle_layer}));
806 std::vector<Vec2>points;
807 auto find=[&points](
Vec2 point)->
bool{
808 for(
size_t i=0;
i<points.size();
i++){
809 if(points[
i].x==point.x && points[
i].y==point.y)
814 for(
auto [a,b]:segments){
822 std::vector<float>angles;
825 float angle=glm::atan(p.y-pos.
y,p.x-pos.
x);
826 angles.push_back(angle-0.0001f);
827 angles.push_back(angle);
828 angles.push_back(angle+0.0001f);
831 std::vector<std::pair<Vec2,float>>intersects;
832 for(
auto angle:angles){
833 float dx=glm::cos(angle);
834 float dy=glm::sin(angle);
836 std::pair<Vec2,Vec2>ray=std::make_pair(pos,
Vec2(pos.
x+dx,pos.
y+dy));
837 std::pair<Vec2,double> closest_intersect=std::make_pair(
Vec2(-1.0f,-1.0f),-1.0f);
838 for(
auto seg:segments){
840 if(intersect.first.x==-1.0f && intersect.first.y==-1.0f)
842 if((closest_intersect.first.x==-1.0f && closest_intersect.first.y==-1.0f) || (intersect.second<closest_intersect.second && intersect.second!=-1.0f))
843 closest_intersect=intersect;
845 if(closest_intersect.first.x!=-1.0f && closest_intersect.first.y!=-1.0f)
846 intersects.push_back(std::make_pair(closest_intersect.first,angle));
849 std::sort(begin(intersects),end(intersects),[](
const auto& a,
const auto& b){
850 return a.second<b.second;
856 m_LightingFramebuffer->
Bind();
857 glBlendFunc(GL_ONE,GL_ONE);
859 m_TempFramebuffer->
Bind();
860 glClearColor(0.0f,0.0f,0.0f,1.0f);
861 glClear(GL_COLOR_BUFFER_BIT);
864 for(
size_t i=0;
i<intersects.size()-1;
i++){
865 auto a=intersects[
i].first;
866 auto b=intersects[
i+1].first;
869 DrawTriangle(pos,intersects[0].first,intersects[intersects.size()-1].first,color,0);
882 m_LightingFramebuffer->
Bind();
883 glBlendFunc(GL_ONE,GL_ONE);
890 glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
1017ImVec4* colors=ImGui::GetStyle().Colors;
1018 colors[ImGuiCol_Text] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
1019 colors[ImGuiCol_TextDisabled] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f);
1020 colors[ImGuiCol_WindowBg] = ImVec4(0.10f, 0.10f, 0.10f, 1.00f);
1021 colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
1022 colors[ImGuiCol_PopupBg] = ImVec4(0.19f, 0.19f, 0.19f, 0.92f);
1023 colors[ImGuiCol_Border] = ImVec4(0.19f, 0.19f, 0.19f, 0.29f);
1024 colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.24f);
1025 colors[ImGuiCol_FrameBg] = ImVec4(0.05f, 0.05f, 0.05f, 0.54f);
1026 colors[ImGuiCol_FrameBgHovered] = ImVec4(0.19f, 0.19f, 0.19f, 0.54f);
1027 colors[ImGuiCol_FrameBgActive] = ImVec4(0.20f, 0.22f, 0.23f, 1.00f);
1028 colors[ImGuiCol_TitleBg] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
1029 colors[ImGuiCol_TitleBgActive] = ImVec4(0.06f, 0.06f, 0.06f, 1.00f);
1030 colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
1031 colors[ImGuiCol_MenuBarBg] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f);
1032 colors[ImGuiCol_ScrollbarBg] = ImVec4(0.05f, 0.05f, 0.05f, 0.54f);
1033 colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.34f, 0.34f, 0.34f, 0.54f);
1034 colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.40f, 0.40f, 0.40f, 0.54f);
1035 colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.56f, 0.56f, 0.56f, 0.54f);
1036 colors[ImGuiCol_CheckMark] = ImVec4(0.33f, 0.67f, 0.86f, 1.00f);
1037 colors[ImGuiCol_SliderGrab] = ImVec4(0.34f, 0.34f, 0.34f, 0.54f);
1038 colors[ImGuiCol_SliderGrabActive] = ImVec4(0.56f, 0.56f, 0.56f, 0.54f);
1039 colors[ImGuiCol_Button] = ImVec4(0.05f, 0.05f, 0.05f, 0.54f);
1040 colors[ImGuiCol_ButtonHovered] = ImVec4(0.19f, 0.19f, 0.19f, 0.54f);
1041 colors[ImGuiCol_ButtonActive] = ImVec4(0.20f, 0.22f, 0.23f, 1.00f);
1042 colors[ImGuiCol_Header] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
1043 colors[ImGuiCol_HeaderHovered] = ImVec4(0.00f, 0.00f, 0.00f, 0.36f);
1044 colors[ImGuiCol_HeaderActive] = ImVec4(0.20f, 0.22f, 0.23f, 0.33f);
1045 colors[ImGuiCol_Separator] = ImVec4(0.28f, 0.28f, 0.28f, 0.29f);
1046 colors[ImGuiCol_SeparatorHovered] = ImVec4(0.44f, 0.44f, 0.44f, 0.29f);
1047 colors[ImGuiCol_SeparatorActive] = ImVec4(0.40f, 0.44f, 0.47f, 1.00f);
1048 colors[ImGuiCol_ResizeGrip] = ImVec4(0.28f, 0.28f, 0.28f, 0.29f);
1049 colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.44f, 0.44f, 0.44f, 0.29f);
1050 colors[ImGuiCol_ResizeGripActive] = ImVec4(0.40f, 0.44f, 0.47f, 1.00f);
1051 colors[ImGuiCol_Tab] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
1052 colors[ImGuiCol_TabHovered] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f);
1053 colors[ImGuiCol_TabActive] = ImVec4(0.20f, 0.20f, 0.20f, 0.36f);
1054 colors[ImGuiCol_TabUnfocused] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
1055 colors[ImGuiCol_TabUnfocusedActive] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f);
1056 colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
1057 colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
1058 colors[ImGuiCol_PlotHistogram] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
1059 colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
1060 colors[ImGuiCol_TableHeaderBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
1061 colors[ImGuiCol_TableBorderStrong] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
1062 colors[ImGuiCol_TableBorderLight] = ImVec4(0.28f, 0.28f, 0.28f, 0.29f);
1063 colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
1064 colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.06f);
1065 colors[ImGuiCol_TextSelectedBg] = ImVec4(0.20f, 0.22f, 0.23f, 1.00f);
1066 colors[ImGuiCol_DragDropTarget] = ImVec4(0.33f, 0.67f, 0.86f, 1.00f);
1067 colors[ImGuiCol_NavHighlight] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
1068 colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 0.00f, 0.00f, 0.70f);
1069 colors[ImGuiCol_NavWindowingDimBg] = ImVec4(1.00f, 0.00f, 0.00f, 0.20f);
1070 colors[ImGuiCol_ModalWindowDimBg] = ImVec4(1.00f, 0.00f, 0.00f, 0.35f);
1072 ImGuiStyle& style = ImGui::GetStyle();
1073 style.WindowPadding = ImVec2(8.00f, 8.00f);
1074 style.FramePadding = ImVec2(5.00f, 2.00f);
1075 style.CellPadding = ImVec2(6.00f, 6.00f);
1076 style.ItemSpacing = ImVec2(6.00f, 6.00f);
1077 style.ItemInnerSpacing = ImVec2(6.00f, 6.00f);
1078 style.TouchExtraPadding = ImVec2(0.00f, 0.00f);
1079 style.IndentSpacing = 25;
1080 style.ScrollbarSize = 15;
1081 style.GrabMinSize = 10;
1082 style.WindowBorderSize = 1;
1083 style.ChildBorderSize = 1;
1084 style.PopupBorderSize = 1;
1085 style.FrameBorderSize = 1;
1086 style.TabBorderSize = 1;