Compare commits

...
97 Commits
Author SHA1 Message Date
Clifford Yapp 3d32fb8c26 Togl is no longer of interest - remove dmtogl branch (svn branch delete)
svn:revision:62156
svn:branch:dmtogl
svn:account:starseeker
2014-08-15 13:11:14 +00:00
Clifford Yapp 8547fb7418 Update dmtogl branch to trunk r41894
svn:revision:41896
svn:branch:dmtogl
svn:account:starseeker
2010-12-31 14:38:24 +00:00
Clifford Yapp 517c191889 Stick in a couple glDepthMask statements - probably will need them as this is an attempt to mix 2d and 3d, but right now they're not doing much.
svn:revision:39618
svn:branch:dmtogl
svn:account:starseeker
2010-06-17 18:52:49 +00:00
Clifford Yapp 7aa3e4c046 Clearly not correct yet, but start working on the problem of embedding the framebuffer in mged.
svn:revision:39610
svn:branch:dmtogl
svn:account:starseeker
2010-06-15 21:20:15 +00:00
Clifford Yapp fffbf84e9a Add Profont to the list - got the OK to use it under OFL.
svn:revision:39609
svn:branch:dmtogl
svn:account:starseeker
2010-06-15 01:27:05 +00:00
Clifford Yapp 530c3f13bb Whoops - let's give Togl_GetToglFromObj the right info...
svn:revision:39607
svn:branch:dmtogl
svn:account:starseeker
2010-06-14 20:44:20 +00:00
Clifford Yapp 84367d3785 For some reason, not getting a legal AGL context.
svn:revision:39606
svn:branch:dmtogl
svn:account:starseeker
2010-06-14 19:34:59 +00:00
Clifford Yapp 660da4874c Well, this doesn't crash outright, so hopefully it's somewhat close to correct...
svn:revision:39603
svn:branch:dmtogl
svn:account:starseeker
2010-06-14 14:53:49 +00:00
Clifford Yapp f15a68cdc7 Take a hint (hopefully correctly) from the ogl framebuffer code and get rid of the globals - put everything into a struct and pass it around in ifp.
svn:revision:39602
svn:branch:dmtogl
svn:account:starseeker
2010-06-14 14:40:55 +00:00
Clifford Yapp 1e7c257124 Make a list of togl stuff to be handled before its 'ready for prime time'
svn:revision:39601
svn:branch:dmtogl
svn:account:starseeker
2010-06-14 12:47:49 +00:00
Clifford Yapp bcb3fbf6c9 Update dmtogl branch to trunk r39590
svn:revision:39592
svn:branch:dmtogl
svn:account:starseeker
2010-06-12 20:22:13 +00:00
Clifford Yapp cfcd92430f Huh - bu_vls gums up the works. Revert to using a char array and things are OK.
svn:revision:39591
svn:branch:dmtogl
svn:account:starseeker
2010-06-11 20:15:08 +00:00
Clifford Yapp e400a0c7af Tweak some stuff - looks like there's a problem similar to the earlier togl dm issue with headers being out of order...
svn:revision:39583
svn:branch:dmtogl
svn:account:starseeker
2010-06-10 01:16:20 +00:00
Clifford Yapp 333bc1ea25 Not even remotely close to working, but start stubbing in some libfb togl stuff.
svn:revision:39582
svn:branch:dmtogl
svn:account:starseeker
2010-06-09 23:56:42 +00:00
Clifford Yapp 882f70b598 Try not warping on event generation.
svn:revision:39578
svn:branch:dmtogl
svn:account:starseeker
2010-06-08 16:37:31 +00:00
Clifford Yapp 34cac3c59e Try togl in Archer
svn:revision:39571
svn:branch:dmtogl
svn:account:starseeker
2010-06-07 20:42:38 +00:00
Clifford Yapp 0a530c1d2d Oh yeah, the key bindings should use Tk_PathName too.
svn:revision:39570
svn:branch:dmtogl
svn:account:starseeker
2010-06-07 20:34:41 +00:00
Clifford Yapp 676348f375 For this application we need Tk_PathName
svn:revision:39568
svn:branch:dmtogl
svn:account:starseeker
2010-06-07 20:22:11 +00:00
Clifford Yapp 35d65690a5 Wince. This is ugly, but works - pass up the combinations of modifier and button keys.
svn:revision:39566
svn:branch:dmtogl
svn:account:starseeker
2010-06-07 20:06:05 +00:00
Clifford Yapp 1c4e36f588 Ah HAH! need to send the Motion events back up to the parent. Stand-alone classic mode window now has motion.
svn:revision:39565
svn:branch:dmtogl
svn:account:starseeker
2010-06-07 19:14:59 +00:00
Clifford Yapp 009ffad472 Odd fixes and tweaks to dm-togl
svn:revision:39564
svn:branch:dmtogl
svn:account:starseeker
2010-06-07 19:03:45 +00:00
Clifford Yapp 448e32d91c More mview tweaks.
svn:revision:39533
svn:branch:dmtogl
svn:account:starseeker
2010-06-03 18:47:45 +00:00
Clifford Yapp d02faa7107 Try this, after consulting with Bob - change how the grid handles resizing instead of manually forcing window size.
svn:revision:39530
svn:branch:dmtogl
svn:account:starseeker
2010-06-03 18:03:41 +00:00
Clifford Yapp c89360baf4 I don't think this is quite the right number yet, but at least it's not a magic number
svn:revision:39505
svn:branch:dmtogl
svn:account:starseeker
2010-06-02 19:28:26 +00:00
Clifford Yapp 5a48047169 No need for the startup messageboxes now...
svn:revision:39504
svn:branch:dmtogl
svn:account:starseeker
2010-06-02 19:01:36 +00:00
Clifford Yapp 2f2e50c835 Grumble... for some reason Aqua Tk windows aren't keeping up with the resizing of the parent properly, so try to pick up the slack...
svn:revision:39503
svn:branch:dmtogl
svn:account:starseeker
2010-06-02 18:57:50 +00:00
Clifford Yapp 6ccb95d0e5 OK, this gets resizing going, although the intermediate states aren't quite smooth...
svn:revision:39493
svn:branch:dmtogl
svn:account:starseeker
2010-06-02 02:12:15 +00:00
Clifford Yapp 805c8740fc Swap tk.h and togl.h here to in case it matters.
svn:revision:39492
svn:branch:dmtogl
svn:account:starseeker
2010-06-02 00:44:42 +00:00
Clifford Yapp 4bae45616f Mutter, mutter... OK, so that was it - need to include tk.h BEFORE including togl.h
svn:revision:39491
svn:branch:dmtogl
svn:account:starseeker
2010-06-01 22:05:41 +00:00
Clifford Yapp 48e155f0e9 What the... getting SOME action when calling the binding routine from mged_attach rather than Togl_dm_init, despite interp pointer being the same... ANY call to Tcl_Eval in Togl_dm_init causes problems.
svn:revision:39490
svn:branch:dmtogl
svn:account:starseeker
2010-06-01 21:51:27 +00:00
Clifford Yapp 1f636033ca Update dmtogl branch to trunk r39482
svn:revision:39483
svn:branch:dmtogl
svn:account:starseeker
2010-05-28 18:03:24 +00:00
Clifford Yapp 5c69f99450 Break the offending line out into its own function to make sure it's isolated in a breakpoint sense - doesn't help functionally.
svn:revision:39482
svn:branch:dmtogl
svn:account:starseeker
2010-05-28 00:38:17 +00:00
Clifford Yapp 3c0634e4a5 doing anything with the interp after doing dm_open with togl is causing memory issues - not clear why yet.
svn:revision:39481
svn:branch:dmtogl
svn:account:starseeker
2010-05-28 00:13:56 +00:00
Clifford Yapp 56eaae9b43 The third else case results in an empty vls, which apparently AppendResult doesn't like... just do it in the two cases that work on vls
svn:revision:39480
svn:branch:dmtogl
svn:account:starseeker
2010-05-27 23:16:52 +00:00
Clifford Yapp b33d862909 try to be smarter about the name to use when packing a togl widget...
svn:revision:39479
svn:branch:dmtogl
svn:account:starseeker
2010-05-27 22:56:55 +00:00
Clifford Yapp 0de91174eb couple tweaks
svn:revision:39470
svn:branch:dmtogl
svn:account:starseeker
2010-05-25 21:50:40 +00:00
Clifford Yapp a6714613fc whoops, forgot dm.h
svn:revision:39467
svn:branch:dmtogl
svn:account:starseeker
2010-05-25 20:04:00 +00:00
Clifford Yapp 1d990ac249 Kinda-sorta code for togl display manager - doesn't fully work, but does get as far as displaying a wireframe.
svn:revision:39466
svn:branch:dmtogl
svn:account:starseeker
2010-05-25 20:02:22 +00:00
Clifford Yapp 27660a072c Re-create dmtogl branch off of trunk r39463
svn:revision:39465
svn:branch:dmtogl
svn:account:starseeker
2010-05-25 19:49:48 +00:00
Clifford Yapp fdac746a0a Time to return dmtogl to its original purpose - clear in anticipation of re-creating (svn branch delete)
svn:revision:39464
svn:branch:dmtogl
svn:account:starseeker
2010-05-25 19:48:25 +00:00
Clifford Yapp b47e99c605 The Goblin library looks like it may have some graph layout capabilities along the lines of graphviz, it's LGPL licensed, and it already has some apps by the dev team that talk to it using tcl/tk. Experiment with building it as part of BRL-CAD in the dmtogl branch, starting with the core libraries (no tcl/tk yet). Very definitely should NOT be put in trunk until there are BRL-CAD features using it, which will be a while even if the feature set does prove appropriate for our uses.
svn:revision:38335
svn:branch:dmtogl
svn:account:starseeker
2010-04-05 20:17:07 +00:00
Clifford Yapp 2b47a25ff2 Update dmtogl branch to 38325
svn:revision:38334
svn:branch:dmtogl
svn:account:starseeker
2010-04-05 19:49:01 +00:00
Clifford Yapp 988c450d22 Update dmtogl branch to r37924
svn:revision:37927
svn:branch:dmtogl
svn:account:starseeker
2010-03-05 21:14:44 +00:00
Clifford Yapp ce9d8f5c2b Eeek. Open Inventor patch no longer present on http://mevislab.de/inventor and not readily locatable online - stash in dmtogl branch for now to make sure it doesn't get lost since we may want it for an Inventor importer. Keeping it out of trunk since in its current form it has no direct bearing on BRL-CAD.
svn:revision:37919
svn:branch:dmtogl
svn:account:starseeker
2010-03-04 19:18:52 +00:00
Clifford Yapp cf6a595432 Update dmtogl branch to r37633
svn:revision:37635
svn:branch:dmtogl
svn:account:starseeker
2010-02-16 16:32:25 +00:00
Clifford Yapp bd34a352d0 Won't need USE_INTERP_RESULT any more once latest changes to trunk are synced in (thanks Sean.)
svn:revision:37628
svn:branch:dmtogl
svn:account:starseeker
2010-02-14 02:58:14 +00:00
Clifford Yapp 52adf3cded Put back the ZLIB stuff in tcl/tk, but don't add it to the build system - need a way to pass in an external dir with the objects from the looks of it, based on manual tweaking of the gcc command used for tcl...
svn:revision:37525
svn:branch:dmtogl
svn:account:starseeker
2010-02-02 18:14:00 +00:00
Clifford Yapp ab3e36b678 We're using the result slot, apparently one of the tcl TIP recommendations discourges it... need to dig into this one too.
svn:revision:37487
svn:branch:dmtogl
svn:account:starseeker
2010-01-29 19:45:25 +00:00
Clifford Yapp bb9262898a Still need itcl.h when doing BWISH with the new versions, apparently...
svn:revision:37486
svn:branch:dmtogl
svn:account:starseeker
2010-01-29 18:35:43 +00:00
Clifford Yapp 250ef1e923 Hack and slash the PNG support in Tk, which depends on the Zlib stuff removed from Tcl earlier. It appears that the Tcl/Tk solution to the problem we encountered earlier integrating tkpng was to also integrate zlib into Tcl, which means that Tcl itself is now going to conflict with our libz. Earlier compiler errors indicate that libtcl isn't going to be a suitable straight up linking replacement, so there's a situation here. Hopefully it can function enough for the AquaTk tests we need to run here, but it's not going to be an ignorable issue forever and probably will require Makefile.am hackery in tcl (at a minimum) to use BRL-CAD's libz.
svn:revision:37485
svn:branch:dmtogl
svn:account:starseeker
2010-01-29 18:13:38 +00:00
Clifford Yapp f725c608cb Add TODO file for tkhtml3
svn:revision:37484
svn:branch:dmtogl
svn:account:starseeker
2010-01-29 18:00:02 +00:00
Clifford Yapp 16b47beae1 Sync dmtogl to r37480
svn:revision:37483
svn:branch:dmtogl
svn:account:starseeker
2010-01-29 17:37:23 +00:00
Clifford Yapp 7e9d83fa2a Clear out the incrTcl Makefile.in files replaced by Makefile.am - eventually will need to do a more careful review of all this but for now byebye.
svn:revision:37480
svn:branch:dmtogl
svn:account:starseeker
2010-01-29 16:49:09 +00:00
Clifford Yapp 6052966a62 Oh yeah - get the build stuff for Tcl zlib
svn:revision:37478
svn:branch:dmtogl
svn:account:starseeker
2010-01-29 16:47:33 +00:00
Clifford Yapp 8c63f7f057 The new Tcl zlib stuff isn't playing well with BRL-CAD libz - need a way to sort this out. For now, nuke it, but this isn't the correct long term approach.
svn:revision:37477
svn:branch:dmtogl
svn:account:starseeker
2010-01-29 16:46:43 +00:00
Clifford Yapp b7fc0d5a20 Pull in regex.h changes from trunk.
svn:revision:37476
svn:branch:dmtogl
svn:account:starseeker
2010-01-29 16:44:36 +00:00
Clifford Yapp 28b20fa8b8 Need some tk stuff in the tkhtml3 build Makefile.am - not sure this is everything but it seems to build on gentoo.
svn:revision:37471
svn:branch:dmtogl
svn:account:starseeker
2010-01-29 14:22:25 +00:00
Clifford Yapp 0008966731 Whoops, wrong Makefile.am tweaks. Try again with tkhtml3.
svn:revision:37462
svn:branch:dmtogl
svn:account:starseeker
2010-01-29 00:01:19 +00:00
Clifford Yapp 6586b95cfb Tweaks to new tkhtml3 Makefile.am.
svn:revision:37461
svn:branch:dmtogl
svn:account:starseeker
2010-01-28 23:28:33 +00:00
Clifford Yapp c448fbf431 Ugh. Quick and dirty stab at getting tcl/tk and itcl/itk cvs versions building in BRL-CAD tree. Something not right - tkhtml3 isn't happy - but build at least gets past those directories. Right now it wants zlib subdir in tcl/compat - need to figure out how to remove the requirement.
svn:revision:37460
svn:branch:dmtogl
svn:account:starseeker
2010-01-28 22:16:40 +00:00
Clifford Yapp 0819e263ef Merge trunk into dmtogl through revision 37388.
svn:revision:37390
svn:branch:dmtogl
svn:account:starseeker
2010-01-22 04:30:44 +00:00
Clifford Yapp 91bdc731ce Tkhtml Makefile.am fixes - this setup has now successfully installed Tkhtml in such a fashion that package require Tkhtml succeeded.
svn:revision:37363
svn:branch:dmtogl
svn:account:starseeker
2010-01-20 22:47:50 +00:00
Clifford Yapp e319b14c59 Take a stab at creating a pkgIndex.tcl - dlopen doesn't seem to like the target library for some reason when given the output fo this rule as a pkgIndex.tcl, so some issues to resolve.
svn:revision:37362
svn:branch:dmtogl
svn:account:starseeker
2010-01-20 22:30:59 +00:00
Clifford Yapp 2e4b753635 More tkhtml3 svn:ignore tweakage
svn:revision:37323
svn:branch:dmtogl
svn:account:starseeker
2010-01-20 00:40:16 +00:00
Clifford Yapp 788a8da44e Add some svn:ignore settings for the autotools files.
svn:revision:37322
svn:branch:dmtogl
svn:account:starseeker
2010-01-20 00:32:28 +00:00
Clifford Yapp be523a6b2a Playing around with tkhtml3 Makefile.am some more...
svn:revision:37318
svn:branch:dmtogl
svn:account:starseeker
2010-01-19 23:20:07 +00:00
Clifford Yapp ea10013904 Won't need configure.in in this version any more...
svn:revision:37315
svn:branch:dmtogl
svn:account:starseeker
2010-01-19 20:59:04 +00:00
Clifford Yapp 7e2ced2087 Tantalizingly closer to a proper working autotools/TEA hybrid tkhtml build - this builds something and it doesn't list the files in configure.ac, but it's not yet got all the 'correct' names, versions, etc. plugged in.
svn:revision:37314
svn:branch:dmtogl
svn:account:starseeker
2010-01-19 20:58:37 +00:00
Clifford Yapp 37e8c24164 Upgrade dmtogl branch tcl/tk to 8.6cvs as of January 15, 2010.
svn:revision:37288
svn:branch:dmtogl
svn:account:starseeker
2010-01-16 17:00:43 +00:00
Clifford Yapp c221c8bd8a Start upgrading tcl in dmtogl branch
svn:revision:37286
svn:branch:dmtogl
svn:account:starseeker
2010-01-16 02:15:37 +00:00
Clifford Yapp 11a4c23d8e Ah yes, these files are now in the same directory as the Makefile.am.
svn:revision:37284
svn:branch:dmtogl
svn:account:starseeker
2010-01-15 21:21:42 +00:00
Clifford Yapp c1935573fe Not pretending this is remotely close to correct yet, but start working on a hybrid autotools/TEA build system for tkhtml3 using the Apache rivet work as a guide. Does NOT work. If we can actually get it working, the *.in files can go away.
svn:revision:37283
svn:branch:dmtogl
svn:account:starseeker
2010-01-15 21:15:43 +00:00
Clifford Yapp 697379b83d Update incrTcl to itcl-ng cvs version as of January 15, 2010. Unlike older incrTcl trees this appears to have its own configure.in script, so removing the Makefile.am logic - will have to switch BRL-CAD build logic to attempt a proper subconfigure, as of right now this won't build.
svn:revision:37277
svn:branch:dmtogl
svn:account:starseeker
2010-01-15 19:07:13 +00:00
Clifford Yapp 732b38c331 Install script is always in the unix directory, so make sure the install rules know that.
svn:revision:37270
svn:branch:dmtogl
svn:account:starseeker
2010-01-15 00:20:13 +00:00
Clifford Yapp c8c9ad43bf Need at least one file from the unix dir for includes.
svn:revision:37269
svn:branch:dmtogl
svn:account:starseeker
2010-01-14 23:42:13 +00:00
Clifford Yapp b51b4b5648 See what happens with the old 8.5 tcl/tk when this build logic is used.
svn:revision:37267
svn:branch:dmtogl
svn:account:starseeker
2010-01-14 22:37:21 +00:00
Clifford Yapp d1ce59f9d7 Sync dmtogl trunk to r37263.
svn:revision:37264
svn:branch:dmtogl
svn:account:starseeker
2010-01-14 22:04:36 +00:00
Clifford Yapp 35e91320f1 Start working on an upgrade to the way the build logic handles tcl/tk on OSX - looking ahead to 8.6 tcl/tk and Aqua support, we can no longer pretend OSX is unix and build the unix directory of tcl/tk - will need to use the actual macosx directory. Also, new work on the Tk Aqua backend is being done via Cocoa rather than Carbon, so need to reexamine what is needed for the non-X11 build flags to tcl/tk
svn:revision:37263
svn:branch:dmtogl
svn:account:starseeker
2010-01-14 22:03:03 +00:00
Clifford Yapp 49185fb6d6 Syncing dmtogl to trunk r32744
svn:revision:37247
svn:branch:dmtogl
svn:account:starseeker
2010-01-13 21:44:53 +00:00
Clifford Yapp 7edc197283 Update dmtogl branch to r37130
svn:revision:37136
svn:branch:dmtogl
svn:account:starseeker
2010-01-05 23:22:35 +00:00
Clifford Yapp a714b8e6b3 Update dmtogl branch to r37126
svn:revision:37127
svn:branch:dmtogl
svn:account:starseeker
2010-01-05 00:37:18 +00:00
Clifford Yapp 6dc65b3772 Sync dmtogl to r36912
svn:revision:36913
svn:branch:dmtogl
svn:account:starseeker
2009-12-15 19:11:28 +00:00
Clifford Yapp 2a52490f2c sync with trunk to r36810
svn:revision:36812
svn:branch:dmtogl
svn:account:starseeker
2009-12-05 19:33:35 +00:00
Clifford Yapp a33af6a828 Grab the libdm changes from trunk, pull other updates as long as we're doing it.
svn:revision:36663
svn:branch:dmtogl
svn:account:starseeker
2009-11-25 23:09:51 +00:00
Clifford Yapp fbbcd30bd6 More svn:ignore togl tweaks.
svn:revision:36661
svn:branch:dmtogl
svn:account:starseeker
2009-11-25 23:04:58 +00:00
Clifford Yapp 62afd190b8 Minor cleaups of togl within svn tree.
svn:revision:36659
svn:branch:dmtogl
svn:account:starseeker
2009-11-25 23:03:34 +00:00
Clifford Yapp ee8789c2db More dmtogl tweaking and setup.
svn:revision:36644
svn:branch:dmtogl
svn:account:starseeker
2009-11-25 21:52:50 +00:00
Clifford Yapp 45ec98834f Update ignore settings in dmtogl branch
svn:revision:36643
svn:branch:dmtogl
svn:account:starseeker
2009-11-25 19:22:27 +00:00
Clifford Yapp 4a0f634faf Add back in initial togl related code.
svn:revision:36634
svn:branch:dmtogl
svn:account:starseeker
2009-11-25 05:09:31 +00:00
Clifford Yapp 58ddfd09b5 Recreate the dmtogl branch with latest trunk as a start
svn:revision:36633
svn:branch:dmtogl
svn:account:starseeker
2009-11-25 04:45:45 +00:00
Clifford Yapp 94fe623e1d Ugh. Much faster to just remove and merge in the togl specific stuff again. (svn branch delete)
svn:revision:36632
svn:branch:dmtogl
svn:account:starseeker
2009-11-25 04:44:33 +00:00
Clifford Yapp d889150d31 Hrm, merging updates won't be so simple here. Take the incremental approach.
svn:revision:36631
svn:branch:dmtogl
svn:account:starseeker
2009-11-25 04:12:04 +00:00
Christopher Sean Morrison a11203ff8d rename from dmtogl-branch to just dmtogl. the -branch was a cvs convention that svn takes care of with a branches parent dir. not clear why the windows files are marked as modified as they still have CRLF line endings
svn:revision:36472
svn:branch:dmtogl
svn:account:brlcad
2009-11-12 12:10:28 +00:00
Clifford Yapp 7fca455fad Meh. togl_ws.h gets generated in the build directory not the source directory - handle it differently.
svn:revision:36189
svn:branch:dmtogl-branch
svn:account:starseeker
2009-10-15 03:51:55 +00:00
Clifford Yapp 5651deff6e Let's see if this makes togl build out of dir...
svn:revision:36187
svn:branch:dmtogl-branch
svn:account:starseeker
2009-10-13 19:14:13 +00:00
Clifford Yapp ee49525fd7 First code working toward togl integration into BRL-CAD build.
svn:revision:36186
svn:branch:dmtogl-branch
svn:account:starseeker
2009-10-13 16:44:33 +00:00
Clifford Yapp df4348cb9f Create branch to have a place to experiment with togl
svn:revision:36185
svn:branch:dmtogl-branch
svn:account:starseeker
2009-10-13 15:43:45 +00:00
139 changed files with 3574 additions and 925 deletions
+618
View File
@@ -1,3 +1,487 @@
/.deps␍/Makefile␍/Makefile.in␍/aclocal.m4␍/autom4te.cache␍/config.*␍/configure␍/install.*.log␍/libtool␍/ltmain.sh␍/so_locations␍/.settings␍/.project␍/.cdtproject␍/.cproject
/gattributes.5
/gattributes.html
/Makefile
/Makefile.in
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/*.user
/brlcad.ncb
/brlcad.suo
/Release
/Win32
/*.user
/Release
/Win32
/Win32
/*.user
/Win32
/*.user
/*.user
/Release
/Win32
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/*.user
/Release
/Win32
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/*.user
/Release
/Win32
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Win32
/*.user
/Makefile
/Makefile.in
/.deps
/.libs
/Makefile
/Makefile.in
/testfree
/solshoot
/g_lint
/g_diff
/g_transfer
/g_qa
/remapid
/Makefile
/Makefile.in
/.deps
/.libs
/.deps
/.libs
/Makefile
/Makefile.in
/brep_test
/prcomb
/librt.plg
/nurb_example
/namegen
/parsetest
/.deps
/.libs
/Makefile
/Makefile.in
/aclocal.m4
/autom4te.cache
/config.guess
/config.h
/config.h.in
/config.log
/config.status
/config.sub
/configure
/depcomp
/install-sh
/libpng-config
/libpng.pc
/libpng.sym
/libpng14-config
/libpng14.pc
/libtool
/ltmain.sh
/mkinstalldirs
/missing
/stamp-h1
/libpng.vers
/Makefile
/libtool
/aclocal.m4
/autom4te.cache
/config.log
/config.status
/configure
/libTkhtml*
/pkgIndex.tcl
/tkhtml.n
/Makefile.in
/.deps
/.libs
/cssprop.c
/cssprop.h
/htmldefaultstyle.c
/htmltokens.c
/htmltokens.h
/cssprop.tcl
/tokenlist.txt
/.deps
/Makefile
/Makefile.in
/aclocal.m4
/autom4te.cache
/config.*
/configure
/install.*.log
/libtool
/ltmain.sh
/so_locations
/libTktable2.10.so
/pkgIndex.tcl
/tkTable.tcl.h
/.deps
/Makefile
/Makefile.in
/aclocal.m4
/autom4te.cache
/config.*
/configure
/install.*.log
/libtool
/ltmain.sh
/so_locations
/*.g
/.deps
/.libs
@@ -44,3 +528,137 @@
/wavy
/wdb_example
/terrain
/Makefile
/Makefile.in
/.deps
/.libs
/Makefile
/Makefile.in
/alias-pix
/ap-pix
/asc-pl
/azel
/bary
/binfo
/bombardier
/buffer
/bw-a
/bw-imp
/bw-pix
/bw-png
/bw-ps
/bw-rle
/bw3-pix
/bwcrop
/bwdiff
/bwfilter
/bwhist
/bwhisteq
/bwmod
/bwrect
/bwrot
/bwscale
/bwshrink
/bwstat
/bwthresh
/cv
/dbcp
/decimate
/double-asc
/dpix-pix
/dsp_add
/dunncolor
/dunnsnap
/files-tape
/fix_polysolids
/gencolor
/hex
/imgdims
/loop
/lowp
/mac-pix
/msrandom
/mst
/op-bw
/orle-pix
/pcd-pix
/pc_test
/pix-alias
/pix-bw
/pix-bw3
/pix-orle
/pix-png
/pix-ppm
/pix-ps
/pix-rle
/pix-spm
/pix-sun
/pix-yuv
/pix3filter
/pixbackgnd
/pixbgstrip
/pixblend
/pixborder
/pixbustup
/pixclump
/pixcolors
/pixcount
/pixcut
/pixdiff
/pixdsplit
/pixelswap
/pixembed
/pixfade
/pixfields
/pixfieldsep
/pixfilter
/pixhalve
/pixhist
/pixhist3d
/pixhist3d-pl
/pixinterp2x
/pixmatte
/pixmerge
/pixmorph
/pixpaste
/pixrect
/pixrot
/pixsaturate
/pixscale
/pixshrink
/pixstat
/pixsubst
/pixtile
/pixuntile
/pl-X
/pl-X10.1
/pl-asc
/pl-dm
/pl-hpgl
/pl-pl
/pl-ps
/pl-sgi
/pl-tek
/plcolor
/pldebug
/plgetframe
/plline2
/plrot
/plstat
/png-bw
/png-pix
/png_info
/query
/remapid
/rle-pix
/roots_example
/rtwizard
/sgi-pix
/sun-pix
/terrain
/texturescale
/ttcp
/wavelet
/xyz-pl
/yuv-pix
/random
+1
View File
@@ -98,6 +98,7 @@ EXTRA_DIST = \
BUGS \
ChangeLog \
TODO \
TODO.togl \
autogen.sh \
libtool
+42
View File
@@ -0,0 +1,42 @@
Things left to do before the togl dm/fb setup is mature:
1. libfb routines using texture drawing (see isst tcl/tk stuff)
2. get in-MGED rendering working (probably the open_existing stuff)
3. figure out better mechanism for sending all events in tcl/tk
child window to the parent
4. take a close look at the faceplate text mechanism and figure out
what it needs.
5. If fonts are really needed (probably) it's time to look at ftgl
and freetype, since AGL has deprecated its version of the UseFont
command with no replacement in sight.
http://sourceforge.net/projects/ftgl/
6. If ftgl, also need fonts - include the following four open fonts
(make a note they use OFL, not LGPL/BSD/etc...)
Inconsolata:
http://www.levien.com/type/myfonts/inconsolata.html
Anonymous Pro:
http://www.ms-studio.com/FontSales/anonymouspro.html
DejaVu:
http://dejavu-fonts.org/wiki/Main_Page
ProFont: (OK to use under OFL per email from Carl Osterwald, June 14 2010)
http://www.tobias-jung.de/seekingprofont/
Make sure all three test out and are usable on multiple platforms,
as well as the user having a way to switch from one to another.
7. Once everything is working, make the togl build logic more
robust to Mac setups. May want to explore the possibility
of a Windows build as well.
8. (Not strictly togl related, but will need timing logic for
update routines - at least for isst, maybe for all if the
togl widget needs idle function instructions for dm/fb as
well. Look at rolling either a C version of bzflag routines
or SDL's functionality into libbu.)
+1
View File
@@ -34,6 +34,7 @@ brlcadinclude_wanted = \
dm-X.h \
dm-glx.h \
dm-ogl.h \
dm-togl.h \
dm-pex.h \
dm-plot.h \
dm-ps.h \
+81
View File
@@ -0,0 +1,81 @@
/* D M - O G L . H
* BRL-CAD
*
* Copyright (c) 1993-2010 United States Government as represented by
* the U.S. Army Research Laboratory.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this file; see the file named COPYING for more
* information.
*/
/** @addtogroup libdm */
/** @{ */
/** @file dm-togl.h
*
*/
#ifndef __DM_TOGL__
#define __DM_TOGL__
#include "common.h"
#include "togl.h"
#define CMAP_BASE 40
/* Map +/-2048 GED space into -1.0..+1.0 :: x/2048*/
#define GED2IRIS(x) (((float)(x))*0.00048828125)
#define Togl_MV_O(_m) offsetof(struct modifiable_togl_vars, _m)
struct modifiable_togl_vars {
int cueing_on;
int zclipping_on;
int zbuffer_on;
int lighting_on;
int transparency_on;
int fastfog;
double fogdensity;
int zbuf;
int rgb;
int doublebuffer;
int depth;
int debug;
double bound;
int boundFlag;
};
struct togl_vars {
Togl *togl;
GLdouble faceplate_mat[16];
int face_flag;
int *perspective_mode;
int fontOffset;
int ovec; /* Old color map entry number */
char is_direct;
GLclampf r, g, b;
struct modifiable_togl_vars mvars;
};
extern void togl_fogHint();
#endif /* __DM_TOGL__ */
/** @} */
/*
* Local Variables:
* mode: C
* tab-width: 8
* indent-tabs-mode: t
* c-file-style: "stroustrup"
* End:
* ex: shiftwidth=4 tabstop=8
*/
+2
View File
@@ -103,6 +103,7 @@
#define DM_TYPE_WGL 7
#define DM_TYPE_TK 8
#define DM_TYPE_RTGL 9
#define DM_TYPE_TOGL 10
/* Line Styles */
#define DM_SOLID_LINE 0
@@ -114,6 +115,7 @@
#define IS_DM_TYPE_X(_t) ((_t) == DM_TYPE_X)
#define IS_DM_TYPE_TK(_t) ((_t) == DM_TYPE_TK)
#define IS_DM_TYPE_OGL(_t) ((_t) == DM_TYPE_OGL)
#define IS_DM_TYPE_TOGL(_t) ((_t) == DM_TYPE_TOGL)
#define IS_DM_TYPE_GLX(_t) ((_t) == DM_TYPE_GLX)
#define IS_DM_TYPE_PEX(_t) ((_t) == DM_TYPE_PEX)
#define IS_DM_TYPE_WGL(_t) ((_t) == DM_TYPE_WGL)
+3
View File
@@ -75,6 +75,9 @@ struct dm_xvars {
#ifdef DM_TK
int tkfontset;
Tk_Font tkfontstruct;
#endif
#ifdef DM_TOGL
Tcl_Obj *toglfontstruct;
#endif
int devmotionnotify;
int devbuttonpress;
+7
View File
@@ -158,6 +158,13 @@ FB_EXPORT extern int _X24_open_existing(FBIO *ifp, Display *dpy, Window win, Win
FB_EXPORT extern int _ogl_open_existing(FBIO *ifp, Display *dpy, Window win, Colormap cmap, XVisualInfo *vip, int width, int height, GLXContext glxc, int double_buffer, int soft_cmap);
#endif
#ifdef IF_TOGL
# include "tk.h"
# define USE_TOGL_STUBS
# include "togl.h"
FB_EXPORT extern int _togl_open_existing(FBIO *ifp, Togl *togl);
#endif
#ifdef IF_WGL
# include <windows.h>
# include <tk.h>
+4
View File
@@ -155,6 +155,10 @@ FB_EXPORT extern FBIO remote_interface; /* not in list[] */
FB_EXPORT extern FBIO ogl_interface;
#endif
#ifdef IF_TOGL
FB_EXPORT extern FBIO togl_interface;
#endif
#ifdef IF_WGL
FB_EXPORT extern FBIO wgl_interface;
#endif
View File
View File
View File
+11
View File
@@ -21,6 +21,14 @@ DM_OGL_CFLAGS =
DM_OGL_LIBS =
endif
if BUILD_TOGL
DM_TOGL_CFLAGS = -DDM_TOGL -DIF_TOGL -I$(top_srcdir)/src/other/togl -I$(top_builddir)/src/other/togl $(GL_CPPFLAGS)
DM_TOGL_LIBS = ${LIBGL} -L$(top_builddir)/src/other/togl -lToglstub2.1
else
DM_TOGL_CFLAGS =
DM_TOGL_LIBS =
endif
if BUILD_RTGL
DM_RTGL_CFLAGS = -DDM_RTGL -DIF_RTGL $(GL_CPPFLAGS)
DM_RTGL_LIBS = ${LIBGL}
@@ -46,6 +54,7 @@ libdm_la_SOURCES = \
dm-tk.c \
dm-generic.c \
dm-ogl.c \
dm-togl.c \
dm-rtgl.c \
dm-plot.c \
dm-ps.c \
@@ -71,6 +80,7 @@ libdm_la_CFLAGS = \
${DM_TK_CFLAGS} \
${DM_WGL_CFLAGS} \
${DM_OGL_CFLAGS} \
${DM_TOGL_CFLAGS} \
${DM_RTGL_CFLAGS} \
${PNG_CPPFLAGS} \
${TCL_CPPFLAGS} \
@@ -79,6 +89,7 @@ libdm_la_CFLAGS = \
libdm_la_LIBADD = \
${DM_LIBS} \
${DM_OGL_LIBS} \
${DM_TOGL_LIBS} \
${DM_RTGL_LIBS}
EXTRA_DIST = \
+15
View File
@@ -52,6 +52,12 @@ extern void ogl_fogHint();
extern int ogl_share_dlist();
#endif /* DM_OGL */
#ifdef DM_TOGL
extern struct dm *togl_open();
extern void togl_fogHint();
extern int togl_share_dlist();
#endif /* DM_TOGL */
#ifdef DM_RTGL
extern struct dm *rtgl_open();
extern void rtgl_fogHint();
@@ -97,6 +103,10 @@ dm_open(Tcl_Interp *interp, int type, int argc, const char *argv[])
case DM_TYPE_OGL:
return ogl_open(interp, argc, argv);
#endif
#ifdef DM_TOGL
case DM_TYPE_TOGL:
return togl_open(interp, argc, argv);
#endif
#ifdef DM_RTGL
case DM_TYPE_RTGL:
return rtgl_open(interp, argc, argv);
@@ -195,6 +205,11 @@ dm_fogHint(struct dm *dmp, int fastfog)
ogl_fogHint(dmp, fastfog);
return;
#endif
#ifdef DM_TOGL
case DM_TYPE_TOGL:
togl_fogHint(dmp, fastfog);
return;
#endif
#ifdef DM_RTGL
case DM_TYPE_RTGL:
rtgl_fogHint(dmp, fastfog);
+1642
View File
File diff suppressed because it is too large Load Diff
+27 -1
View File
@@ -65,6 +65,11 @@
# include "dm-ogl.h"
#endif /* DM_OGL */
#ifdef DM_TOGL
# include "dm_xvars.h"
# include "dm-togl.h"
#endif /* DM_TOGL */
#ifdef DM_WGL
# include "dm_xvars.h"
# include <tkwinport.h>
@@ -291,6 +296,11 @@ dmo_open_tcl(ClientData UNUSED(clientData), Tcl_Interp *interp, int argc, char *
type = DM_TYPE_OGL;
#endif /* DM_OGL */
#ifdef DM_TOGL
if (!strcmp(argv[2], "togl"))
type = DM_TYPE_TOGL;
#endif /* DM_OGL */
#ifdef DM_WGL
if (!strcmp(argv[2], "wgl"))
type = DM_TYPE_WGL;
@@ -300,7 +310,7 @@ dmo_open_tcl(ClientData UNUSED(clientData), Tcl_Interp *interp, int argc, char *
Tcl_AppendStringsToObj(obj,
"Unsupported display manager type - ",
argv[2], "\n",
"The supported types are: X, ogl, wgl, and nu",
"The supported types are: X, togl, ogl, wgl, and nu",
(char *)NULL);
Tcl_SetObjResult(interp, obj);
return TCL_ERROR;
@@ -2818,6 +2828,22 @@ dmo_openFb(struct dm_obj *dmop, Tcl_Interp *interp)
0);
break;
#endif
#ifdef DM_TOGL
case DM_TYPE_TOGL:
*dmop->dmo_fbs.fbs_fbp = togl_interface; /* struct copy */
dmop->dmo_fbs.fbs_fbp->if_name = bu_malloc((unsigned)strlen("/dev/togl")+1, "if_name");
bu_strlcpy(dmop->dmo_fbs.fbs_fbp->if_name, "/dev/togl", strlen("/dev/togl")+1);
/* Mark OK by filling in magic number */
dmop->dmo_fbs.fbs_fbp->if_magic = FB_MAGIC;
_togl_open_existing(dmop->dmo_fbs.fbs_fbp,
((struct togl_vars *)dmop->dmo_dmp->dm_vars.priv_vars)->togl);
break;
#endif
#ifdef DM_WGL
case DM_TYPE_WGL:
*dmop->dmo_fbs.fbs_fbp = wgl_interface; /* struct copy */
+14
View File
@@ -51,6 +51,15 @@ dm_validXType(char *dpy_string, char *name)
#endif /* DM_WGL */
}
if (strcmp(name, "togl")==0) {
#ifdef DM_TOGL
return 1;
#else
bu_log("Specified display type [%s] is not available in this compilation.", name);
return 0;
#endif /* DM_TOGL */
}
if (strcmp(name, "rtgl")==0) {
#ifdef DM_RTGL
Display *dpy;
@@ -117,6 +126,11 @@ dm_validXType(char *dpy_string, char *name)
char *
dm_bestXType(char *dpy_string)
{
#ifdef DM_TOGL
return "togl";
#endif
#ifdef DM_WGL
/* should probably make sure wgl works */
return "wgl";
+12 -1
View File
@@ -23,6 +23,14 @@ IF_OGL_CFLAGS =
IF_OGL_LIBADD =
endif
if BUILD_TOGL
IF_TOGL_CFLAGS = -DIF_TOGL -I$(top_srcdir)/src/other/togl -I$(top_builddir)/src/other/togl $(GL_CPPFLAGS)
IF_TOGL_LIBADD = ${LIBGL} -L$(top_builddir)/src/other/togl -lToglstub2.1
else
IF_TOGL_CFLAGS =
IF_TOGL_LIBADD =
endif
if WITH_TK
IF_TK_CFLAGS = -DIF_TK $(TK_CPPFLAGS)
IF_TK_LIBADD = ${TK}
@@ -47,6 +55,7 @@ libfb_la_SOURCES = \
if_mem.c \
if_null.c \
if_ogl.c \
if_togl.c \
if_remote.c \
if_stack.c \
if_tk.c \
@@ -63,6 +72,7 @@ libfb_la_CFLAGS = \
$(IF_X_CFLAGS) \
$(IF_TK_CFLAGS) \
$(IF_OGL_CFLAGS) \
$(IF_TOGL_CFLAGS) \
$(IF_WGL_CFLAGS) \
${TCL_CPPFLAGS}
@@ -70,7 +80,8 @@ libfb_la_LIBADD = \
${FB_LIBS} \
${IF_X_LIBADD} \
${IF_OGL_LIBADD} \
${IF_TK_LIBADD}
${IF_TK_LIBADD} \
${IF_TOGL_LIBADD}
noinst_HEADERS = \
dmdfb.h \
+18
View File
@@ -99,6 +99,9 @@ FBIO *_if_list[] = {
#ifdef IF_OGL
&ogl_interface,
#endif
#ifdef IF_TOGL
&togl_interface,
#endif
#ifdef IF_X
&X24_interface,
&X_interface,
@@ -332,6 +335,21 @@ fb_close_existing(FBIO *ifp)
}
#endif /* IF_TK */
#ifdef IF_TOGL
{
extern FBIO togl_interface;
if (strcasecmp(ifp->if_name, togl_interface.if_type) == 0) {
/* may need to close_existing here at some point */
if (ifp->if_pbase != PIXEL_NULL)
free((void *)ifp->if_pbase);
free((void *)ifp->if_name);
free((void *)ifp);
return BRLCAD_OK;
}
}
#endif /* IF_TOGL */
fb_log("fb_close_existing: cannot close device\nifp: %s\n", ifp->if_name);
return BRLCAD_ERROR;
+616
View File
@@ -0,0 +1,616 @@
/* I F _ T O G L . C
* BRL-CAD
*
* Copyright (c) 2007-2010 United States Government as represented by
* the U.S. Army Research Laboratory.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this file; see the file named COPYING for more
* information.
*/
/** @addtogroup if */
/** @{ */
/** @file if_togl.c
*
* Togl libfb interface.
*
*/
/** @} */
#include "common.h"
#ifdef IF_TOGL
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#include "fb.h"
#include "tk.h"
#define USE_TOGL_STUBS
#include "togl.h"
struct togl_fb {
Tcl_Interp *toglfbinterp;
Tk_Window toglfbwin;
Togl *fbtogl;
int texid;
void *texdata;
};
HIDDEN int fb_togl_open(FBIO *ifp, char *file, int width, int height),
fb_togl_close(FBIO *ifp),
togl_clear(FBIO *ifp, unsigned char *pp),
togl_read(FBIO *ifp, int x, int y, unsigned char *pixelp, size_t count),
togl_write(FBIO *ifp, int x, int y, const unsigned char *pixelp, size_t count),
togl_rmap(FBIO *ifp, ColorMap *cmp),
togl_wmap(FBIO *ifp, const ColorMap *cmp),
togl_view(FBIO *ifp, int xcenter, int ycenter, int xzoom, int yzoom),
togl_getview(FBIO *ifp, int *xcenter, int *ycenter, int *xzoom, int *yzoom),
togl_setcursor(FBIO *ifp, const unsigned char *bits, int xbits, int ybits, int xorig, int yorig),
togl_cursor(FBIO *ifp, int mode, int x, int y),
togl_getcursor(FBIO *ifp, int *mode, int *x, int *y),
togl_readrect(FBIO *ifp, int xmin, int ymin, int width, int height, unsigned char *pp),
togl_writerect(FBIO *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp),
togl_bwreadrect(FBIO *ifp, int xmin, int ymin, int width, int height, unsigned char *pp),
togl_bwwriterect(FBIO *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp),
togl_poll(FBIO *ifp),
togl_flush(FBIO *ifp),
togl_free(FBIO *ifp),
togl_help(FBIO *ifp);
/* This is the ONLY thing that we "export" */
FBIO togl_interface = {
0,
fb_togl_open,
fb_togl_close,
togl_clear,
togl_read,
togl_write,
togl_rmap,
togl_wmap,
togl_view,
togl_getview,
togl_setcursor,
togl_cursor,
togl_getcursor,
togl_readrect,
togl_writerect,
togl_bwreadrect,
togl_bwwriterect,
togl_poll,
togl_flush,
togl_free,
togl_help,
"Debugging Interface",
32*1024, /* max width */
32*1024, /* max height */
"/dev/togl",
512, /* current/default width */
512, /* current/default height */
-1, /* select fd */
-1, /* file descriptor */
1, 1, /* zoom */
256, 256, /* window center */
0, 0, 0, /* cursor */
PIXEL_NULL, /* page_base */
PIXEL_NULL, /* page_curp */
PIXEL_NULL, /* page_endp */
-1, /* page_no */
0, /* page_ref */
0L, /* page_curpos */
0L, /* page_pixels */
0, /* debug */
{0}, /* u1 */
{0}, /* u2 */
{0}, /* u3 */
{0}, /* u4 */
{0}, /* u5 */
{0} /* u6 */
};
#define TOGLFB(ptr) ((struct togl_fb *)((ptr)->u6.p))
#define TOGLFBL(ptr) ((ptr)->u6.p) /* left hand side version */
void togl_configureWindow(FBIO *ifp, int width, int height) {
printf("width: %d height: %d\n", width, height);
ifp->if_width = width;
ifp->if_height = height;
Togl_MakeCurrent(TOGLFB(ifp)->fbtogl);
glBindTexture (GL_TEXTURE_2D, TOGLFB(ifp)->texid);
TOGLFB(ifp)->texdata = realloc(TOGLFB(ifp)->texdata, width * height * 3);
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, TOGLFB(ifp)->texdata);
Togl_SwapBuffers(TOGLFB(ifp)->fbtogl);
return 0;
}
int
togl_refresh(FBIO *ifp, int x, int y, int w, int h)
{
int mm;
glGetIntegerv(GL_MATRIX_MODE, &mm);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glViewport(0, 0, Togl_Width(TOGLFB(ifp)->fbtogl), Togl_Height(TOGLFB(ifp)->fbtogl));
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glMatrixMode(mm);
glFlush();
return 0;
}
int
_togl_open_existing(FBIO *ifp, Togl *togl) {
char *tclcmd[255] = {'\0'};
FB_CK_FBIO(ifp);
/* Set up the togl_fb structure */
if ((TOGLFBL(ifp) = (char *)calloc(1, sizeof(struct togl_fb))) == NULL) {
fb_log("fb_togl_open: togl_fb malloc failed\n");
return -1;
}
ifp->if_width = Togl_Width(togl);
ifp->if_height = Togl_Height(togl);
TOGLFB(ifp)->toglfbinterp = Togl_Interp(togl);
TOGLFB(ifp)->toglfbwin = Tk_Parent(Togl_TkWin(togl));
TOGLFB(ifp)->fbtogl = togl;
Togl_MakeCurrent(togl);
glClearColor (0.0, 0, 0.0, 1);
glBindTexture (GL_TEXTURE_2D, TOGLFB(ifp)->texid);
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
TOGLFB(ifp)->texdata = realloc(TOGLFB(ifp)->texdata, ifp->if_width * ifp->if_height * 3);
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, ifp->if_width, ifp->if_height, 0, GL_RGB, GL_UNSIGNED_BYTE, TOGLFB(ifp)->texdata);
return 0;
}
int
togl_open_existing(FBIO *ifp, int argc, char **argv)
{
Togl *togl;
if (argc != 10)
return -1;
if (sscanf(argv[1], "%p", (void *)&togl) != 1)
return -1;
return _togl_open_existing(ifp, togl);
}
HIDDEN int
fb_togl_open(FBIO *ifp, char *file, int width, int height)
{
Togl *togl;
char *tclcmd[255] = {'\0'};
FB_CK_FBIO(ifp);
if (file == (char *)NULL)
fb_log("fb_open(0x%lx, NULL, %d, %d)\n",
(unsigned long)ifp, width, height);
else
fb_log("fb_open(0x%lx, \"%s\", %d, %d)\n",
(unsigned long)ifp, file, width, height);
/* Set up the togl_fb structure */
if ((TOGLFBL(ifp) = (char *)calloc(1, sizeof(struct togl_fb))) == NULL) {
fb_log("fb_togl_open: togl_fb malloc failed\n");
return -1;
}
/* check for default size */
if (width <= 0)
width = ifp->if_width;
if (height <= 0)
height = ifp->if_height;
/* set debug bit vector */
if (file != NULL) {
char *cp;
for (cp = file; *cp != '\0' && !isdigit(*cp); cp++)
;
sscanf(cp, "%d", &ifp->if_debug);
} else {
ifp->if_debug = 0;
}
/* Give the user whatever width was asked for */
ifp->if_width = width;
ifp->if_height = height;
TOGLFB(ifp)->toglfbinterp = Tcl_CreateInterp();
if (Tcl_Init(TOGLFB(ifp)->toglfbinterp) == TCL_ERROR) {
fb_log("Tcl_Init returned error in fb_open.");
}
sprintf(tclcmd, "package require Tk");
if (Tcl_Eval(TOGLFB(ifp)->toglfbinterp, tclcmd) != TCL_OK) {
fb_log("Error returned attempting to start tk in fb_open.");
}
if (Tcl_InitStubs(TOGLFB(ifp)->toglfbinterp, "8.1", 0) == NULL
|| Togl_InitStubs(TOGLFB(ifp)->toglfbinterp, "2.0", 0) == NULL) {
fb_log("Error during Togl init\n");
}
TOGLFB(ifp)->toglfbwin = Tk_MainWindow(TOGLFB(ifp)->toglfbinterp);
Tk_GeometryRequest(TOGLFB(ifp)->toglfbwin, width, height);
Tk_MakeWindowExist(TOGLFB(ifp)->toglfbwin);
Tk_MapWindow(TOGLFB(ifp)->toglfbwin);
sprintf(tclcmd, "package require Togl; togl %stogl -width %d -height %d -rgba true -double true", (char *)Tk_PathName(TOGLFB(ifp)->toglfbwin), width, height);
printf("tclcmd: %s\n", tclcmd);
if (Tcl_Eval(TOGLFB(ifp)->toglfbinterp, tclcmd) != TCL_OK) {
fb_log("Error returned attempting to create togl window in fb_open.");
}
sprintf(tclcmd, "pack %stogl -expand true -fill both; update", (char *)Tk_PathName(TOGLFB(ifp)->toglfbwin));
printf("tclcmd: %s\n", tclcmd);
if (Tcl_Eval(TOGLFB(ifp)->toglfbinterp, tclcmd) != TCL_OK) {
fb_log("Error returned attemping to pack togl window in fb_open.");
}
sprintf(tclcmd, "%stogl", (char *)Tk_PathName(TOGLFB(ifp)->toglfbwin));
printf("tclcmd: %s\n", tclcmd);
Togl_GetToglFromObj(TOGLFB(ifp)->toglfbinterp, Tcl_NewStringObj(tclcmd, -1), &togl);
TOGLFB(ifp)->fbtogl = togl;
/* Set our Tcl variable pertaining to whether a
* window closing event has been seen from the
* Window manager. WM_DELETE_WINDOW will be
* bound to a command setting this variable to
* the string "close", and a vwait watching
* for a change to the CloseWindow variable ensures
* a "lingering" tk window.
*/
Tcl_SetVar(TOGLFB(ifp)->toglfbinterp, "CloseWindow", "open", 0);
sprintf(tclcmd, "wm protocol . WM_DELETE_WINDOW {set CloseWindow \"close\"}");
if (Tcl_Eval(TOGLFB(ifp)->toglfbinterp, tclcmd) != TCL_OK) {
fb_log("Error binding WM_DELETE_WINDOW.");
}
sprintf(tclcmd, "bind . <Button-3> {set CloseWindow \"close\"}");
if (Tcl_Eval(TOGLFB(ifp)->toglfbinterp, tclcmd) != TCL_OK) {
fb_log("Error binding right mouse button.");
}
while (Tcl_DoOneEvent(TCL_ALL_EVENTS|TCL_DONT_WAIT));
Togl_MakeCurrent(togl);
glClearColor (0.0, 0, 0.0, 1);
glBindTexture (GL_TEXTURE_2D, TOGLFB(ifp)->texid);
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
TOGLFB(ifp)->texdata = realloc(TOGLFB(ifp)->texdata, width * height * 3);
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, TOGLFB(ifp)->texdata);
glDisable(GL_LIGHTING);
glViewport(0,0, width, height);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glOrtho(0, width, height, 0, -1, 1);
glMatrixMode (GL_MODELVIEW);
glClear(GL_COLOR_BUFFER_BIT);
return 0;
}
HIDDEN int
fb_togl_close(FBIO *ifp)
{
FB_CK_FBIO(ifp);
fb_log( "fb_close( 0x%lx )\n", (unsigned long)ifp );
fclose(stdin);
/* Wait for CloseWindow to be changed by the WM_DELETE_WINDOW
binding set up in fb_togl_open */
Tcl_Eval(TOGLFB(ifp)->toglfbinterp, "vwait CloseWindow");
if (!strcmp(Tcl_GetVar(TOGLFB(ifp)->toglfbinterp, "CloseWindow", 0),"close")) {
Tcl_Eval(TOGLFB(ifp)->toglfbinterp, "destroy .");
}
return 0;
}
HIDDEN int
togl_clear(FBIO *ifp, unsigned char *pp)
{
FB_CK_FBIO(ifp);
if (pp == 0)
fb_log("fb_clear(0x%lx, NULL)\n", (unsigned long)ifp);
else
fb_log("fb_clear(0x%lx, &[%d %d %d])\n",
(unsigned long)ifp,
(int)(pp[RED]), (int)(pp[GRN]),
(int)(pp[BLU]));
return 0;
}
HIDDEN int
togl_read(FBIO *ifp, int x, int y, unsigned char *pixelp, size_t count)
{
FB_CK_FBIO(ifp);
fb_log("fb_read(0x%lx, %4d, %4d, 0x%lx, %ld)\n",
(unsigned long)ifp, x, y,
(unsigned long)pixelp, (long)count);
return (int)count;
}
HIDDEN int
togl_write(FBIO *ifp, int xstart, int ystart, const unsigned char *pixelp, size_t count)
{
printf("writing: xstart: %d, ystart %d, count: %d\n", xstart, ystart, count);
Togl *togl;
togl = TOGLFB(ifp)->fbtogl;
Togl_MakeCurrent(togl);
glDepthMask(GL_FALSE);
glClear(GL_DEPTH_BUFFER_BIT);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, TOGLFB(ifp)->texid);
glTexSubImage2D(GL_TEXTURE_2D, 0, xstart, ifp->if_height-ystart, count, 1, GL_RGB, GL_UNSIGNED_BYTE, pixelp);
printf("writing: if_width: %d, if_height %d\n", ifp->if_width, ifp->if_height);
glBegin(GL_TRIANGLE_STRIP);
glTexCoord2d(0, 0); glVertex3f(0, 0, 0);
glTexCoord2d(0, 1); glVertex3f(0, ifp->if_height, 0);
glTexCoord2d(1, 0); glVertex3f(ifp->if_width, 0, 0);
glTexCoord2d(1, 1); glVertex3f(ifp->if_width, ifp->if_height, 0);
glEnd();
glDepthMask(GL_TRUE);
Togl_SwapBuffers(togl);
return (int)count;
}
HIDDEN int
togl_rmap(FBIO *ifp, ColorMap *cmp)
{
FB_CK_FBIO(ifp);
fb_log("fb_rmap(0x%lx, 0x%lx)\n",
(unsigned long)ifp, (unsigned long)cmp);
return 0;
}
HIDDEN int
togl_wmap(FBIO *ifp, const ColorMap *cmp)
{
int i;
FB_CK_FBIO(ifp);
if (cmp == NULL)
fb_log("fb_wmap(0x%lx, NULL)\n",
(unsigned long)ifp);
else
fb_log("fb_wmap(0x%lx, 0x%lx)\n",
(unsigned long)ifp, (unsigned long)cmp);
if (ifp->if_debug & FB_DEBUG_CMAP && cmp != NULL) {
for (i = 0; i < 256; i++) {
fb_log("%3d: [ 0x%4lx, 0x%4lx, 0x%4lx ]\n",
i,
(unsigned long)cmp->cm_red[i],
(unsigned long)cmp->cm_green[i],
(unsigned long)cmp->cm_blue[i]);
}
}
return 0;
}
HIDDEN int
togl_view(FBIO *ifp, int xcenter, int ycenter, int xzoom, int yzoom)
{
FB_CK_FBIO(ifp);
fb_log("fb_view(0x%lx, %4d, %4d, %4d, %4d)\n",
(unsigned long)ifp, xcenter, ycenter, xzoom, yzoom);
fb_sim_view(ifp, xcenter, ycenter, xzoom, yzoom);
return 0;
}
HIDDEN int
togl_getview(FBIO *ifp, int *xcenter, int *ycenter, int *xzoom, int *yzoom)
{
FB_CK_FBIO(ifp);
fb_log("fb_getview(0x%lx, 0x%x, 0x%x, 0x%x, 0x%x)\n",
(unsigned long)ifp, xcenter, ycenter, xzoom, yzoom);
fb_sim_getview(ifp, xcenter, ycenter, xzoom, yzoom);
fb_log(" <= %d %d %d %d\n",
*xcenter, *ycenter, *xzoom, *yzoom);
return 0;
}
HIDDEN int
togl_setcursor(FBIO *ifp, const unsigned char *bits, int xbits, int ybits, int xorig, int yorig)
{
FB_CK_FBIO(ifp);
fb_log("fb_setcursor(0x%lx, 0x%lx, %d, %d, %d, %d)\n",
(unsigned long)ifp, bits, xbits, ybits, xorig, yorig);
return 0;
}
HIDDEN int
togl_cursor(FBIO *ifp, int mode, int x, int y)
{
fb_log("fb_cursor(0x%lx, %d, %4d, %4d)\n",
(unsigned long)ifp, mode, x, y);
fb_sim_cursor(ifp, mode, x, y);
return 0;
}
HIDDEN int
togl_getcursor(FBIO *ifp, int *mode, int *x, int *y)
{
FB_CK_FBIO(ifp);
fb_log("fb_getcursor(0x%lx, 0x%x, 0x%x, 0x%x)\n",
(unsigned long)ifp, mode, x, y);
fb_sim_getcursor(ifp, mode, x, y);
fb_log(" <= %d %d %d\n", *mode, *x, *y);
return 0;
}
HIDDEN int
togl_readrect(FBIO *ifp, int xmin, int ymin, int width, int height, unsigned char *pp)
{
FB_CK_FBIO(ifp);
fb_log("fb_readrect(0x%lx, (%4d, %4d), %4d, %4d, 0x%lx)\n",
(unsigned long)ifp, xmin, ymin, width, height,
(unsigned long)pp);
return width*height;
}
HIDDEN int
togl_writerect(FBIO *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp)
{
FB_CK_FBIO(ifp);
fb_log("fb_writerect(0x%lx, %4d, %4d, %4d, %4d, 0x%lx)\n",
(unsigned long)ifp, xmin, ymin, width, height,
(unsigned long)pp);
return width*height;
}
HIDDEN int
togl_bwreadrect(FBIO *ifp, int xmin, int ymin, int width, int height, unsigned char *pp)
{
FB_CK_FBIO(ifp);
fb_log("fb_bwreadrect(0x%lx, (%4d, %4d), %4d, %4d, 0x%lx)\n",
(unsigned long)ifp, xmin, ymin, width, height,
(unsigned long)pp);
return width*height;
}
HIDDEN int
togl_bwwriterect(FBIO *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp)
{
FB_CK_FBIO(ifp);
fb_log("fb_bwwriterect(0x%lx, %4d, %4d, %4d, %4d, 0x%lx)\n",
(unsigned long)ifp, xmin, ymin, width, height,
(unsigned long)pp);
return width*height;
}
HIDDEN int
togl_poll(FBIO *ifp)
{
FB_CK_FBIO(ifp);
while (Tcl_DoOneEvent(TCL_ALL_EVENTS|TCL_DONT_WAIT));
fb_log("fb_poll(0x%lx)\n", (unsigned long)ifp);
return 0;
}
HIDDEN int
togl_flush(FBIO *ifp)
{
FB_CK_FBIO(ifp);
fb_log("if_flush(0x%lx)\n", (unsigned long)ifp);
return 0;
}
HIDDEN int
togl_free(FBIO *ifp)
{
FB_CK_FBIO(ifp);
fb_log("fb_free(0x%lx)\n", (unsigned long)ifp);
return 0;
}
/*ARGSUSED*/
HIDDEN int
togl_help(FBIO *ifp)
{
FB_CK_FBIO(ifp);
fb_log("Description: %s\n", togl_interface.if_type);
fb_log("Device: %s\n", ifp->if_name);
fb_log("Max width/height: %d %d\n",
togl_interface.if_max_width,
togl_interface.if_max_height);
fb_log("Default width/height: %d %d\n",
togl_interface.if_width,
togl_interface.if_height);
fb_log("\
Usage: /dev/togl[#]\n\
where # is a optional bit vector from:\n\
1 debug buffered I/O calls\n\
2 show colormap entries in rmap/wmap calls\n\
4 show actual pixel values in read/write calls\n");
/*8 buffered read/write values - ifdef'd out*/
return 0;
}
#else
/* quell empty-compilation unit warnings */
static const int unused = 0;
#endif /* IF_TOGL */
/*
* Local Variables:
* mode: C
* tab-width: 8
* indent-tabs-mode: t
* c-file-style: "stroustrup"
* End:
* ex: shiftwidth=4 tabstop=8
*/
+51
View File
@@ -107,6 +107,14 @@ extern FBIO tk_interface;
static const char *tk_device_name = "/dev/tk";
#endif
#ifdef IF_TOGL
extern void togl_configureWindow();
extern int togl_refresh();
extern int togl_open_existing();
extern FBIO togl_interface;
static const char *togl_device_name = "/dev/togl";
#endif
int fb_cmd_open_existing(ClientData clientData, Tcl_Interp *interp, int argc, char **argv);
int fb_cmd_close_existing(ClientData clientData, Tcl_Interp *interp, int argc, char **argv);
int fb_cmd_common_file_size(ClientData clientData, Tcl_Interp *interp, int argc, char **argv);
@@ -181,6 +189,29 @@ fb_cmd_open_existing(ClientData UNUSED(clientData), Tcl_Interp *interp, int argc
#endif
#endif /* IF_TK */
#ifdef IF_TOGL
if (strcasecmp(argv[1], togl_device_name) == 0) {
found=1;
*ifp = togl_interface; /* struct copy */
ifp->if_name = malloc((unsigned)strlen(tk_device_name) + 1);
bu_strlcpy(ifp->if_name, tk_device_name, strlen(tk_device_name)+1);
/* Mark OK by filling in magic number */
ifp->if_magic = FB_MAGIC;
if ((togl_open_existing(ifp, argc - 1, argv + 1)) <= -1) {
ifp->if_magic = 0; /* sanity */
free((void *) ifp->if_name);
free((void *) ifp);
Tcl_AppendResult(interp, "fb_open_existing: failed to open togl framebuffer\n", (char *)NULL);
return TCL_ERROR;
}
}
#endif /* IF_TOGL */
#ifdef IF_WGL
if (strcasecmp(argv[1], wgl_device_name) == 0) {
found=1;
@@ -254,6 +285,10 @@ fb_cmd_open_existing(ClientData UNUSED(clientData), Tcl_Interp *interp, int argc
bu_vls_strcat(&vls, tk_device_name);
bu_vls_strcat(&vls, "\n");
#endif /* IF_TK */
#ifdef IF_TOGL
bu_vls_strcat(&vls, togl_device_name);
bu_vls_strcat(&vls, "\n");
#endif /* IF_TOGL */
Tcl_AppendResult(interp, bu_vls_addr(&vls), (char *)NULL);
bu_vls_free(&vls);
@@ -307,6 +342,12 @@ fb_configureWindow(FBIO *ifp, int width, int height)
}
#endif
#endif /* IF_TK */
#ifdef IF_TOGL
if (!strncmp(ifp->if_name, togl_device_name, strlen(togl_device_name))) {
togl_configureWindow(ifp, width, height);
}
#endif /* IF_TOGL */
}
@@ -357,6 +398,16 @@ fb_refresh(FBIO *ifp, int x, int y, int w, int h)
}
#endif
#endif /* IF_TK */
#ifdef IF_TOGL
#if 0
/* XXX CWY implement togl_refresh */
status = -1;
if (!strncmp(ifp->if_name, togl_device_name, strlen(togl_device_name))) {
status = togl_refresh(ifp, x, y, w, h);
}
#endif
#endif /* IF_TOGL */
if (status < 0) {
return TCL_ERROR;
+10 -1
View File
@@ -22,6 +22,14 @@ DM_OGL_CFLAGS =
DM_OGL_LIBS =
endif
if BUILD_TOGL
DM_TOGL_CFLAGS = -DDM_TOGL -DIF_TOGL -I$(top_srcdir)/src/other/togl -I$(top_builddir)/src/other/togl $(GL_CPPFLAGS)
DM_TOGL_LIBS = ${LIBGL} -L$(top_builddir)/src/other/togl -lToglstub2.1
else
DM_TOGL_CFLAGS =
DM_TOGL_LIBS =
endif
if WITH_TK
DM_TK_CFLAGS = -DDM_TK -DIF_TK
else
@@ -39,6 +47,7 @@ libtclcad_la_CFLAGS = \
${DM_TK_CFLAGS} \
${DM_WGL_CFLAGS} \
${DM_OGL_CFLAGS} \
${DM_TOGL_CFLAGS} \
${PNG_CPPFLAGS} \
${X_CFLAGS} \
${ITK_CPPFLAGS} \
@@ -50,7 +59,7 @@ libtclcad_la_CFLAGS = \
-I$(top_srcdir)/src/other/tk/generic \
-I$(top_srcdir)/src/other/tk/unix
libtclcad_la_LDFLAGS = -version-info 19:1 -no-undefined -Wc,${FEXCEPTIONS}
libtclcad_la_LIBADD = ${TCLCAD_LIBS}
libtclcad_la_LIBADD = ${TCLCAD_LIBS} ${DM_TOGL_LIBS}
EXTRA_DIST = libtclcad.dsp
+24 -12
View File
@@ -82,6 +82,14 @@
# include "dm-ogl.h"
#endif /* DM_OGL */
#ifdef DM_TOGL
# include "tk.h"
# define USE_TOGL_STUBS
# include "togl.h"
# include "dm_xvars.h"
# include "dm-togl.h"
#endif /* DM_TOGL */
#ifdef DM_WGL
# include <tkwinport.h>
# include "dm_xvars.h"
@@ -413,7 +421,7 @@ HIDDEN int go_paint_rect_area(struct ged *gedp,
ged_func_ptr func,
const char *usage,
int maxargs);
#if defined(DM_OGL) || defined(DM_WGL)
#if defined(DM_OGL) || defined(DM_TOGL) || defined(DM_WGL)
HIDDEN int go_png(struct ged *gedp,
int argc,
const char *argv[],
@@ -839,7 +847,7 @@ static struct go_cmdtab go_cmds[] = {
{"plot", "[options] file.pl", 16, go_view_func, ged_plot},
{"pmat", "[mat]", 3, go_view_func, ged_pmat},
{"pmodel2view", "vname", 2, go_view_func, ged_pmodel2view},
#if defined(DM_OGL) || defined(DM_WGL)
#if defined(DM_OGL) || defined(DM_TOGL) || defined(DM_WGL)
{"png", "file", GO_UNLIMITED, go_png, GED_FUNC_PTR_NULL},
#endif
{"pngwf", "[options] file.png", 16, go_view_func, ged_png},
@@ -6033,16 +6041,17 @@ go_new_view(struct ged *gedp,
type = DM_TYPE_X;
#endif /* DM_X */
#ifdef DM_TK
if (!strcmp(argv[2], "tk"))
type = DM_TYPE_TK;
#endif /* DM_TK */
#ifdef DM_OGL
if (!strcmp(argv[2], "ogl"))
type = DM_TYPE_OGL;
#endif /* DM_OGL */
#ifdef DM_TOGL
if (!strcmp(argv[2], "togl"))
type = DM_TYPE_TOGL;
#endif /* DM_TOGL */
#ifdef DM_WGL
if (!strcmp(argv[2], "wgl"))
type = DM_TYPE_WGL;
@@ -6344,7 +6353,7 @@ go_paint_rect_area(struct ged *gedp,
}
#if defined(DM_OGL) || defined(DM_WGL)
#if defined(DM_OGL) || defined(DM_TOGL) || defined(DM_WGL)
HIDDEN int
go_png(struct ged *gedp,
int argc,
@@ -6423,12 +6432,15 @@ go_png(struct ged *gedp,
#if defined(DM_WGL)
make_ret = wglMakeCurrent(((struct dm_xvars *)gdvp->gdv_dmp->dm_vars.pub_vars)->hdc,
((struct wgl_vars *)gdvp->gdv_dmp->dm_vars.priv_vars)->glxc);
#else
# if defined(DM_OGL)
#endif
#if defined(DM_OGL)
make_ret = glXMakeCurrent(((struct dm_xvars *)gdvp->gdv_dmp->dm_vars.pub_vars)->dpy,
((struct dm_xvars *)gdvp->gdv_dmp->dm_vars.pub_vars)->win,
((struct ogl_vars *)gdvp->gdv_dmp->dm_vars.priv_vars)->glxc);
# endif
#endif
#if defined(DM_TOGL)
Togl_MakeCurrent(((struct togl_vars *)gdvp->gdv_dmp->dm_vars.priv_vars)->togl);
make_ret = 1;
#endif
if (!make_ret) {
bu_vls_printf(&gedp->ged_result_str, "%s: Couldn't make context current\n", argv[0]);
@@ -7739,7 +7751,7 @@ go_view_win_size(struct ged *gedp,
}
}
#if defined(DM_X) || defined(DM_TK) || defined(DM_OGL) || defined(DM_WGL)
#if defined(DM_X) || defined(DM_TOGL) || defined(DM_OGL) || defined(DM_WGL)
Tk_GeometryRequest(((struct dm_xvars *)gdvp->gdv_dmp->dm_vars.pub_vars)->xtkwin,
width, height);
#endif
+19 -1
View File
@@ -9,6 +9,14 @@ OGL_SRCS =
OGL_CFLAGS =
endif
if BUILD_TOGL
TOGL_SRCS = dm-togl.c
TOGL_CFLAGS = -DDM_TOGL -DIF_TOGL -I$(top_srcdir)/src/other/togl -I$(top_builddir)/src/other/togl $(GL_CPPFLAGS)
else
TOGL_SRCS =
TOGL_CFLAGS =
endif
if BUILD_RTGL
RTGL_SRCS = dm-rtgl.c
RTGL_CFLAGS = -DDM_RTGL -DIF_RTGL $(GL_CPPFLAGS)
@@ -78,6 +86,7 @@ mged_SOURCES = \
columns.c \
dir.c \
$(OGL_SRCS) \
$(TOGL_SRCS) \
$(RTGL_SRCS) \
$(WGL_SRCS) \
$(X11_SRCS) \
@@ -126,6 +135,7 @@ mged_SOURCES = \
# per-program CPPFLAGS wasn't added until automake 1.7
mged_CFLAGS = \
$(OGL_CFLAGS) \
$(TOGL_CFLAGS) \
$(RTGL_CFLAGS) \
$(WGL_CFLAGS) \
$(X11_CFLAGS) \
@@ -148,6 +158,12 @@ else
mged_tk_libs =
endif
if BUILD_TOGL
togl_libs = ${LIBGL} -L$(top_builddir)/src/other/togl -lToglstub2.1
else
togl_libs =
endif
mged_LDADD = \
${POINTS_LDADD} \
${TERMIO} \
@@ -156,7 +172,8 @@ mged_LDADD = \
${DM} ${DM_LIBS} \
${ITCL} \
${TCLCAD} \
${mged_tk_libs}
${mged_tk_libs} \
${togl_libs}
EXTRA_PROGRAMS = sged
sged_SOURCES = $(mged_SOURCES)
@@ -199,6 +216,7 @@ EXTRA_DIST = \
comb_bool_parse.y \
comb_bool_scan.l \
dm-ogl.c \
dm-togl.c \
dm-rtgl.c \
dm-wgl.c \
dm-X.c \
+24 -1
View File
@@ -55,6 +55,7 @@
#define NEED_GUI(_type) (\
IS_DM_TYPE_WGL(_type) || \
IS_DM_TYPE_OGL(_type) || \
IS_DM_TYPE_TOGL(_type) || \
IS_DM_TYPE_RTGL(_type) || \
IS_DM_TYPE_GLX(_type) || \
IS_DM_TYPE_PEX(_type) || \
@@ -86,6 +87,11 @@ extern int Ogl_dm_init();
extern void Ogl_fb_open();
#endif /* DM_OGL */
#ifdef DM_TOGL
extern int Togl_dm_init();
extern void Togl_fb_open();
#endif /* DM_TOGL */
#ifdef DM_RTGL
extern int Rtgl_dm_init();
extern void Rtgl_fb_open();
@@ -124,6 +130,9 @@ struct w_dm which_dm[] = {
#ifdef DM_OGL
{ DM_TYPE_OGL, "ogl", Ogl_dm_init },
#endif /* DM_OGL */
#ifdef DM_TOGL
{ DM_TYPE_TOGL, "togl", Togl_dm_init },
#endif /* DM_TOGL */
#ifdef DM_RTGL
{ DM_TYPE_RTGL, "rtgl", Rtgl_dm_init },
#endif /* DM_RTGL */
@@ -156,6 +165,10 @@ mged_fb_open(void)
if (dmp->dm_type == DM_TYPE_OGL)
Ogl_fb_open();
#endif /* DM_OGL */
#ifdef DM_TOGL
if (dmp->dm_type == DM_TYPE_TOGL)
Togl_fb_open();
#endif /* DM_TOGL */
#ifdef DM_RTGL
if (dmp->dm_type == DM_TYPE_RTGL)
Rtgl_fb_open();
@@ -318,6 +331,10 @@ print_valid_dm(Tcl_Interp *interpreter)
Tcl_AppendResult(interpreter, "ogl ", (char *)NULL);
i++;
#endif /* DM_OGL */
#ifdef DM_TOGL
Tcl_AppendResult(interp, "togl ", (char *)NULL);
i++;
#endif /* DM_TOGL */
#ifdef DM_RTGL
Tcl_AppendResult(interpreter, "rtgl ", (char *)NULL);
i++;
@@ -337,6 +354,7 @@ int
f_attach(ClientData UNUSED(clientData), Tcl_Interp *interpreter, int argc, const char *argv[])
{
struct w_dm *wp;
int i;
if (argc < 2) {
struct bu_vls vls;
@@ -355,7 +373,7 @@ f_attach(ClientData UNUSED(clientData), Tcl_Interp *interpreter, int argc, const
}
/* Look at last argument, skipping over any options which preceed it */
for (wp = &which_dm[2]; wp->type != -1; wp++)
for (wp = &which_dm[2]; wp->type != -1; wp++)
if (strcmp(argv[argc - 1], wp->name) == 0)
break;
@@ -662,6 +680,11 @@ f_dm(ClientData UNUSED(clientData), Tcl_Interp *interpreter, int argc, const cha
Tcl_AppendResult(interpreter, "ogl", (char *)NULL);
}
#endif /* DM_OGL */
#ifdef DM_TOGL
if (!strcmp(argv[argc-1], "togl")) {
Tcl_AppendResult(interp, "togl", (char *)NULL);
}
#endif /* DM_TOGL */
#ifdef DM_RTGL
if (!strcmp(argv[argc-1], "rtgl")) {
Tcl_AppendResult(interpreter, "rtgl", (char *)NULL);
+2 -2
View File
@@ -559,7 +559,7 @@ common_dm(int argc, const char *argv[])
width = atoi(argv[1]);
height = atoi(argv[2]);
#if defined(DM_X) || defined(DM_TK) || defined(DM_OGL) || defined(DM_WGL)
#if defined(DM_X) || defined(DM_TK) || defined(DM_OGL) || defined(DM_TOGL) || defined(DM_WGL)
# if 0
Tk_ResizeWindow(((struct dm_xvars *)dmp->dm_vars.pub_vars)->xtkwin, width, height);
# else
@@ -574,7 +574,7 @@ common_dm(int argc, const char *argv[])
return TCL_ERROR;
}
#if defined(DM_X) || defined(DM_TK) || defined(DM_OGL) || defined(DM_WGL)
#if defined(DM_X) || defined(DM_TK) || defined(DM_OGL) || defined(DM_TOGL) || defined(DM_WGL)
if (!strcmp(argv[0], "getx")) {
if (argc == 1) {
struct bu_vls tmp_vls;
+311
View File
@@ -0,0 +1,311 @@
/* D M - T O G L . C
* BRL-CAD
*
* Copyright (c) 2004-2010 United States Government as represented by
* the U.S. Army Research Laboratory.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this file; see the file named COPYING for more
* information.
*/
/** @file dm-ogl.c
*
* Routines specific to MGED's use of LIBDM's OpenGl display manager.
*
*/
#include "common.h"
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "tk.h"
#define USE_TOGL_STUBS
#include "togl.h"
#include "bu.h"
#include "vmath.h"
#include "mater.h"
#include "raytrace.h"
#include "dm_xvars.h"
#include "dm-togl.h"
#include "./mged.h"
#include "./sedit.h"
#include "./mged_dm.h"
extern void dm_var_init(); /* defined in attach.c */
extern void cs_set_bg(); /* defined in color_scheme.c */
static int Togl_dm();
static int Togl_doevent();
static void Togl_colorchange();
static void establish_zbuffer();
static void establish_lighting();
static void establish_transparency();
static void dirty_hook();
static void zclip_hook();
static void debug_hook();
static void bound_hook();
static void boundFlag_hook();
static void do_fogHint();
struct bu_structparse Togl_vparse[] = {
{"%d", 1, "depthcue", Togl_MV_O(cueing_on), Togl_colorchange },
{"%d", 1, "zclip", Togl_MV_O(zclipping_on), zclip_hook },
{"%d", 1, "zbuffer", Togl_MV_O(zbuffer_on), establish_zbuffer },
{"%d", 1, "lighting", Togl_MV_O(lighting_on), establish_lighting },
{"%d", 1, "transparency", Togl_MV_O(transparency_on), establish_transparency },
{"%d", 1, "fastfog", Togl_MV_O(fastfog), do_fogHint },
{"%f", 1, "density", Togl_MV_O(fogdensity), dirty_hook },
{"%d", 1, "has_zbuf", Togl_MV_O(zbuf), BU_STRUCTPARSE_FUNC_NULL },
{"%d", 1, "has_rgb", Togl_MV_O(rgb), BU_STRUCTPARSE_FUNC_NULL },
{"%d", 1, "has_doublebuffer", Togl_MV_O(doublebuffer), BU_STRUCTPARSE_FUNC_NULL },
{"%d", 1, "depth", Togl_MV_O(depth), BU_STRUCTPARSE_FUNC_NULL },
{"%d", 1, "debug", Togl_MV_O(debug), debug_hook },
{"%f", 1, "bound", Togl_MV_O(bound), bound_hook },
{"%d", 1, "useBound", Togl_MV_O(boundFlag), boundFlag_hook },
{"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL }
};
int
Togl_dm_init(struct dm_list *o_dm_list,
int argc,
char *argv[])
{
struct bu_vls vls;
printf("interp: %p\n", interp);
bu_log("running togl init\n");
dm_var_init(o_dm_list);
/* register application provided routines */
cmd_hook = Togl_dm;
Tk_DeleteGenericHandler(doEvent, (ClientData)NULL);
bu_log("about to call dm_open\n");
if ((dmp = dm_open(interp, DM_TYPE_TOGL, argc-1, argv)) == DM_NULL)
return TCL_ERROR;
bu_log("survived dm_open\n");
/*XXXX this eventually needs to move into Togl's private structure */
dmp->dm_vp = &view_state->vs_gvp->gv_scale;
dmp->dm_perspective = mged_variables->mv_perspective_mode;
bu_log("set vars\n");
eventHandler = Togl_doevent;
Tk_CreateGenericHandler(doEvent, (ClientData)NULL);
(void)DM_CONFIGURE_WIN(dmp);
bu_log("did event handler stuff\n");
bu_vls_init(&vls);
bu_vls_printf(&vls, "mged_bind_dm %s", bu_vls_addr(&pathName));
Tcl_Eval(interp, bu_vls_addr(&vls));
bu_vls_free(&vls);
return TCL_OK;
}
void
Togl_fb_open()
{
char *togl_name = "/dev/togl";
if ((fbp = (FBIO *)calloc(sizeof(FBIO), 1)) == FBIO_NULL) {
Tcl_AppendResult(interp, "Togl_fb_open: failed to allocate framebuffer memory\n",
(char *)NULL);
return;
}
*fbp = togl_interface; /* struct copy */
fbp->if_name = bu_malloc((unsigned)strlen(togl_name)+1, "if_name");
bu_strlcpy(fbp->if_name, togl_name, strlen(togl_name)+1);
/* Mark OK by filling in magic number */
fbp->if_magic = FB_MAGIC;
_togl_open_existing(fbp,
((struct togl_vars *)dmp->dm_vars.priv_vars)->togl);
}
/*
This routine is being called from doEvent() to handle Expose events.
*/
static int
Togl_doevent(ClientData clientData,
XEvent *eventPtr)
{
Togl_MakeCurrent(((struct togl_vars *)dmp->dm_vars.priv_vars)->togl);
if (eventPtr->type == Expose && eventPtr->xexpose.count == 0) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
dirty = 1;
/* no further processing of this event */
return TCL_RETURN;
}
/* allow further processing of this event */
return TCL_OK;
}
/*
* T O G L _ D M
*
* Implement display-manager specific commands, from MGED "dm" command.
*/
static int
Togl_dm(int argc,
char **argv)
{
if (!strcmp(argv[0], "set")) {
struct bu_vls vls;
bu_vls_init(&vls);
if (argc < 2) {
/* Bare set command, print out current settings */
bu_vls_struct_print2(&vls,
"dm_togl internal variables",
Togl_vparse,
(const char *)&((struct togl_vars *)dmp->dm_vars.priv_vars)->mvars);
} else if (argc == 2) {
bu_vls_struct_item_named(&vls,
Togl_vparse,
argv[1],
(const char *)&((struct togl_vars *)dmp->dm_vars.priv_vars)->mvars,
COMMA);
} else {
struct bu_vls tmp_vls;
bu_vls_init(&tmp_vls);
bu_vls_printf(&tmp_vls, "%s=\"", argv[1]);
bu_vls_from_argv(&tmp_vls, argc-2, (const char **)argv+2);
bu_vls_putc(&tmp_vls, '\"');
bu_struct_parse(&tmp_vls,
Togl_vparse,
(char *)&((struct togl_vars *)dmp->dm_vars.priv_vars)->mvars);
bu_vls_free(&tmp_vls);
}
Tcl_AppendResult(interp, bu_vls_addr(&vls), (char *)NULL);
bu_vls_free(&vls);
return TCL_OK;
}
return common_dm(argc, argv);
}
static void
Togl_colorchange()
{
if (((struct togl_vars *)dmp->dm_vars.priv_vars)->mvars.cueing_on) {
glEnable(GL_FOG);
} else {
glDisable(GL_FOG);
}
view_state->vs_flag = 1;
}
static void
establish_zbuffer()
{
(void)DM_SET_ZBUFFER(dmp, ((struct togl_vars *)dmp->dm_vars.priv_vars)->mvars.zbuffer_on);
view_state->vs_flag = 1;
}
static void
establish_lighting()
{
(void)DM_SET_LIGHT(dmp, ((struct togl_vars *)dmp->dm_vars.priv_vars)->mvars.lighting_on);
view_state->vs_flag = 1;
}
static void
establish_transparency()
{
(void)DM_SET_TRANSPARENCY(dmp, ((struct togl_vars *)dmp->dm_vars.priv_vars)->mvars.transparency_on);
view_state->vs_flag = 1;
}
static void
do_fogHint()
{
dm_fogHint(dmp, ((struct togl_vars *)dmp->dm_vars.priv_vars)->mvars.fastfog);
view_state->vs_flag = 1;
}
static void
dirty_hook()
{
dirty = 1;
}
static void
zclip_hook()
{
dmp->dm_zclip = ((struct togl_vars *)dmp->dm_vars.priv_vars)->mvars.zclipping_on;
view_state->vs_gvp->gv_zclip = dmp->dm_zclip;
dirty_hook();
}
static void
debug_hook()
{
DM_DEBUG(dmp, ((struct togl_vars *)dmp->dm_vars.priv_vars)->mvars.debug);
}
static void
bound_hook()
{
dmp->dm_bound =
((struct togl_vars *)dmp->dm_vars.priv_vars)->mvars.bound;
dirty_hook();
}
static void
boundFlag_hook()
{
dmp->dm_boundFlag =
((struct togl_vars *)dmp->dm_vars.priv_vars)->mvars.boundFlag;
dirty_hook();
}
/*
* Local Variables:
* mode: C
* tab-width: 8
* indent-tabs-mode: t
* c-file-style: "stroustrup"
* End:
* ex: shiftwidth=4 tabstop=8
*/
+1 -1
View File
@@ -153,7 +153,7 @@ void (*cur_sigint)(); /* Current SIGINT status */
int interactive = 1; /* >0 means interactive */
int cbreak_mode = 0; /* >0 means in cbreak_mode */
#if defined(DM_X) || defined(DM_TK) || defined(DM_OGL) || defined(DM_WGL)
#if defined(DM_X) || defined(DM_TK) || defined(DM_OGL) || defined(DM_TOGL) || defined(DM_WGL)
int classic_mged=0;
#else
int classic_mged=1;
Regular → Executable
View File
View File
View File
Regular → Executable
View File
View File
View File
View File
View File
View File
View File
View File
View File
Regular → Executable
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
View File
Regular → Executable
View File
View File
View File
View File
View File
View File
View File
Regular → Executable
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File

Some files were not shown because too many files have changed in this diff Show More