<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hi Aashish,</span></div><div><span><br></span></div><div><span>Exactly, I need to set my application's OpenGL context to current between step 2 and 3. </span></div><div><span>But as I have created OpenGL context with GLUT, I could not get/set using GLUT.</span></div><div><span>And I dont like to use X window (I am currently on Ubuntu 11.10) as much as possible for platform independent sake.</span></div><div><span><br></span></div><div><span>Now please tell me how to do that? OR what is the best possible solution for above problem?</span></div><div><span><br></span></div><div><span>Many thanks,</span></div><div><span>Rudra </span></div><div><br></div> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new
york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Aashish Chaudhary <aashish.chaudhary@kitware.com><br> <b><span style="font-weight: bold;">To:</span></b> Rudra Poudel <emailrudra@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "vtkusers@vtk.org" <vtkusers@vtk.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, March 8, 2012 6:21 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [vtkusers] Getting back OpenGL Context after data display/visualization using VTK<br> </font> </div> <br>
<div id="yiv1527010308"><div class="yiv1527010308gmail_quote">On Thu, Mar 8, 2012 at 1:08 PM, Rudra Poudel <span dir="ltr"><<a rel="nofollow" ymailto="mailto:emailrudra@yahoo.com" target="_blank" href="mailto:emailrudra@yahoo.com">emailrudra@yahoo.com</a>></span> wrote:<br><blockquote class="yiv1527010308gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><div><span>Hi Aashish,</span></div><div><span><br></span></div><div><span>Thanks, just want to make sure I understood what you mean,</span></div>
<div><br></div><div>My program LOOP {</div><div>Step 1- I have FBO for main logic processing- this step working fine</div><div>Step 2- I want to use VTK for my results visualization only, then close all visualization windows</div>
<div>Step 3- Again would like to work with my FBO here- BUMP- ERROR- FBO is invalid due to STEP 2</div><div>}</div><div><br></div><div>Now my questions again,</div><div><span>1. Aashish you mean- if I will do/call Step 2 then I could not make FBO work in Step 3? There must be some solution, isn't? The reason I am asking this question is I dont like to write my own code for visualization (re-inventing the wheel :( )</span></div>
</div></div></blockquote><div><br></div><div>I see..if I understood your correctly, then between step 2 and 3 you would need to make your context current</div><div> </div><blockquote class="yiv1527010308gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><div><span>2. Can I build VTK
without OpenGL support?</span></div><div><br></div></div></div></blockquote><div>Not sure what you mean here? If you want to use VTK for rendering you have to use OpenGL (you can use Mesa), if you are using VTK for reading file, data filtering etc, then </div>
<div>you don't need to use OpenGL. </div><div> </div><blockquote class="yiv1527010308gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; ">
<div>Many thanks,</div></div></div></blockquote><div> </div><blockquote class="yiv1527010308gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; ">
<div>Rudra</div><div><br></div><div class="yiv1527010308hm yiv1527010308HOEnZb"> </div><div style="font-size:12pt;"><div class="yiv1527010308hm yiv1527010308HOEnZb"> </div><div style="font-size:12pt;">
<div class="yiv1527010308hm yiv1527010308HOEnZb"> <div dir="ltr"> <font face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Aashish Chaudhary <<a rel="nofollow" ymailto="mailto:aashish.chaudhary@kitware.com" target="_blank" href="mailto:aashish.chaudhary@kitware.com">aashish.chaudhary@kitware.com</a>><br>
<b><span style="font-weight:bold;">To:</span></b> Rudra Poudel <<a rel="nofollow" ymailto="mailto:emailrudra@yahoo.com" target="_blank" href="mailto:emailrudra@yahoo.com">emailrudra@yahoo.com</a>> <br><b><span style="font-weight:bold;">Cc:</span></b> "<a rel="nofollow" ymailto="mailto:vtkusers@vtk.org" target="_blank" href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>" <<a rel="nofollow" ymailto="mailto:vtkusers@vtk.org" target="_blank" href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>> <br>
<b><span style="font-weight:bold;">Sent:</span></b> Thursday, March 8, 2012 5:29 PM<br> <b><span style="font-weight:bold;">Subject:</span></b> Re: [vtkusers] Getting back OpenGL Context after data display/visualization using VTK<br>
</font> </div></div><div><div class="yiv1527010308h5"> <br>
<div><div>On Thu, Mar 8, 2012 at 11:36 AM, Rudra Poudel <span dir="ltr"><<a rel="nofollow" ymailto="mailto:emailrudra@yahoo.com" target="_blank" href="mailto:emailrudra@yahoo.com">emailrudra@yahoo.com</a>></span> wrote:<br><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div style="font-size:12pt;"><div><div><font face="'times new roman', 'new york', times, serif">Hi All, </font></div><div><font face="'times new roman', 'new york', times, serif"><br>
</font></div><div><span>- My application has Frame Buffer Object (FBO) for off-screen rendering ( I used GLUT to init OpenGL Context- i.e. trick of invisible GLUT window) </span><br>
</div><div><font face="'times new roman', 'new york', times, serif">- When I display/visualize data using VTK function/class as obviously it take-over/create-new OpenGL context </font></div><div><font face="'times new roman', 'new york', times, serif">- Then I delete all VTK related functions/classes</font></div>
<div><font face="'times new roman', 'new york', times, serif">- Now when I tried to work with FBO it
does-not-work/has-invalid-state. </font></div></div></div></div></blockquote><div><br></div><div>Since the FBO is created in different context you cannot use it in your glut context unless you created a shared FBO. It is bit tricky but doable. </div>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-size:12pt;"><div><div><font face="'times new roman', 'new york', times, serif"><br>
</font></div><div><font face="'times new roman', 'new york', times, serif">Questions, </font></div><div><font face="'times new roman', 'new york', times, serif">1. What is the best/easiest solution to get back OpenGL Context after data display/visualization using VTK? </font></div>
</div></div></div></blockquote><div> </div><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-size:12pt;">
<div><div><font face="'times new roman', 'new york', times, serif">2. Might be building VTK without OpenGL support- however this looks impossible or ...? </font></div></div></div></div></blockquote><div><br>
</div><div>If you are using VTK for data filtering, sources then you can build your app where rendering is done only by your code obviously widget's wont work then. </div><div><br></div><div> </div><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div style="font-size:12pt;"><div><div><font face="'times new roman', 'new york', times, serif"><br></font></div><div><font face="'times new roman', 'new york', times, serif">Thank you so much, </font></div>
<span><font color="#888888"><div><font face="'times new roman', 'new york', times, serif">Rudra</font></div></font></span></div></div></div><br>_______________________________________________<br>
Powered by <a rel="nofollow" target="_blank" href="http://www.kitware.com">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br>
<br>
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<br>
<br>
Follow this link to subscribe/unsubscribe:<br>
http://www.vtk.org/mailman/listinfo/vtkusers<br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>| Aashish Chaudhary <br>| R&D Engineer <br>| Kitware Inc. <br>| <a rel="nofollow" target="_blank" href="http://www.kitware.com">www.kitware.com</a> <br>
</div><br><br> </div></div></div> </div> </div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>| Aashish Chaudhary <br>| R&D Engineer <br>| Kitware Inc. <br>| <a rel="nofollow" target="_blank" href="http://www.kitware.com">www.kitware.com</a> <br>
</div><br><br> </div> </div> </div></body></html>