[cairo] cairo & glitz-wgl problem

Vinnie Baines vin_13 at excite.com
Mon Nov 21 02:09:38 PST 2005


Hi all,

I'm having some trouble getting the glitz-wgl backend to work for me, wondered if anyone had any suggestions as to what might be the problem.

I was using a cut down version of the svg-example, which loaded an svg file and drew it to a win32 surface, which worked fine. I've now remade the cairo library I was using for this so that it uses glitz-wgl instead. I'm using the following lines to create the window and cairo surface,

glitz_wgl_init("opengl32.dll");
dformat = glitz_wgl_find_window_format(mask, &templ, 0);
    if (!dformat) {
    return 1;
  }

drawable = glitz_wgl_create_drawable_for_window(dformat,hWnd,width,height);
   if (!drawable) {
    return 1;
  }

 format = glitz_find_standard_format (drawable, GLITZ_STANDARD_ARGB32);
 glitz_surface_t *gs= glitz_surface_create (drawable,format,width, height,mask,attributes);
 glitz_drawable_buffer_t buffer;
  if (dformat-doublebuffer)
    buffer = GLITZ_DRAWABLE_BUFFER_BACK_COLOR;
  else
    buffer = GLITZ_DRAWABLE_BUFFER_FRONT_COLOR;

glitz_surface_attach (gs, drawable, buffer);
sr = cairo_glitz_surface_create (gs);
cr = cairo_create (sr);

This all compiles fine, but when I run it I get an empty window, with nothing inside it (you see the desktop behind it through the window). I'm not sure whether i'm not doing something right in how the window is created, or I need some sort of paint method out - I've got a case WM_PAINT in my LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) but not entirely sure what to put there, at the moment theres the svg_cairo_render (svgc, cr) line but the rest might be win32 surface specific.

Any thoughts/suggestions welcome!!

Thanks




_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!




More information about the cairo mailing list