From 65146e985a7cb6ab434f1bd4594211f09e1a9409 Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Sun, 10 Sep 2023 15:21:45 +0300 Subject: [PATCH] gl: optimize grid drawing --- src/editor/f_main.pas | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas index 44cf2a4..bf92c22 100644 --- a/src/editor/f_main.pas +++ b/src/editor/f_main.pas @@ -2949,22 +2949,23 @@ begin else a := 0; + glDisable(GL_TEXTURE_2D); + glColor3ub(GetRValue(DotColor), GetGValue(DotColor), GetBValue(DotColor)); + glPointSize(DotSize); + glBegin(GL_POINTS); x := MapOffset.X mod DotStep; - y := MapOffset.Y mod DotStep; - while x < RenderPanel.Width do begin + y := MapOffset.Y mod DotStep; while y < RenderPanel.Height do begin - e_DrawPoint(DotSize, x + a, y + a, - GetRValue(DotColor), - GetGValue(DotColor), - GetBValue(DotColor)); + glVertex2i(x + a, y + a); y += DotStep; end; x += DotStep; - y := MapOffset.Y mod DotStep; end; + glEnd(); + glColor4ub(e_Colors.R, e_Colors.G, e_Colors.B, 255); end; // Превью текстуры: -- 2.29.2