[cairo] glitz WGL backend

Maarten Breddels dmon at xs4all.nl
Tue Sep 21 07:50:41 PDT 2004

Tor Lillqvist wrote:

> > PS: could you mail me your code, so i can try out some things?
>Did you have any luck with the code I sent you?
Yes, i've seen the exact problems I also had when wring a wgl backend, 
but somehow they are gone now. The problem was, when drawing text i 
could only see a coloured square, i don't know how to reproduce this 

>For me, the day after I sent you that, my code suddenly stopped
>working (after I had catched up with the CVS updates)... Just a black
Arg, I had that too for a while. The problem was, that wglSwapBuffer(or 
the other wgl function to swap the buffers),  clears the other buffer, 
so if you call wglSwapBuffer twice, you'll get a black screen. This 
ofcourse doesn't happen when there is no double buffering.

>To make matters worse, I started getting crashes from nvoglnt.dll when
>calling glTexImage2D... (I have an ageing GeForce 2.) I dunno, could
>there be a bug in NVIDIA's code? It *seems* as if it tries to access
>textures past their limits (512 bytes form the start of the texture
>even if it is smaller). Sounds incredible that there would be such a
>bug in NVIDIA's code which surely has gone through lots of QA. Oh
>well, I put in a workaround, I always malloc() at least 512 bytes for
>the texture data ;-) Also preventing my code from finding the
>*_texture_rectangle extension(s) seems to help...
>Still, the black window problem prevailed. No matter how much
>debugging printout I added I couldn't figure out what's going on.
>Then suddenly today, after catching up with the (not that relevant to
>my problem, it seemed?) changes in CVS from today, it works
>again. Ugh... Although rendertest reports quite many of the cases "not
>supported". I could have sworn I earlier did see the projective
>transform tests work, for instance, but not any longer.
I can't help you with this one.

But I had to make some changes to the sourcecode but it's not cleaned up 
yet. This was needed to support creating a glitz surface when there 
allready is a current context. It works perfect, i was able to create an 
OpenGL canvas in Python using wxPython(=wxWidgets) and create a glitz 
surface using that context, and be able to draw on it using cairo.
One of the changes is that all wgl pixels formats need to be in the 
glitz_wgl_screen_info_t struct, since _glitz_add_format(in 
glitz_wgl_format.c) doesn't add similar glitz_format_t's twice, so some 
'pixel format's are excluded. So if a context was already created there 
wasn't a glitz_format with the right 'pixel format' in the struct. So i 
had to comment out the 'if (!glitz_format_find(...)){' stuff, so 
duplicate glitz_formats' are stored. Maybe it can be solved in another 
way, but haven't got anything else to work yet.

And thanks for the code, any chance it'll end up in the glitz cvs module 

-Maarten Breddels

More information about the cairo mailing list