D3D7 Gradient

BlitzMax Forums/BlitzMax Programming/D3D7 Gradient

_JIM(Posted 2009) [#1]
Hi!

I need some help writing a gradient function that works in D3D7. I've got a GL working one, but I can't seem to find the equivalents in D3D for the GL functions :(

I basically need equivalents for

glBegin
glEnd
glColor3f
glVertex2f


I've done a bit of searching through brl.d3d7max2d and brl.dxgraphics, but to no avail.


DStastny(Posted 2009) [#2]
This is pretty easy. Look at DrawRect

All you need to do is override the color vertices. There by default set when you setcolor so there not filled every call.

Add these vrts. can compute a drawcolor so you can get your gradient color or gradient alpha

vrts[3]=drawcolor
vrts[7]=drawcolor
vrts[11]=drawcolor
vrts[15]=drawcolor

Doug


_JIM(Posted 2009) [#3]
Hmm, that was pretty easy. Just had to convert to ARGB ints, change the colors and use "DrawRect".

Thanks :)