X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fengine%2Fe_graphics.pas;h=18e4c1a676a81416360fc4c950bd25f4081ae864;hb=385f70688f69aba255d1cdb9b7f0717bfe1b6945;hp=b78a175885a26b4652088019e36ac59cf8cdd50d;hpb=1277f7dae24440c069db3e55799c5250c0718a0a;p=d2df-sdl.git diff --git a/src/engine/e_graphics.pas b/src/engine/e_graphics.pas index b78a175..18e4c1a 100644 --- a/src/engine/e_graphics.pas +++ b/src/engine/e_graphics.pas @@ -1085,8 +1085,11 @@ end; procedure e_DrawLine(Width: Byte; X1, Y1, X2, Y2: Integer; Red, Green, Blue: Byte; Alpha: Byte = 0); +{$IFDEF USE_NANOGL} + var + v: array [0..3] of GLfloat; +{$ENDIF} begin -{$IFNDEF USE_NANOGL} // FIXIT: nanoGL doesn't support glBegin(GL_LINES) if e_NoGraphics then Exit; // Pixel-perfect lines if Width = 1 then @@ -1103,15 +1106,24 @@ begin glColor4ub(Red, Green, Blue, 255-Alpha); glLineWidth(Width); +{$IFDEF USE_NANOGL} + v[0] := X1; v[1] := Y1; v[2] := X2; v[3] := Y2; + glVertexPointer(2, GL_FLOAT, 0, @v[0]); + glEnableClientState(GL_VERTEX_ARRAY); + glDisableClientState(GL_COLOR_ARRAY); + glDisableClientState(GL_NORMAL_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDrawArrays(GL_LINES, 0, 4); +{$ELSE} glBegin(GL_LINES); glVertex2i(X1, Y1); glVertex2i(X2, Y2); glEnd(); +{$ENDIF} glColor4ub(e_Colors.R, e_Colors.G, e_Colors.B, 255); glDisable(GL_BLEND); -{$ENDIF} end; //------------------------------------------------------------------