plib-users Mailing List for PLIB (Page 27)
Brought to you by:
sjbaker
You can subscribe to this list here.
2000 |
Jan
|
Feb
(24) |
Mar
(54) |
Apr
(29) |
May
(58) |
Jun
(29) |
Jul
(675) |
Aug
(46) |
Sep
(40) |
Oct
(102) |
Nov
(39) |
Dec
(40) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(45) |
Feb
(23) |
Mar
(30) |
Apr
(64) |
May
(28) |
Jun
(61) |
Jul
(55) |
Aug
(35) |
Sep
(24) |
Oct
(23) |
Nov
(21) |
Dec
(67) |
2002 |
Jan
(98) |
Feb
(23) |
Mar
(13) |
Apr
(23) |
May
(43) |
Jun
(45) |
Jul
(54) |
Aug
(5) |
Sep
(56) |
Oct
(17) |
Nov
(53) |
Dec
(26) |
2003 |
Jan
(67) |
Feb
(36) |
Mar
(22) |
Apr
(35) |
May
(26) |
Jun
(35) |
Jul
(10) |
Aug
(49) |
Sep
(17) |
Oct
(3) |
Nov
(30) |
Dec
(10) |
2004 |
Jan
(12) |
Feb
(18) |
Mar
(52) |
Apr
(50) |
May
(22) |
Jun
(13) |
Jul
(16) |
Aug
(23) |
Sep
(21) |
Oct
(29) |
Nov
(6) |
Dec
(26) |
2005 |
Jan
(9) |
Feb
(19) |
Mar
(13) |
Apr
(19) |
May
(12) |
Jun
(8) |
Jul
(6) |
Aug
(10) |
Sep
(22) |
Oct
(3) |
Nov
(6) |
Dec
(17) |
2006 |
Jan
(10) |
Feb
(8) |
Mar
(5) |
Apr
(5) |
May
(6) |
Jun
(8) |
Jul
(8) |
Aug
(13) |
Sep
(2) |
Oct
(1) |
Nov
(9) |
Dec
(6) |
2007 |
Jan
(3) |
Feb
(4) |
Mar
(12) |
Apr
(2) |
May
(6) |
Jun
|
Jul
(22) |
Aug
|
Sep
(9) |
Oct
(13) |
Nov
|
Dec
|
2008 |
Jan
(1) |
Feb
(6) |
Mar
(2) |
Apr
(4) |
May
(15) |
Jun
(28) |
Jul
(8) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2009 |
Jan
(5) |
Feb
(5) |
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
(2) |
Apr
(7) |
May
(4) |
Jun
(2) |
Jul
(5) |
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
2011 |
Jan
(7) |
Feb
(2) |
Mar
(1) |
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
(1) |
Nov
(4) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: David L. <Dav...@no...> - 2004-03-23 13:33:05
|
On 3/23/04 at 7:30 AM Adam Courchesne wrote: >I saw on the site that closed source applications that use PLIB are >permitted... but after reading the LGPL I can't see how this is the case. >Sections 6 of the LGPL states that the code has to be made avaliable to >the >user in one form or another... isn't that what open source means? >Please advise... >-Adam > Section 5 basically states that a closed source program that dynamically links with an LGPL library is free from any restriction: "5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." so there's one way of using libraries with a closed source app. I'm not sure if plib builds any runtime libraries though - I'm sure I've read Steve ranting against c++ runtime libs before, but I'm probably talking rubbish now! Anyway, section 6 say's that if you statically link to an LGPL library, then you only have to distribute the object code of your app, not necessarily the source code. The intent appears to be to permit relinking with a modified version of the *library* if the user desires, for which object code is sufficient. " You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: * a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) * b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with." Pay particular attention to section a - you must accompany the library with source code FOR THE LIBRARY including any changes you made to the library to get it to link with your work, but the "work that uses the library" need only be accompanied by object code and/OR source code. There were a couple more provisos as well - you must permit reverse engineering so the user can debug etc, but essentially it seems you needn't redistribute your source. IANAL, I haven't read the whole license, I could be talking bollocks, take with a large pinch of salt, etc etc, Cheers - Dave |
From: Steve B. <sjb...@ai...> - 2004-03-23 13:17:44
|
Santosh Chatrapathi Jiture wrote: > I am facing problem in ssg.h and ss.h files, There is no 'ss.h' file. Did you mean 'sg.h' ?? > If possible plz send me these 2 files as attachment please, I can't do that without knowing what version of PLIB you have. You can download a fresh copy of PLIB from http://plib.sf.net > My problem is as follows; > > giving error as in ssg.h - undefined reference ssgContext::setFrustum(float, float, float, float, float, float) That function is defined in 'sg.h' - which is included in 'ssg.h'. I don't see what the problem is. Can you send us the complete compiler output? ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |
From: Adam C. <ajc...@ho...> - 2004-03-23 12:30:24
|
I saw on the site that closed source applications that use PLIB are permitted... but after reading the LGPL I can't see how this is the case. Sections 6 of the LGPL states that the code has to be made avaliable to the user in one form or another... isn't that what open source means? Please advise... -Adam _________________________________________________________________ MSN Toolbar provides one-click access to Hotmail from any Web page FREE download! http://clk.atdmt.com/AVE/go/onm00200413ave/direct/01/ |
From: Santosh C. J. <scj...@re...> - 2004-03-23 12:13:32
|
=0AHello,=0A=0AI am facing problem in ssg.h and ss.h files,=0A=0AIf possibl= e plz send me these 2 files as attachment please,=0A=0AMy problem is as fol= lows;=0A=0Agiving error as in ssg.h - undefined reference ssgContext::setFr= ustum(float, float, float, float, float, float)=0A=0Acan u clear my peoblem= please...=0A=0AI am waiting for your reply only,=0A=0ANothing more,=0A=0AT= hnaks and REgards,=0A=0ASantosh=0AOn Mon, 22 Mar 2004 Steve Baker wrote := =0A>Steve Baker wrote:=0A>=0A>>I think what's happening is that when end-us= er applications=0A>>do a '#include <plib/pu.h>', we try to deduce which win= dow=0A>>library he's using - and if he doesn't say - we fall back=0A>>and a= ssume he's using GLUT.=0A>>=0A>>What I think is the problem is that the 'pu= ' library code=0A>>knows to include puLocal.h instead of using the public= =0A>>interface in order to avoid the 'assumption' of GLUT.=0A>>=0A>>Looks l= ike we forgot to make that change to the puAux=0A>>library.=0A>=0A>Doh!!=0A= >=0A>Yep - that was it. I have it fixed in CVS.=0A>=0A>I'll put out a PLIB= 1.8.1 release soon. Does anyone else=0A>have any problems with the 1.8.0 = version?=0A>=0A>For the future: If you are working in the PU or PUAUX libs= ,=0A>it's *ESSENTIAL* to include puLocal.h or puAuxLocal.h and NOT=0A>'pu.h= ' or 'puAux.h'. Those are for the muggles,=0A>=0A>------------------------= ---- Steve Baker -------------------------=0A>HomeEmail: <sjbaker1@airmail.= net> WorkEmail: <sj...@li...>=0A>HomePage : http://www.sjbaker.org= =0A>Projects : http://plib.sf.net http://tuxaqfh.sf.net=0A> h= ttp://tuxkart.sf.net http://prettypoly.sf.net=0A>-----BEGIN GEEK CODE BLOCK= -----=0A>GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O= M-=0A>V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ = y++++=0A>-----END GEEK CODE BLOCK-----=0A>=0A>=0A>-------------------------= ------------------------------=0A>This SF.Net email is sponsored by: IBM Li= nux Tutorials=0A>Free Linux tutorial presented by Daniel Robbins, President= and CEO of=0A>GenToo technologies. Learn everything from fundamentals to s= ystem=0A>administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&o= p=3Dclick=0A>_______________________________________________=0A>plib-users = mailing list=0A>pli...@li...=0A>https://lists.sourcefor= ge.net/lists/listinfo/plib-users=0A |
From: Steve B. <sjb...@ai...> - 2004-03-21 19:18:16
|
Steve Baker wrote: > I think what's happening is that when end-user applications > do a '#include <plib/pu.h>', we try to deduce which window > library he's using - and if he doesn't say - we fall back > and assume he's using GLUT. > > What I think is the problem is that the 'pu' library code > knows to include puLocal.h instead of using the public > interface in order to avoid the 'assumption' of GLUT. > > Looks like we forgot to make that change to the puAux > library. Doh!! Yep - that was it. I have it fixed in CVS. I'll put out a PLIB 1.8.1 release soon. Does anyone else have any problems with the 1.8.0 version? For the future: If you are working in the PU or PUAUX libs, it's *ESSENTIAL* to include puLocal.h or puAuxLocal.h and NOT 'pu.h' or 'puAux.h'. Those are for the muggles, ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |
From: Steve B. <sjb...@ai...> - 2004-03-21 18:50:48
|
Samuel Mc Kee wrote: > I do a make install as root. Here's the output I get: g++ -DPACKAGE=\"plib\" -DVERSION=\"1.8.0\" -DHAVE_LIBPTHREAD=1 -DHAVE_LIBGL=1 -DHAVE_LIBDL=1 -DSTDC_HEADERS=1 -I. -I. -I../../src/sg -I../../src/pui -I../../src/fnt -I../../src/util -g -O2 -Wall -c -o puAux.o `test -f puAux.cxx || echo './'`puAux.cxx In file included from ../../src/pui/pu.h:2139, from puAux.h:27, from puAux.cxx:26: ../../src/pui/puGLUT.h:36:22: GL/glut.h: No such file or directory > I'm running Mandrake 9.2. > > Any clues? Well, it's complaining that GLUT (or freeglut) isn't installed. So installing freeglut will fix things up just fine. That's a simple thing to do - you can get freeglut from http://freeglut.sf.net - and it installs very easily. However, we're supposed to have fixed PLIB so it doesn't NEED GLUT/freeglut from version 1.8.0 onwards. I think what's happening is that when end-user applications do a '#include <plib/pu.h>', we try to deduce which window library he's using - and if he doesn't say - we fall back and assume he's using GLUT. What I think is the problem is that the 'pu' library code knows to include puLocal.h instead of using the public interface in order to avoid the 'assumption' of GLUT. Looks like we forgot to make that change to the puAux library. I'll fix it in the next release...but for this release it looks like you need GLUT in order to install PLIB even if you aren't using it. Sorry about that! -- ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |
From: Samuel Mc K. <ja...@sa...> - 2004-03-21 18:29:44
|
I do a make install as root. Here's the output I get: http://sammckee.com/logfile.txt I'm running Mandrake 9.2. Any clues? Thanks! Sam |
From: Steve B. <sjb...@ai...> - 2004-03-20 06:53:02
|
ANNOUNCINGE PLIB Version 1.8.0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are a LOT of major new features in this release - Many thanks are owed to many people for the effort they put into this software. Here is are the highlights: * puAux library added to provide a place for the more obscure PUI widgets. * PW (PLIB Windowing) library added to provide a built-in alternative to windowing libraries such as GLUT and SDL. Applications that only need a single window, mouse and keyboard (and no other features of GLUT) can now have no dependencies whatever outside of PLIB and OpenGL. * PLIB is now completely independent of GLUT. You can even build it without GLUT being installed. Modules to allow PUI to work with GLUT, freeglut, SDL, FLTK and our own PW windowing library are provided. * ssgAux now includes a relatively simple sky model kindly donated by the SimGear project. Now you can have sun, moon, stars and clouds with just a handful of function calls. * PSL (PLIB Scripting Language) - a C-like interpreted scripting language is now bundled into PLIB. It's a byte-code interpreter - and it has some useful properties for games and other interactive packages in that it allows the application much finer control over the running of the script(s) than traditional scripting engines. * In the demos area, we added the 'simon' package which provides a simple framework for PSL scripts to be loaded - and they may in turn load 3D models, move them around, etc. Astropong.psl (a simple 3D 'Pong' game in PSL) is provided as a demo. And of course, many bugs have been slain and numerous other smaller features have been added. There are a couple of outstanding problems with the MSVC project files - these will hopefully be fixed up in a couple of days. Windows users should be able to build with Cygwin without problems. Thanks again for everyone who helped: Steve Baker. ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |
From: Steve B. <sjb...@ai...> - 2004-03-19 00:09:21
|
Daniel T Konkle wrote: > At 04:06 PM 3/18/2004, you wrote: > >> Daniel T Konkle wrote: >> >>> Is it possible to get the SelectBox to wrap around its choices? >>> ie when it gets to the End of the list of strings to go to the >>> beginning of the strings? I've looked through the documentation and >>> my guess is no but I was hoping I was wrong. >> >> >> I don't think it does that - but it's a great idea. It's probably not >> hard to do. > > > I looked at the code and I'm not a good enough C++ programmer to make > the change. That's OK - maybe we could get John Fay to look into it. He has the dubious title of "Mr PUI". :-0 ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |
From: Daniel T K. <dan...@dy...> - 2004-03-18 22:57:11
|
At 04:06 PM 3/18/2004, you wrote: >Daniel T Konkle wrote: >>Is it possible to get the SelectBox to wrap around its choices? >>ie when it gets to the End of the list of strings to go to the beginning >>of the strings? I've looked through the documentation and my guess is no >>but I was hoping I was wrong. > >I don't think it does that - but it's a great idea. It's probably not >hard to do. I looked at the code and I'm not a good enough C++ programmer to make the change. |
From: Steve B. <sjb...@ai...> - 2004-03-18 22:07:41
|
Daniel T Konkle wrote: > > Is it possible to get the SelectBox to wrap around its choices? > ie when it gets to the End of the list of strings to go to the beginning > of the strings? I've looked through the documentation and my guess is > no but I was hoping I was wrong. I don't think it does that - but it's a great idea. It's probably not hard to do. ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |
From: Daniel T K. <dan...@dy...> - 2004-03-18 21:13:40
|
Is it possible to get the SelectBox to wrap around its choices? ie when it gets to the End of the list of strings to go to the beginning of the strings? I've looked through the documentation and my guess is no but I was hoping I was wrong. Danny PS Thanks for a great library! |
From: Steve B. <sjb...@ai...> - 2004-03-18 20:17:56
|
Michael Wessels wrote: > Hi all, > I am building my modells with AC3D. How can I identify in my c-code different objects of an AC3D-modell after loading it with ssgLoadAC ? I attach a comment to the model in AC3D. You can tell the PLIB loaders to call a callback function in the application when they find a comment field. They then hand you the responsibility of allocating that node in the scene graph - so you can make it be a ssgTransform node instead of a regular ssgBranch. In order to avoid actual comments in the '.ac' file triggering this, I put an unusual/distinctive character or string at the beginning of the comment. Beware though - the AC3D modeller has a tendancy to rearrange your model tree - and in the process it tends to delete the comments. Best advice is to build the model, get it looking completely right - and only add the magic comments at the very end. ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |
From: Michael W. <mic...@ti...> - 2004-03-18 18:36:49
|
Hi all, I am building my modells with AC3D. How can I identify in my c-code = different objects of an AC3D-modell after loading it with ssgLoadAC ? Best regards Michael |
From: lahiani m. <lah...@cs...> - 2004-03-11 22:34:22
|
please help me ineed to make some project on plib lib i try to use the plib librery but i can't i'm working on winxp on mvsc6 and when i open the dsw i get some message about sorce code "unable to connect to sorce code control project fnt....." what i need to do? after that when i try to build the project its dont work??? |
From: Adam C. <ajc...@ho...> - 2004-03-10 17:36:33
|
So has anybody looked at the AC loader problem whre it can't undrstand hao to interpret the 'crease' parameter? -Adam _________________________________________________________________ Frustrated with dial-up? Lightning-fast Internet access for as low as $29.95/month. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/ |
From: Steve B. <sjb...@ai...> - 2004-03-10 00:23:49
|
Ibrahim Mubarak wrote: > Hi again, > > After trying a few things, I thought of trying to build plib from source. So I do an apt-get > source, and try to build the .deb file. It told me that I needed xlibmesa-glu-dev. So I apt-got it > too. But why was this dependency issue brought up when building from source but wasn't with a > regular apt-get plib1.7-dev? Oh well... So now that plib was installed, I tried to recompile the > examples. I am still getting errors. But these are way different. Can you help me figure out what > is going on? I have no idea what apt-get does - or how that stuff was built. Your problem looks something like the header file you have is way out of date with respect to the binary of the library - or vice versa...but it's really hard to know what's going on when there are layers of Debian maintenance stuff doing the work. I strongly recommend removing anything to do with PLIB that may have been installed by apt-get or anything like that, then just downloading the tarball for PLIB from our sourceforge site - then doing: ./configure ; make install ...as we tell you to do in our instructions. Any other problems you have should be directed to the Debian maintainer for PLIB - I don't have anything to do with how they put that together - so it's very possible that it's broken somehow. ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |
From: Ibrahim M. <ib...@ya...> - 2004-03-09 17:05:05
|
Hi again, After trying a few things, I thought of trying to build plib from source. So I do an apt-get source, and try to build the .deb file. It told me that I needed xlibmesa-glu-dev. So I apt-got it too. But why was this dependency issue brought up when building from source but wasn't with a regular apt-get plib1.7-dev? Oh well... So now that plib was installed, I tried to recompile the examples. I am still getting errors. But these are way different. Can you help me figure out what is going on? Here is the output: ------------------------------------------- Making all in js make[1]: Entering directory `/.../plib-doc/src/js' c++ -DPACKAGE=\"plib_examples\" -DVERSION=\"1.6.1\" -DHAVE_LIBDL=1 -DSTDC_HEADERS=1 -DHAVE_GL_GL_H=1 -DHAVE_GL_GLU_H=1 -DGLUT_IS_PRESENT=1 -I. -I. -g -O2 -Wall -c js_demo.cxx c++ -g -O2 -Wall -L/usr/X11R6/lib -o js_demo js_demo.o -lplibjs -lplibul -ldl make[1]: Leaving directory `/.../plib-doc/src/js' Making all in pui make[1]: Entering directory `/.../plib-doc/src/pui' c++ -DPACKAGE=\"plib_examples\" -DVERSION=\"1.6.1\" -DHAVE_LIBDL=1 -DSTDC_HEADERS=1 -DHAVE_GL_GL_H=1 -DHAVE_GL_GLU_H=1 -DGLUT_IS_PRESENT=1 -I. -I. -g -O2 -Wall -c simple.cxx c++ -g -O2 -Wall -L/usr/X11R6/lib -o simple simple.o -lplibpu -lplibfnt -lplibsg -lplibul -lglut -lGLU -lGL -lSM -lICE -lXi -lXmu -lXext -lX11 -lm -ldl /usr/bin/ld: /lib/libgcc_s.so.1: warning: unexpected redefinition of `__divdi3@GLIBC_2.0' /lib/libgcc_s.so.1(*IND*+0x0): multiple definition of `__umoddi3@GLIBC_2.0' /lib/libc.so.6(.text+0x8a0): first defined here /lib/libgcc_s.so.1(*IND*+0x0): multiple definition of `__udivdi3@GLIBC_2.0' /lib/libc.so.6(.text+0x870): first defined here /usr/bin/ld: /lib/libgcc_s.so.1: warning: unexpected redefinition of `__moddi3@GLIBC_2.0' collect2: ld returned 1 exit status make[1]: *** [simple] Error 1 make[1]: Leaving directory `/.../plib-doc/src/pui' make: *** [all-recursive] Error 1 ------------------------------------------- Could it be that I have quite a few gcc's and two g++'s installed? Here is a little test I did: debian:~# dpkg --get-selections | grep gcc gcc install gcc-2.95 install gcc-3.0 install gcc-3.0-base install gcc-3.3-base install libgcc1 install debian:~# dpkg --get-selections | grep g++ g++ install g++-2.95 install I will hit google and see what I can figure out. Thank you, Ib __________________________________ Do you Yahoo!? Yahoo! Search - Find what youre looking for faster http://search.yahoo.com |
From: Ibrahim M. <ib...@ya...> - 2004-03-09 12:53:24
|
--- Steve Baker <sjb...@ai...> wrote: > > Well, it sounds to me like you have two versions of PLIB installed somehow. > > May I suggest (as 'root'): > > find / -name js.h -print > find / -name libplibjs\* -print > Hi, Thx for the fast response. Here are the results: > find / -name js.h -print /usr/include/plib/js.h > find / -name libplibjs\* -print /usr/lib/libplibjs.a So I do have only one installed. I made a make clean, then a make in the examples' directory and I am getting a little more output than what I included in my first message. I am not sure if it will help any, but here it is: Making all in js make[1]: Entering directory `/.../plib-doc/src/js' c++ -DPACKAGE=\"plib_examples\" -DVERSION=\"1.6.1\" -DHAVE_LIBDL=1 -DSTDC_HEADERS=1 -DHAVE_GL_GL_H=1 -DHAVE_GL_GLU_H=1 -DGLUT_IS_PRESENT=1 -I. -I. -g -O2 -Wall -c js_demo.cxx c++ -g -O2 -Wall -L/usr/X11R6/lib -o js_demo js_demo.o -lplibjs -lplibul -ldl js_demo.o: In function `jsJoystick::rawRead(int *, float *)': /usr/include/plib/js.h:557: undefined reference to `jsInit(void)' /usr/include/plib/js.h:702: undefined reference to `ulSetError(ulSeverity, char const *,...)' collect2: ld returned 1 exit status make[1]: *** [js_demo] Error 1 make[1]: Leaving directory `/.../plib-doc/src/js' make: *** [all-recursive] Error 1 Thanks, Ib __________________________________ Do you Yahoo!? Yahoo! Search - Find what youre looking for faster http://search.yahoo.com |
From: Steve B. <sjb...@ai...> - 2004-03-09 00:09:09
|
Ibrahim Mubarak wrote: > Hi, > > I am trying to compile a project that uses plib, but no use. I get a lot of "... undefined > reference to ..." errors. So I tried to compile the examples that came with the plib-doc package, > but I am getting the same kind of errors. To make sure that the plib header files were found at > compile time, I uninstalled plib and plib-dev. in this case I would get "plib/pu.h file not found" > etc... errors. I reinstalled plib and plib-dev. I am back to getting the "... undefined reference > to ..." errors. I think that the declerations for these functions are found, but not their > definitions. Anyone knows what is going on? Well, it sounds to me like you have two versions of PLIB installed somehow. May I suggest (as 'root'): find / -name js.h -print find / -name libplibjs\* -print ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |
From: Ibrahim M. <ib...@ya...> - 2004-03-08 18:53:25
|
Hi, I am trying to compile a project that uses plib, but no use. I get a lot of "... undefined reference to ..." errors. So I tried to compile the examples that came with the plib-doc package, but I am getting the same kind of errors. To make sure that the plib header files were found at compile time, I uninstalled plib and plib-dev. in this case I would get "plib/pu.h file not found" etc... errors. I reinstalled plib and plib-dev. I am back to getting the "... undefined reference to ..." errors. I think that the declerations for these functions are found, but not their definitions. Anyone knows what is going on? Here is my setup: I am using Debian with kernel 2.4.25 and the unstable packages plib1.7c102, plib1.7-dev, and plib-doc (version 1.6). These packages were installed using apt-get. I tried both plib version 1.7 and 1.6, but I am facing the same problem. Now I am using version 1.7. I am also using XFree 4.3 and KDE 3.1.5 I have both gcc 2.95 and 3.0 installed along with g++2.95. I don't know how to check which one is used by make. plib header files are installed in /usr/include/plib/ plib lib files are in /usr/lib/ Here is the output I get when I do a make in the examples' source directory: [...]/plib-doc/src$ make Making all in js make[1]: Entering directory `[...]/plib-doc/src/js' c++ -g -O2 -Wall -L/usr/X11R6/lib -o js_demo js_demo.o -lplibjs -lplibul -ldl js_demo.o: In function `jsJoystick::rawRead(int *, float *)': /usr/include/plib/js.h:557: undefined reference to `jsInit(void)' /usr/include/plib/js.h:702: undefined reference to `ulSetError(ulSeverity, char const *,...)' collect2: ld returned 1 exit status make[1]: *** [js_demo] Error 1 make[1]: Leaving directory `[...]/plib-doc/src/js' make: *** [all-recursive] Error 1 __________________________________ Do you Yahoo!? Yahoo! Search - Find what youre looking for faster http://search.yahoo.com |
From: Peter P. <pet...@st...> - 2004-03-08 16:14:38
|
"Paolo Leoncini" <p.l...@ci...> writes: Wee!!! Thanks, it works!! > Peter, >=20 > Ok, one step forward - let's set a state for the geometry (leaf) node. > For a leaf (ssgVTable, ssgVtxTable, or ssgVtxArray) a state tells OpenGL > about object material (properties, texture) as well as modes to > enable/disable. > The following code generates and returns a state with safe defaults: >=20 > ssgSimpleState *gen_state( char *tex_name ) > { > ssgSimpleState *st =3D new ssgSimpleState () ; >=20 > // st -> setName( mat -> name ); >=20 > st -> setMaterial ( GL_AMBIENT, 1.0f, 1.0f, 1.0f, 1.0f ); > st -> setMaterial ( GL_DIFFUSE, 1.0f, 1.0f, 1.0f, 1.0f ); > st -> setMaterial ( GL_SPECULAR, 0, 0, 0, 1 ); > st -> setMaterial ( GL_EMISSION, 0, 0, 0, 1 ); >=20 > st -> setShadeModel( GL_SMOOTH ); > st -> disable( GL_BLEND ); > st -> setOpaque(); >=20 > if ( tex_name !=3D NULL ) { > ssgTexture *tex =3D new ssgTexture(tex_name, 0, 0, 1); > if ( tex ) > st -> setTexture( tex ); > else > fprintf( stderr, "can't load texture from image > file %s\n", tex_name ); > st -> enable( GL_TEXTURE_2D ); > } else > st -> disable( GL_TEXTURE_2D ); >=20 > return st ; > } >=20 > Such a state is ready to be set for the leaf n you generated: >=20 > ssgSimpleState *s =3D gen_state( NULL /* tex_name */ ); // you > have set null tex coords, so it's better to not map any texture > n -> setState( s ); > s -> enable( GL_LIGHTING ); // or could disable it > if you supply good normals > s -> disable( GL_COLOR_MATERIAL ); // or could enable it if > you supply per-vertex colors >=20 > Since the default in SSG is to enable back face culling, at our stage is > safer to disable it for our unknown-winding triangle: >=20 > n -> setCullFace( FALSE ); >=20 > Note that face culling is set through a leaf method, not a state one. >=20 > Looking forward to hear about a "triangle born" - >=20 > Paolo >=20 >=20 > > -----Messaggio originale----- > > Da: pli...@li...=20 > > [mailto:pli...@li...] Per conto di=20 > > Peter Poulsen > > Inviato: luned=EC 8 marzo 2004 15.56 > > A: pli...@li... > > Oggetto: Re: [Plib-users] Drawing a simple triangle > >=20 > >=20 > > "Paolo Leoncini" <p.l...@ci...> writes: > >=20 > > > Peter, > > >=20 > > > on my opinion you just missed to set up a camera for=20 > > looking at scene=20 > > > objects. It can be done this way: > > >=20 > > > #include <plib/sg.h> > > >=20 > > > sgCoord camera; > > > SGfloat pos_x, pos_y, pos_z, yaw, pitch, roll; > > >=20 > > > // set pos_x, pos_y, pos_z, yaw, pitch and roll to some=20 > > suitable=20 > > > values > > > // then, before ssgCullAndDraw, actually set the SSG camera > > > sgSetCoord( camera, pos_x, pos_y, pos_z, yaw, pitch, roll ); > > > ssgSetCamera( &camera ); > > >=20 > > > SG is the prefix for the Plib math/geometry library stuffs. > > >=20 > > > Finding a plausible position for the init view (given a scene, in=20 > > > general, you could not know its extent along the three axes) it's a=20 > > > question of taste - I could suggest this: > > >=20 > > > sgSphere *sp =3D scene->getBSphere(); > > > SGfloat radius =3D sp->getRadius(); > > > SGfloat EyeDist =3D float( radius * 1.f / tan( float( fov_x/2 *=20 > > > SG_DEGREES_TO_RADIANS ) ) ); > > > SGfloat Ex, Ey, Ez; > > >=20 > > > pos_x =3D sp->getCenter()[0]; > > > pos_y =3D sp->getCenter()[1] + EyeDist; > > > pos_z =3D sp->getCenter()[2]; > > >=20 > > > Then, moving in 3D above or around the scene is a matter of=20 > > changing=20 > > > those six parameters to the sgSetCoord/ssgSetCamera (yaw is compass=20 > > > heading, pitch rotates around the screen x-axis, roll=20 > > around the axis=20 > > > norma to the screen). > > >=20 --=20 Yours=20 Peter Poulsen |
From: Paolo L. <p.l...@ci...> - 2004-03-08 15:44:46
|
Peter, Ok, one step forward - let's set a state for the geometry (leaf) node. For a leaf (ssgVTable, ssgVtxTable, or ssgVtxArray) a state tells OpenGL about object material (properties, texture) as well as modes to enable/disable. The following code generates and returns a state with safe defaults: ssgSimpleState *gen_state( char *tex_name ) { ssgSimpleState *st =3D new ssgSimpleState () ; // st -> setName( mat -> name ); st -> setMaterial ( GL_AMBIENT, 1.0f, 1.0f, 1.0f, 1.0f ); st -> setMaterial ( GL_DIFFUSE, 1.0f, 1.0f, 1.0f, 1.0f ); st -> setMaterial ( GL_SPECULAR, 0, 0, 0, 1 ); st -> setMaterial ( GL_EMISSION, 0, 0, 0, 1 ); st -> setShadeModel( GL_SMOOTH ); st -> disable( GL_BLEND ); st -> setOpaque(); if ( tex_name !=3D NULL ) { ssgTexture *tex =3D new ssgTexture(tex_name, 0, 0, 1); if ( tex ) st -> setTexture( tex ); else fprintf( stderr, "can't load texture from image file %s\n", tex_name ); st -> enable( GL_TEXTURE_2D ); } else st -> disable( GL_TEXTURE_2D ); return st ; } Such a state is ready to be set for the leaf n you generated: ssgSimpleState *s =3D gen_state( NULL /* tex_name */ ); // you have set null tex coords, so it's better to not map any texture n -> setState( s ); s -> enable( GL_LIGHTING ); // or could disable it if you supply good normals s -> disable( GL_COLOR_MATERIAL ); // or could enable it if you supply per-vertex colors Since the default in SSG is to enable back face culling, at our stage is safer to disable it for our unknown-winding triangle: n -> setCullFace( FALSE ); Note that face culling is set through a leaf method, not a state one. Looking forward to hear about a "triangle born" - Paolo > -----Messaggio originale----- > Da: pli...@li...=20 > [mailto:pli...@li...] Per conto di=20 > Peter Poulsen > Inviato: luned=EC 8 marzo 2004 15.56 > A: pli...@li... > Oggetto: Re: [Plib-users] Drawing a simple triangle >=20 >=20 > "Paolo Leoncini" <p.l...@ci...> writes: >=20 > > Peter, > >=20 > > on my opinion you just missed to set up a camera for=20 > looking at scene=20 > > objects. It can be done this way: > >=20 > > #include <plib/sg.h> > >=20 > > sgCoord camera; > > SGfloat pos_x, pos_y, pos_z, yaw, pitch, roll; > >=20 > > // set pos_x, pos_y, pos_z, yaw, pitch and roll to some=20 > suitable=20 > > values > > // then, before ssgCullAndDraw, actually set the SSG camera > > sgSetCoord( camera, pos_x, pos_y, pos_z, yaw, pitch, roll ); > > ssgSetCamera( &camera ); > >=20 > > SG is the prefix for the Plib math/geometry library stuffs. > >=20 > > Finding a plausible position for the init view (given a scene, in=20 > > general, you could not know its extent along the three axes) it's a=20 > > question of taste - I could suggest this: > >=20 > > sgSphere *sp =3D scene->getBSphere(); > > SGfloat radius =3D sp->getRadius(); > > SGfloat EyeDist =3D float( radius * 1.f / tan( float( fov_x/2 *=20 > > SG_DEGREES_TO_RADIANS ) ) ); > > SGfloat Ex, Ey, Ez; > >=20 > > pos_x =3D sp->getCenter()[0]; > > pos_y =3D sp->getCenter()[1] + EyeDist; > > pos_z =3D sp->getCenter()[2]; > >=20 > > Then, moving in 3D above or around the scene is a matter of=20 > changing=20 > > those six parameters to the sgSetCoord/ssgSetCamera (yaw is compass=20 > > heading, pitch rotates around the screen x-axis, roll=20 > around the axis=20 > > norma to the screen). > >=20 > Thanks for your contribution. Unfortunately it still does not=20 > work :-( It may of course be that I have misunderstood your=20 > suggestion, in particular I am not sure that the yaw is correct. >=20 > --- ssg_triangle.cc --- >=20 > #define USE_SSG 1 >=20 > #include <GL/gl.h> > #include <GL/glu.h> >=20 > #include <plib/ssg.h> > #include <SDL/SDL.h> > #include <iostream> >=20 > using namespace std; >=20 > ssgRoot* scene; > sgCoord camera; > SGfloat pos_x, pos_y, pos_z, yaw =3D 0.0f, pitch =3D 0.0f, roll =3D = 0.0f; >=20 >=20 > #define SCREEN_WIDTH 320 > #define SCREEN_HEIGHT 240 > #define SCREEN_BPP 24 >=20 > void init() > { > int videoFlags; > SDL_Surface* surface; >=20 > if ( SDL_Init( SDL_INIT_VIDEO ) < 0 ) { > fprintf( stderr, "Video initialization failed:=20 > %s\n", SDL_GetError( ) ); > exit(0); > } >=20 > videoFlags =3D SDL_OPENGL; > videoFlags |=3D SDL_GL_DOUBLEBUFFER; > videoFlags |=3D SDL_HWPALETTE; =20 > videoFlags |=3D SDL_HWSURFACE; > surface =3D SDL_SetVideoMode( SCREEN_WIDTH,=20 > SCREEN_HEIGHT, SCREEN_BPP, videoFlags ); >=20 > if ( !surface ) { > fprintf( stderr, "Video mode set failed:=20 > %s\n", SDL_GetError( ) ); > exit(0); > } >=20 > #ifdef USE_SSG > ssgInit(); > =09 > glClearColor(0.0f, 0.0f, 0.0f, 0.0f); > glEnable(GL_DEPTH_TEST); >=20 > ssgVertexArray* vertices =3D new ssgVertexArray; > sgVec3 x =3D { 0.5f, 2.5f , -0.25f }; > sgVec3 y =3D { -0.5f, 2.5f , -0.25f }; > sgVec3 z =3D { 0.0f, 1.5f , 0.75f };=20 > vertices->add(x); > vertices->add(y); > vertices->add(z); >=20 > sgVec4 white =3D { 1.0f, 1.0f, 1.0f, 0.5f }; > ssgColourArray* colours =3D new ssgColourArray; > colours->add(white); > colours->add(white); > colours->add(white); > ssgNormalArray* normals =3D new ssgNormalArray(3); > sgVec3 normal =3D { 0, -1.0f, 0 }; > normals->add(normal); > normals->add(normal); > normals->add(normal); > ssgTexCoordArray* texs =3D new ssgTexCoordArray(3); > sgVec2 tex_vec =3D {0,0}; > texs->add(tex_vec); > texs->add(tex_vec); > texs->add(tex_vec); > =09 > ssgVtxTable* n =3D new ssgVtxTable(GL_TRIANGLES,=20 > vertices, normals, texs, colours); > ssgTransform* trans =3D new ssgTransform; > trans->addKid(n); >=20 > scene =3D new ssgRoot; > scene->addKid(trans); >=20 > sgSphere *sp =3D scene->getBSphere(); > SGfloat radius =3D sp->getRadius(); > SGfloat EyeDist =3D float( radius * 1.f / tan( float(=20 > SCREEN_WIDTH/2 * SG_DEGREES_TO_RADIANS ) ) ); > SGfloat Ex, Ey, Ez; >=20 > pos_x =3D sp->getCenter()[0]; > pos_y =3D sp->getCenter()[1] + EyeDist; > pos_z =3D sp->getCenter()[2]; >=20 > #else > glClearColor(0.0f, 0.0f, 0.0f, 0.0f); > glEnable(GL_DEPTH_TEST); > #endif > } >=20 > void update() > { > glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) ; >=20 > #ifdef USE_SSG > sgSetCoord( &camera, pos_x, pos_y, pos_z, yaw, pitch, roll ); > ssgSetCamera( &camera ); > ssgCullAndDraw(scene); > #else > glLoadIdentity(); > =09 > glColor3f(1.0f, 1.0f, 1.0f); > glBegin(GL_TRIANGLES); > glVertex2f(0.5f, -0.25f); > glVertex2f(-0.5f, -0.25f); > glVertex2f(0.0f, 0.75f); > glEnd(); > #endif > SDL_GL_SwapBuffers( ); > } >=20 > int main(int argc, char *argv[]) > { > init(); > for(unsigned int i =3D 0; i < 1000; i++) { > update(); > } > return 0; > } >=20 >=20 > > Hoping you'll also love Plib for its simplicity not payed with=20 > > completness - >=20 > Me too :-) >=20 > If somebody could write a small program that shows a triangle=20 > I would really be happy. It does not have to be using SDL, as=20 > I have a decent understanding of both glut and OpenGL (it is=20 > just ssg that is giving me problems). >=20 > <snip> >=20 > --=20 > Yours=20 > Peter Poulsen >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President=20 > and CEO of GenToo technologies. Learn everything from=20 > fundamentals to system=20 > = administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck > _______________________________________________ > plib-users mailing list > pli...@li...=20 > https://lists.sourceforge.net/lists/listinfo/p> lib-users >=20 |
From: Karl M. H. <Kar...@gm...> - 2004-03-08 15:20:46
|
Read the plib-devel archives, I posted a sample code for this problem a while ago. On Monday 08 March 2004 2:17 pm, Walter Altice wrote: > How would I use the mouse pointer to pick on item in the scene graph? Do I > have to use ssgLOS? Sorry if this has been answered before, I'm a > newbeeeee. > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users -- quidquid latine dictum sit, altum viditur |
From: Peter P. <pet...@st...> - 2004-03-08 15:05:21
|
"Paolo Leoncini" <p.l...@ci...> writes: > Peter, > > on my opinion you just missed to set up a camera for looking at scene > objects. It can be done this way: > > #include <plib/sg.h> > > sgCoord camera; > SGfloat pos_x, pos_y, pos_z, yaw, pitch, roll; > > // set pos_x, pos_y, pos_z, yaw, pitch and roll to some suitable > values > // then, before ssgCullAndDraw, actually set the SSG camera > sgSetCoord( camera, pos_x, pos_y, pos_z, yaw, pitch, roll ); > ssgSetCamera( &camera ); > > SG is the prefix for the Plib math/geometry library stuffs. > > Finding a plausible position for the init view (given a scene, in > general, you could not know its extent along the three axes) it's a > question of taste - I could suggest this: > > sgSphere *sp = scene->getBSphere(); > SGfloat radius = sp->getRadius(); > SGfloat EyeDist = float( radius * 1.f / tan( float( fov_x/2 * > SG_DEGREES_TO_RADIANS ) ) ); > SGfloat Ex, Ey, Ez; > > pos_x = sp->getCenter()[0]; > pos_y = sp->getCenter()[1] + EyeDist; > pos_z = sp->getCenter()[2]; > > Then, moving in 3D above or around the scene is a matter of changing > those six parameters to the sgSetCoord/ssgSetCamera (yaw is compass > heading, pitch rotates around the screen x-axis, roll around the axis > norma to the screen). > Thanks for your contribution. Unfortunately it still does not work :-( It may of course be that I have misunderstood your suggestion, in particular I am not sure that the yaw is correct. --- ssg_triangle.cc --- #define USE_SSG 1 #include <GL/gl.h> #include <GL/glu.h> #include <plib/ssg.h> #include <SDL/SDL.h> #include <iostream> using namespace std; ssgRoot* scene; sgCoord camera; SGfloat pos_x, pos_y, pos_z, yaw = 0.0f, pitch = 0.0f, roll = 0.0f; #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 #define SCREEN_BPP 24 void init() { int videoFlags; SDL_Surface* surface; if ( SDL_Init( SDL_INIT_VIDEO ) < 0 ) { fprintf( stderr, "Video initialization failed: %s\n", SDL_GetError( ) ); exit(0); } videoFlags = SDL_OPENGL; videoFlags |= SDL_GL_DOUBLEBUFFER; videoFlags |= SDL_HWPALETTE; videoFlags |= SDL_HWSURFACE; surface = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, videoFlags ); if ( !surface ) { fprintf( stderr, "Video mode set failed: %s\n", SDL_GetError( ) ); exit(0); } #ifdef USE_SSG ssgInit(); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glEnable(GL_DEPTH_TEST); ssgVertexArray* vertices = new ssgVertexArray; sgVec3 x = { 0.5f, 2.5f , -0.25f }; sgVec3 y = { -0.5f, 2.5f , -0.25f }; sgVec3 z = { 0.0f, 1.5f , 0.75f }; vertices->add(x); vertices->add(y); vertices->add(z); sgVec4 white = { 1.0f, 1.0f, 1.0f, 0.5f }; ssgColourArray* colours = new ssgColourArray; colours->add(white); colours->add(white); colours->add(white); ssgNormalArray* normals = new ssgNormalArray(3); sgVec3 normal = { 0, -1.0f, 0 }; normals->add(normal); normals->add(normal); normals->add(normal); ssgTexCoordArray* texs = new ssgTexCoordArray(3); sgVec2 tex_vec = {0,0}; texs->add(tex_vec); texs->add(tex_vec); texs->add(tex_vec); ssgVtxTable* n = new ssgVtxTable(GL_TRIANGLES, vertices, normals, texs, colours); ssgTransform* trans = new ssgTransform; trans->addKid(n); scene = new ssgRoot; scene->addKid(trans); sgSphere *sp = scene->getBSphere(); SGfloat radius = sp->getRadius(); SGfloat EyeDist = float( radius * 1.f / tan( float( SCREEN_WIDTH/2 * SG_DEGREES_TO_RADIANS ) ) ); SGfloat Ex, Ey, Ez; pos_x = sp->getCenter()[0]; pos_y = sp->getCenter()[1] + EyeDist; pos_z = sp->getCenter()[2]; #else glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glEnable(GL_DEPTH_TEST); #endif } void update() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) ; #ifdef USE_SSG sgSetCoord( &camera, pos_x, pos_y, pos_z, yaw, pitch, roll ); ssgSetCamera( &camera ); ssgCullAndDraw(scene); #else glLoadIdentity(); glColor3f(1.0f, 1.0f, 1.0f); glBegin(GL_TRIANGLES); glVertex2f(0.5f, -0.25f); glVertex2f(-0.5f, -0.25f); glVertex2f(0.0f, 0.75f); glEnd(); #endif SDL_GL_SwapBuffers( ); } int main(int argc, char *argv[]) { init(); for(unsigned int i = 0; i < 1000; i++) { update(); } return 0; } > Hoping you'll also love Plib for its simplicity not payed with > completness - Me too :-) If somebody could write a small program that shows a triangle I would really be happy. It does not have to be using SDL, as I have a decent understanding of both glut and OpenGL (it is just ssg that is giving me problems). <snip> -- Yours Peter Poulsen |