1146 |
1146 |
1147 SetVertexPointer(@VertexBuffer[0], 4); |
1147 SetVertexPointer(@VertexBuffer[0], 4); |
1148 if Fill then |
1148 if Fill then |
1149 glDrawArrays(GL_TRIANGLE_FAN, 0, 4) |
1149 glDrawArrays(GL_TRIANGLE_FAN, 0, 4) |
1150 else |
1150 else |
|
1151 begin |
|
1152 glLineWidth(1); |
1151 glDrawArrays(GL_LINE_LOOP, 0, 4); |
1153 glDrawArrays(GL_LINE_LOOP, 0, 4); |
|
1154 end; |
1152 |
1155 |
1153 untint; |
1156 untint; |
1154 |
1157 |
1155 EnableTexture(True); |
1158 EnableTexture(True); |
1156 |
1159 |
1164 end; |
1167 end; |
1165 |
1168 |
1166 procedure DrawCircle(X, Y, Radius, Width: LongInt); |
1169 procedure DrawCircle(X, Y, Radius, Width: LongInt); |
1167 var |
1170 var |
1168 i: LongInt; |
1171 i: LongInt; |
1169 CircleVertex: array [0..59] of TVertex2f; |
1172 begin |
1170 begin |
1173 i:= Radius + Width; |
|
1174 if isDxAreaOffscreen(X - i, 2 * i) <> 0 then |
|
1175 exit; |
|
1176 if isDyAreaOffscreen(Y - i, 2 * i) <> 0 then |
|
1177 exit; |
|
1178 |
1171 for i := 0 to 59 do begin |
1179 for i := 0 to 59 do begin |
1172 CircleVertex[i].X := X + Radius*cos(i*pi/30); |
1180 VertexBuffer[i].X := X + Radius*cos(i*pi/30); |
1173 CircleVertex[i].Y := Y + Radius*sin(i*pi/30); |
1181 VertexBuffer[i].Y := Y + Radius*sin(i*pi/30); |
1174 end; |
1182 end; |
1175 |
1183 |
1176 EnableTexture(False); |
1184 EnableTexture(False); |
1177 glEnable(GL_LINE_SMOOTH); |
1185 glEnable(GL_LINE_SMOOTH); |
1178 //openglPushMatrix; |
1186 //openglPushMatrix; |
1179 glLineWidth(Width); |
1187 glLineWidth(Width); |
1180 SetVertexPointer(@CircleVertex[0], 60); |
1188 SetVertexPointer(@VertexBuffer[0], 60); |
1181 glDrawArrays(GL_LINE_LOOP, 0, 60); |
1189 glDrawArrays(GL_LINE_LOOP, 0, 60); |
1182 //openglPopMatrix; |
1190 //openglPopMatrix; |
1183 EnableTexture(True); |
1191 EnableTexture(True); |
1184 glDisable(GL_LINE_SMOOTH); |
1192 glDisable(GL_LINE_SMOOTH); |
1185 end; |
1193 end; |