Thread: [Plib-users] Using Multiple Window of GLUT
Brought to you by:
sjbaker
From: Michele F. <mi...@li...> - 2005-09-08 13:57:00
|
Hello, I have a problem when use glutCreateSubWindow. When add a sub window in the code, one of the window ( depending where I place ssgInit ) could'n visualize display list and texture. I've tryed to call ssgInit with current window set on main and sub window, but the problem continue... How can use multiple window with Plib and glut ? Thank to all and excuse me for my english. |
From: Paolo L. <p.l...@ci...> - 2005-09-08 14:17:27
|
If you are under Windows you need to share lists (display lists and = texture objects) through the wgl function wglShareLists, which takes two OpenGL contexes (returned by the function GetCurrentContext). Such two contexes are respectively the one where the textures/display = lists were created, and the new one willing to put hands on them (or in the reverse order, see doc). Under GLX similar functions do exist. Greetings - Paolo Leoncini > -----Messaggio originale----- > Da: pli...@li...=20 > [mailto:pli...@li...] Per conto di=20 > Michele Fanti > Inviato: gioved=EC 8 settembre 2005 0.42 > A: pli...@li... > Oggetto: [Plib-users] Using Multiple Window of GLUT >=20 >=20 >=20 > Hello, > I have a problem when use glutCreateSubWindow. > When add a sub window in the code, one of the window > ( depending where I place ssgInit ) could'n visualize=20 > display list and texture. > I've tryed to call ssgInit with current window set on main > and sub window, but the problem continue... > How can use multiple window with Plib and glut ? >=20 > Thank to all and excuse me for my english. >=20 >=20 > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference &=20 > EXPO September 19-22, 2005 * San Francisco, CA * Development=20 > Lifecycle Practices Agile & Plan-Driven Development *=20 > Managing Projects & Teams * Testing & QA Security * Process=20 > Improvement & Measurement * http://www.sqe.com/bsce5sf=20 > _______________________________________________ > plib-users mailing list > pli...@li...=20 > https://lists.sourceforge.net/lists/listinfo/plib-users >=20 |
From: Adnan B. <adn...@gm...> - 2005-09-08 16:25:15
|
you are already using glut that is glutCreateSubWindow and there are alot o= f=20 tutorial online which will help you to do wat you want.To be honest i didnt= =20 understand your question.You definately can creat subwindows and windows=20 seperate and depended as well.I think plui is not better than glut but you= =20 can try glui as well. bye Adnan On 9/7/05, Michele Fanti <mi...@li...> wrote: >=20 >=20 > Hello, > I have a problem when use glutCreateSubWindow. > When add a sub window in the code, one of the window > ( depending where I place ssgInit ) could'n visualize > display list and texture. > I've tryed to call ssgInit with current window set on main > and sub window, but the problem continue... > How can use multiple window with Plib and glut ? >=20 > Thank to all and excuse me for my english. >=20 >=20 > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle=20 > Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & Q= A > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users > |
From: Michele F. <mi...@li...> - 2005-09-08 17:16:23
|
Alle 18:24, gioved=EC 8 settembre 2005, Adnan Bhatti ha=20 scritto: > you are already using glut that is glutCreateSubWindow > and there are alot of tutorial online which will help you > to do wat you want.To be honest i didnt understand your > question.You definately can creat subwindows and windows > seperate and depended as well.I think plui is not better > than glut but you can try glui as well. > bye > Adnan You are quite right: I have think to a problem in Plib but I not have cosidered the "context" separation in glut. At this address I have find a solution ( =3D:-| ) for the=20 problem: http://www.opengl.org/resources/faq/technical/displaylist.htm I have already try with code like: glutCreateWindow( ....... ); =46irst_Ctx =3D glXGetCurrentContext( ........ ); Display =3D glXGetCurrentDisplay( ....... ); glutCreateSubWindow( ....... ); Second_Ctx =3D glXGetCurrentContext( ........ ); =2E... But for now when call "glXCopyContext( Display, First_Ctx,=20 Second_Ctx , GL_ALL_ATTRIB_BITS ) " the answer ( at run=20 time ) is a error ( GLXBadContext ). But this solution and the previous is not portables. Can I hope for a future feature in PW library? Thank |
From: Tinoshi K. <ti...@li...> - 2006-01-23 19:43:02
|
Hello everybody! Do you know how to use the gluUnProject with PLIB??? I need to do something like Sim City, so I have a terrain (a scenegraph) built using PLIB, and I need to put objects over it clicking with mouse! I'm trying to gluUnProject(x,y,0.0,...) and gluUnProject(x,y,1.0,...), and I create a sgLineSegment3 to connect the two points. Then I'd like to ssgLOS() this line with the scenegraph... but I'm going crazy!!! Do you know a easier way to do something like that??? Thanks!!! |
From: Paolo L. <p.l...@ci...> - 2006-01-27 09:42:59
|
Don't know if it's useful to you, this is the code I use taken from a = recent post to the list: int Project2d3d ( int x2, int y2, float& x3, float& y3, float& z3 ) // does transform 2d into 3d coordinates { GLint viewport[4] ; GLdouble modvmatrix[16], projmatrix[16] ; glGetIntegerv ( GL_VIEWPORT, viewport ) ; /* OpenGL y starts at lower left, X/Windows y starts at top left */ GLdouble y2gl =3D viewport[3] - y2 ; /* Update the Modelview and Projectionmatrix */ glMatrixMode ( GL_MODELVIEW ) ; ssgLoadModelviewMatrix () ; glMatrixMode ( GL_PROJECTION ) ; ssgLoadProjectionMatrix () ; /* Use GL power to find the depth of the projection */ GLfloat z2 ; glReadPixels ( x2, y2gl, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &z2 ) ; if ( z2 >=3D 1 ) return 0; /* Some more GL magic. Get the projection and modelview matrices */ glGetDoublev ( GL_MODELVIEW_MATRIX, modvmatrix ) ; glGetDoublev ( GL_PROJECTION_MATRIX, projmatrix ) ; GLdouble dx, dy, dz ; /* convert screen coords to object coords. */ int retcode =3D gluUnProject ( x2, y2gl, z2, modvmatrix, projmatrix, viewport, &dx, &dy, &dz ) ; x3 =3D dx ; y3 =3D dy ; z3 =3D dz ; return retcode; } Greetings - Paolo Leoncini > -----Messaggio originale----- > Da: pli...@li...=20 > [mailto:pli...@li...] Per conto di=20 > Tinoshi Kitazawa > Inviato: luned=EC 23 gennaio 2006 20.40 > A: pli...@li... > Oggetto: [Plib-users] gluUnProject help! >=20 >=20 > Hello everybody! >=20 > Do you know how to use the gluUnProject with PLIB??? I need=20 > to do something=20 > like Sim City, so I have a terrain (a scenegraph) built using=20 > PLIB, and I=20 > need to put objects over it clicking with mouse! I'm trying to=20 > gluUnProject(x,y,0.0,...) and gluUnProject(x,y,1.0,...), and=20 > I create a=20 > sgLineSegment3 to connect the two points. Then I'd like to=20 > ssgLOS() this=20 > line with the scenegraph... but I'm going crazy!!! Do you=20 > know a easier way=20 > to do something like that??? Thanks!!!=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep=20 > through log files for problems? Stop! Download the new AJAX=20 > search engine that makes searching your log files as easy as=20 > surfing the web. DOWNLOAD SPLUNK!=20 > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486& dat=3D121642 _______________________________________________ plib-users mailing list pli...@li... https://lists.sourceforge.net/lists/listinfo/plib-users |