Alpha blending with simple lines and shapes

BlitzMax Forums/BlitzMax Programming/Alpha blending with simple lines and shapes

Tylerbot(Posted 2007) [#1]
[SOLVED]

When I enable alpha blending and then draw a line with the built in functions, the line doesn't appear to be alpha blended (it's jaggy). What gives? It says in the help that lines are affected by the current blend mode. How can I fix this?

I expected the following program to draw "blended" lines with no aliasing:
Graphics 640,480
SetBlend ALPHABLEND
While Not AppTerminate()
	Cls
	DrawLine 10,10, MouseX()-5,MouseY()-5
	Flip
EndWhile



Brucey(Posted 2007) [#2]
Alpha blending is to do with transparency, rather than anti-aliasing.

As far as I know, DX7 doesn't do line anti-aliasing, but you cen enable it in OpenGL with "glEnable GL_LINE_SMOOTH".


Tylerbot(Posted 2007) [#3]
I've forgotten what one must do to make native DirectX or OpenGL calls; how would I make this glEnable call within my little example program?


Brucey(Posted 2007) [#4]
Assuming you are using the OpenGL driver...
glEnable GL_LINE_SMOOTH


;-)


ImaginaryHuman(Posted 2007) [#5]
Yeah alpha blend has nothing to do with altialiasing.


Tylerbot(Posted 2007) [#6]
Thanks for all the help guys, works great. And, thanks for the speedy replies!


TartanTangerine (was Indiepath)(Posted 2007) [#7]
Um, use my glowing lines stuff and remove the glow?