Jeremy,<br><br>Thanks for keeping us updated on your progress.<br><br>I'm lurking also on cairo+gl path. I have gl code optimised<br>for the hardware and would like to take advantage of cairo.<br><br>I'm doing maps, so poly's could be VBO's (I suspect that this
<br>draw plenty of CPU as cairo must be re-tesselating at every frame)<br>and the fancy stuff would be done using cairo.<br><br>Well that's the theory atm :)<br><br><br>Cheers,<br><br>Sylvain.<br><br><div><span class="gmail_quote">
On 2/11/06, <b class="gmail_sendername">Jeremy Moles</b> <<a href="mailto:jeremy@emperorlinux.com">jeremy@emperorlinux.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
For historical reference (I'm sure other people in the future will find<br>this handy) I've uploaded the modified and working version of file<br>representing how to draw regular OpenGL and Glitz on the same frame.<br>(Thanks to Reveman, who is very much the man).
<br><br>It's quite, quite slow--so, the best thing to do (which I'm working on<br>now) would be to draw to a glX Pixel Buffer instead--when necessary--and<br>then glDrawPixels that onto your scene instead of diving into the Cairo
<br>API every frame. I haven't actually made this work yet, but I'm very<br>close (and will post that code too when it's done).<br><br><a href="http://www.cherustone.com/cairo.cpp">http://www.cherustone.com/cairo.cpp</a><br>
<br>On Tue, 2006-02-07 at 19:17 -0500, Jeremy Moles wrote:<br>> I wasn't expecting an immediate response to this or anything, so I'm<br>> just updating it with what I've tried so far. However, if what I'm<br>> trying is impossible at the moment I hope someone will tell me before I
<br>> waste the rest of my free time after work trying to get this to go. :)<br>><br>> Firstly, I can successfully use glitz to setup my glX context correctly<br>> to work with both of my "render functions." That is: I can use the code
<br>> I modified from cairogears to do the standard DRAWABLE->SURFACE->CONTEXT<br>> dance in glitz and then, in my "render loop", simply make calls to GL<br>> and everything works fine (lets call this function render_gl), never
<br>> once using anything to do w/ cairo. My function just spins a triangle on<br>> it's X axis.<br>><br>> Alternatively, I can not make any calls to GL and instead use standard<br>> cairo functions to draw paths, etc (lets call this function
<br>> render_cairo). This function creates a big, green X.<br>><br>> What I still can't do, however, is mix the too--even though, as far as I<br>> understand, I should be able to. I'm still very much a newcomer to
<br>> Xlib/GL/Cairo, so I could be wrong in my assumptions about how this<br>> should work. I've read through the GLX PDF from SGI, and that's where<br>> I'm getting my information. Furthermore, my older code does a lot of
<br>> what glitz does for me--setting up the context, making it "compatible"<br>> w/ X, etc.<br>><br>> I've updated the link below to reflect the small progress I've made. It<br>> almost works--or rather, the very first frame works. It may not be a
<br>> problem w/ glitz+cairo at all, but instead me not doing some steps<br>> between raw GL calls and cairo calls to make the GL "states" sane.<br>><br>> <a href="http://www.cherustone.com/cairo.cpp">
http://www.cherustone.com/cairo.cpp</a><br>><br>> On Mon, 2006-02-06 at 19:32 -0500, Jeremy Moles wrote:<br>> > I'm not sure if this question has been asked before, but my google-fu<br>> > was weak and I wasn't able to come up with anything.
<br>> ><br>> > I've been thinking about using Cairo (particularly, glitz) as the 2D API<br>> > for a small 3D engine I'm working with. I've been trying to integrate<br>> > glitz (using the code from cairogears) with my 3D engine, but have been
<br>> > entirely unsuccessful, mostly in part to my non-understanding of Cairo<br>> > at this low level.<br>> ><br>> > Does anyone have any code demonstrating this? Or, better, can anyone<br>> > write some very simple psuedocode showing how I should do it? The code
<br>> > I'm working with is here (much of it directly from cairogears):<br>> ><br>> > <a href="http://www.cherustone.com/cairo.cpp">http://www.cherustone.com/cairo.cpp</a><br>> ><br>> > Any help w/ this would be greatly, greatly appreciated.
<br>> ><br>> > _______________________________________________<br>> > cairo mailing list<br>> > <a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>> > <a href="http://cairographics.org/cgi-bin/mailman/listinfo/cairo">
http://cairographics.org/cgi-bin/mailman/listinfo/cairo</a><br>><br>> _______________________________________________<br>> cairo mailing list<br>> <a href="mailto:cairo@cairographics.org">cairo@cairographics.org
</a><br>> <a href="http://cairographics.org/cgi-bin/mailman/listinfo/cairo">http://cairographics.org/cgi-bin/mailman/listinfo/cairo</a><br><br>_______________________________________________<br>cairo mailing list<br><a href="mailto:cairo@cairographics.org">
cairo@cairographics.org</a><br><a href="http://cairographics.org/cgi-bin/mailman/listinfo/cairo">http://cairographics.org/cgi-bin/mailman/listinfo/cairo</a><br></blockquote></div><br>