Hi
I got it working now after changing the calling convention! ;)
I had to change the proto definition macro accordingly and all works fine now.
Attached is a demo that uses the code shown by JJ
Method CairoApp.OnPaint, uses esi, wParam:WPARAM, lParam:LPARAM
local PS:PAINTSTRUCT, hDC:HDC, Rct:RECT
local Surface:HANDLE, Context:HANDLE
SetObject esi
mov hDC, $invoke(BeginPaint, [esi].hWnd, addr PS)
mov Surface, $invoke(cairo_win32_surface_create, hDC)
mov Context, $invoke(cairo_create, Surface)
invoke cairo_rectangle, Context, $CReal8(20.0), $CReal8(30.0), $CReal8(100.0), $CReal8(100.0)
invoke cairo_set_source_rgba, Context, $CReal8(0.1), $CReal8(0.5), $CReal8(0.8), $CReal8(0.5)
invoke cairo_set_fill_rule, Context, CAIRO_FILL_RULE_EVEN_ODD
invoke cairo_fill, Context
invoke cairo_rectangle, Context, $CReal8(50.0), $CReal8(60.0), $CReal8(100.0), $CReal8(100.0)
invoke cairo_set_source_rgba, Context, $CReal8(0.3), $CReal8(0.7), $CReal8(0.8), $CReal8(0.5)
invoke cairo_set_fill_rule, Context, CAIRO_FILL_RULE_EVEN_ODD
invoke cairo_fill, Context
invoke cairo_rectangle, Context, $CReal8(80.0), $CReal8(90.0), $CReal8(100.0), $CReal8(100.0)
invoke cairo_set_source_rgba, Context, $CReal8(0.8), $CReal8(0.7), $CReal8(0.8), $CReal8(0.5)
invoke cairo_set_fill_rule, Context, CAIRO_FILL_RULE_EVEN_ODD
invoke cairo_fill, Context
invoke cairo_destroy, Context
invoke cairo_surface_destroy, Surface
invoke GetClientRect, [esi].hWnd, addr Rct
invoke DrawEdge, hDC, addr Rct, EDGE_SUNKEN, BF_RECT
invoke EndPaint, [esi].hWnd, addr PS
mov eax, TRUE
MethodEnd
To use the exe, put the cairo.dll in the same directory.
The rest is now experimenting with the API.
I reuploaded the modified include file set to the above post.
Biterider