you can fly!?

Tutorials & Videos

  Fast Digital Painting, powered by Project Dogwaffle
more news

more videos

API Changes and 3D Additions

let's howl

Previously undocumented plugin interface functions:

Dog_SetFrameRate( Byval fps as long)

'new plugin interface functions

Dog_LoadBMP(ByVal Filename As String, ByVal RenameBuffer As Boolean)
'if the size of the bmp is the same as the existing image, a new document won't be created.  It will load into the existing image.
Dog_SaveBMP(ByVal Filename As String, ByVal SaveAlpha As Boolean, RenameBuffer As Boolean)


'dogwaffle painting functions.

'draw with the currently selected brush

'functions for adding single frame imagery to a previously initialized anim brush.
if frame=false, a new brush will be created.  If true, no new brush will be initialized.  If you want to create an animbrush, you still need to call the function to create it before adding frames, then cycle through the animbrush, adding the frames.

'new buffer functions
'setting a grayscale image is pretty fast because only one channel has to be marshalled across process boundries.
Dog_SetGrayscale(buffer) 'sets a single grayscale image (and copies it to each of the r,g,b channels)
Dog_SetLUTImage(buffer) 'same as grayscale but pushes it through the current gradient (lut)
Dog_GetGrayscale 'gets a grayscale equivolent of the current image in a single array.  The r,g,b channels are averaged.
Public Function Dog_GetHwnd() As Long 'gets the hwnd of the window of the main program.

'new gradient functions.
Dog_LoadGradient(ByVal filename As String) As Boolean

There's a new Dogwaffle3D class in the plugin interface.
It's just like the dogwaffle object, except it's called Dogwaffle3D.
'currently it consists of low level functions for rendering shaded triangles, transformation matrices and vector functions.

The 3d functions implement some of the basic requirements of a simple 3d rendering engine, namely, fast shaded triangles and a tranformation matrix for rotating, scaling and tranforming points simply and quickly.  Rendering is accomplished with a fast software implementation and should be adequate for borderline realtime rendering of simple objects and scenes.Other functions such as a projection matrix is not indluded as of yet and can be accomplished by the developer as they see fit.  One of the simplest means of 3d projections is simply to divide the x and y coordinates by the z.

'returns a transformation matrix in a 4x4 array.
 Public Function TransformationMatrix(ByVal tx As Single, ByVal ty As Single, ByVal tz As Single, ByVal heading As Single, ByVal pitch As Single, ByVal bank As Single, ByVal scalex As Single, ByVal scaley As Single, ByVal scalez As Single) As Variant

'renders a shaded triangle into the dogwaffle buffer
Public Sub Triangle(x0 As Single, y0 As Single, x1 As Single, y1 As Single, x2 As Single, y2 As Single, _
ByVal r1 As Long, ByVal g1 As Long, ByVal b1 As Long, _
ByVal r2 As Long, ByVal g2 As Long, ByVal b2 As Long, _
ByVal r3 As Long, ByVal g3 As Long, ByVal b3 As Long _
'you need to call dogwaffle.dog_refresh to be able to see it after it's rendered.'
'rendering single triangles at a time can get slow because of the com interface and marshaling.  Therefore, there is a DrawTriangles function that takes an array of triangle parameters of any size and will draw them all.

'the triangle functions clips triangles on image borders, and eliminate triangles that fall outside of screen boundaries, but if using ludicrous numbers of triangles, it could be more efficient to roll your own code to eliminate them.  It's up to the developer to do backface removal at this time.

There's a new SimpleRefresh method in the Dogwaffle3d interface that's a little faster than regular screen refreshes, for example if you need to do many refreshes in a loop, but you should call the regular screen refresh afterwords to ensure that the layers panel and other panels have their icons redrawn.

Several math functions and constants have been added for convenience, such as dot_product, but using local functions may be faster due to marshalling in the com interface.

more SDK stuff

Join the fight against MS
hate MS? join the fight
donate to the
National Multiple Sclerosis Society (Northern New York regional chapter)