[Caca Labs] Topic #5 - Providing a window for libcaca to render into http://caca.zoy.org/discussion/topic/5 <p> Providing a window for libcaca to render into </p> en-us Caca Labs /static/caca-logo.png http://caca.zoy.org/discussion/topic/5 Trac 1.0.1 - DiscussionPlugin tdistler Sat, 24 Jul 2010 03:38:35 GMT Topic #5 - Providing a window for libcaca to render into http://caca.zoy.org/discussion/topic/5#topic http://caca.zoy.org/discussion/topic/5#topic <p> I've been thinking about writing a Windows GDI driver for libcaca. However, I want to be able to pass it an HWND handle to an existing window to render into (for tight app integration). If the HWND is *not* provided, then the driver would create it's own window. </p> <p> I looked through the active tickets and found a related enhancement for "render(ing) in an X drawable"... <a href="http://caca.zoy.org/ticket/57">http://caca.zoy.org/ticket/57</a> </p> <p> I'd like some feedback on my plan: </p> <ol><li>Modify caca_create_display() so it takes an additional argument (type: void*). This argument can be NULL (i.e. optional). Let's call it "extern_ctx". This is a driver-specific context... like an HWND or XID or data structure, etc. </li></ol><ol start="2"><li>Modify caca_create_display_with_driver() to also take the "extern_ctx" argument. </li></ol><ol start="3"><li>Add "void * extern_ctx" to the caca_display::drv structure. </li></ol><ol start="4"><li>Modify caca_create_display_with_driver() so it assigns extern_ctx to caca_display::drv::extern_ctx before the call to caca_install_driver(). </li></ol><ol start="5"><li>Write a driver called "gdi". </li></ol><p> Thoughts? </p> <p> NOTE: I didn't like the idea of adding the driver-specific context to caca_display::drv::driver_private for a couple reasons: </p> <ol class="loweralpha"><li>caca_install_driver() would need to be modified to take extern_ctx. </li></ol><ol class="loweralpha" start="2"><li>caca_display::drv::init_graphics() would need to be modified to take extern_ctx... which would affect *all* drivers as it is a driver API change. </li></ol><p> These changes seemed too big, but I'm open to them if this is the *right* way to do it long term. </p> <p> -Thanks </p> Topic Shenuenes Mon, 27 Feb 2012 14:13:28 GMT Reply #9 to topic #5 - Providing a window for libcaca to render into http://caca.zoy.org/discussion/message/9#message9 http://caca.zoy.org/discussion/message/9#message9 <p> These days clothes are specially are created for mothers-to-be.Attempt fur North Face coats that would highlight your hips. If the kid enjoys his outside lifestyle far more then present a skipping rope, bicycle, motor bike or hammocks.Even though they still topped the record, their value declined a bit through the earlier year. GHD hair straighteners are a excellent invention have authorized us to design our hair to a salon high quality regular in ambigu speedy time.The Brazilian hair straightening therapy is amid the newest hair straightening goods that can be availed at various salons around you. The YKK zipper is located to the front with two hand warming pockets.In simple fact, you get to enjoy actual rewards of purchasing a number of apparels from the sportswear giant Columbia.If you do not allow the floor to dry lengthy adequate, the North Face coating will not stick when you starting applying.The trim tailored cut particularly of the sports designs hugs the body for that smooth search you particularly like.What had been they heading to do? They couldn't get home and they did not all have strategies to remain there, which was a large and unpredicted difficulty for numerous of them..A hundred years in the past, fur North Face coats have been an elegant and stylistic trend alternative that reflected the prosperity produced in the course of the Industrial Age. Ladies feel that there are so several clothes that you can get pleasure from sporting in summers but what about winters, what do you dress in during winters? Jackets and North Face coats are the finest delights for winter season months.You do not believe? So consider a search at the stars underneath to these enduring classics is how to match the Belstaff Jackets. The graphite shaft is designed to blend power and stability, with a light weight feel and an optimized tip profile for better distance and accuracy.At last, a lightweight shoe that doesn't sacrifice stability or cushioning. Not so a lot the run of the mill stuff, but the designer purses and designer purses ladies appear so nuts about.A handbag is also capable to maintain some female things these kinds of as make-up or hairbrush. &lt;a href="<a class="ext-link" href="http://www.tomsshoesuk.com/"><span class="icon">​</span>http://www.tomsshoesuk.com/</a>"&gt;cheap toms&lt;/a&gt; However, occupy two famous fields aren't enough, Nike also choose Forest the very best player for footwear similar to Nike trainers, Nike running and so forth.I name it shoe.Nation hook shoes are decorated with high-back shoes from Alice.These pair of shoes is really amazing." Each style, each with meaning, and some even hidden in an ancient story or legend of it.Bucks hum a bit,jump and ran away,only to hear the hoof when it ran over the rock was too loud chaotic sound. twenty five - $10.London Fog Women's Simple Breasted Belted Trench with Tab:Produced out of 100% polyester this coat has a button tab belt loop and a notched collar. However, Nike keep in mind that women are not able to run like Marion Jones, they dona¡¯t want to be a runner, they just want to run.aTyrion. </p> Message sam Fri, 20 Aug 2010 20:03:03 GMT Reply #2 to topic #5 - Providing a window for libcaca to render into http://caca.zoy.org/discussion/message/2#message2 http://caca.zoy.org/discussion/message/2#message2 <blockquote class="citation"> <p> I've been thinking about writing a Windows GDI driver for libcaca. However, I want to be able to pass it an HWND handle to an existing window to render into (for tight app integration). If the HWND is *not* provided, then the driver would create it's own window. </p> </blockquote> <p> That's a good idea, and a feature often requested. </p> <blockquote class="citation"> <ol><li>Modify caca_create_display() so it takes an additional argument (type: void*). This argument can be NULL (i.e. optional). Let's call it "extern_ctx". This is a driver-specific context... like an HWND or XID or data structure, etc. </li></ol><p> <br /> </p> <ol start="2"><li>Modify caca_create_display_with_driver() to also take the "extern_ctx" argument. </li></ol></blockquote> <p> We cannot modify function prototypes that are already present in a released version of libcaca. It would break all current binary applications. Also, I would advise against allowing to specify the driver. The obvious way would be to create a new function <tt>caca_create_display_with_surface(canvas, width, height, context)</tt>. However, some applications may want to do double buffering, hence this other suggestion: </p> <ul><li>Add a new driver called <tt>"memory"</tt> or <tt>"buffer"</tt>, and let the user use <tt>caca_create_display_with_driver()</tt> which is already there. </li><li>Add a new <tt>caca_set_display_buffer(buffer, format)</tt> that will allow the user to set the context. The format is a pixel format such as <tt>CACA_RGBA32</tt> or <tt>CACA_RGB16</tt>. These defines need to be defined in a new <tt>caca.h</tt> enum. </li></ul><p> This will allow the user to change the display buffer at each frame, and cope with canvas resizes by calling <tt>caca_get_display_width/height()</tt> before each frame. </p> <blockquote class="citation"> <ol start="3"><li>Add "void * extern_ctx" to the caca_display::drv structure. </li></ol></blockquote> <p> Good. </p> <blockquote class="citation"> <ol start="4"><li>Modify caca_create_display_with_driver() so it assigns extern_ctx to caca_display::drv::extern_ctx before the call to caca_install_driver(). </li></ol></blockquote> <p> It would set <tt>extern_ctx</tt> to <tt>NULL</tt> instead, and let <tt>caca_set_display_buffer()</tt> do the work. </p> <blockquote class="citation"> <p> Thoughts? <br /> NOTE: I didn't like the idea of adding the driver-specific context to caca_display::drv::driver_private for a couple reasons: <br /> </p> <ol class="loweralpha"><li>caca_install_driver() would need to be modified to take extern_ctx. </li></ol><p> <br /> </p> <ol class="loweralpha" start="2"><li>caca_display::drv::init_graphics() would need to be modified to take extern_ctx... which would affect *all* drivers as it is a driver API change. </li></ol></blockquote> <p> Right. It's not such a big deal since they're all private APIs, but I like your suggestion more. </p> <blockquote class="citation"> <p> These changes seemed too big, but I'm open to them if this is the *right* way to do it long term. </p> </blockquote> <p> Go ahead. It sounds nice to me! I'll definitely apply such a patch. </p> Message