Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d32fb8c26 | ||
|
|
8547fb7418 | ||
|
|
517c191889 | ||
|
|
7aa3e4c046 | ||
|
|
fffbf84e9a | ||
|
|
530c3f13bb | ||
|
|
84367d3785 | ||
|
|
660da4874c | ||
|
|
f15a68cdc7 | ||
|
|
1e7c257124 | ||
|
|
bcb3fbf6c9 | ||
|
|
cfcd92430f | ||
|
|
e400a0c7af | ||
|
|
333bc1ea25 | ||
|
|
882f70b598 | ||
|
|
34cac3c59e | ||
|
|
0a530c1d2d | ||
|
|
676348f375 | ||
|
|
35d65690a5 | ||
|
|
1c4e36f588 | ||
|
|
009ffad472 | ||
|
|
448e32d91c | ||
|
|
d02faa7107 | ||
|
|
c89360baf4 | ||
|
|
5a48047169 | ||
|
|
2f2e50c835 | ||
|
|
6ccb95d0e5 | ||
|
|
805c8740fc | ||
|
|
4bae45616f | ||
|
|
48e155f0e9 | ||
|
|
1f636033ca | ||
|
|
5c69f99450 | ||
|
|
3c0634e4a5 | ||
|
|
56eaae9b43 | ||
|
|
b33d862909 | ||
|
|
0de91174eb | ||
|
|
a6714613fc | ||
|
|
1d990ac249 | ||
|
|
27660a072c | ||
|
|
fdac746a0a | ||
|
|
b47e99c605 | ||
|
|
2b47a25ff2 | ||
|
|
988c450d22 | ||
|
|
ce9d8f5c2b | ||
|
|
cf6a595432 | ||
|
|
bd34a352d0 | ||
|
|
52adf3cded | ||
|
|
ab3e36b678 | ||
|
|
bb9262898a | ||
|
|
250ef1e923 | ||
|
|
f725c608cb | ||
|
|
16b47beae1 | ||
|
|
7e9d83fa2a | ||
|
|
6052966a62 | ||
|
|
8c63f7f057 | ||
|
|
b7fc0d5a20 | ||
|
|
28b20fa8b8 | ||
|
|
0008966731 | ||
|
|
6586b95cfb | ||
|
|
c448fbf431 | ||
|
|
0819e263ef | ||
|
|
91bdc731ce | ||
|
|
e319b14c59 | ||
|
|
2e4b753635 | ||
|
|
788a8da44e | ||
|
|
be523a6b2a | ||
|
|
ea10013904 | ||
|
|
7e2ced2087 | ||
|
|
37e8c24164 | ||
|
|
c221c8bd8a | ||
|
|
11a4c23d8e | ||
|
|
c1935573fe | ||
|
|
697379b83d | ||
|
|
732b38c331 | ||
|
|
c8c9ad43bf | ||
|
|
b51b4b5648 | ||
|
|
d1ce59f9d7 | ||
|
|
35e91320f1 | ||
|
|
49185fb6d6 | ||
|
|
7edc197283 | ||
|
|
a714b8e6b3 | ||
|
|
6dc65b3772 | ||
|
|
2a52490f2c | ||
|
|
a33af6a828 | ||
|
|
fbbcd30bd6 | ||
|
|
62afd190b8 | ||
|
|
ee8789c2db | ||
|
|
45ec98834f | ||
|
|
4a0f634faf | ||
|
|
58ddfd09b5 | ||
|
|
94fe623e1d | ||
|
|
d889150d31 | ||
|
|
a11203ff8d | ||
|
|
7fca455fad | ||
|
|
5651deff6e | ||
|
|
ee49525fd7 | ||
|
|
df4348cb9f |
+618
@@ -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
|
||||
|
||||
@@ -98,6 +98,7 @@ EXTRA_DIST = \
|
||||
BUGS \
|
||||
ChangeLog \
|
||||
TODO \
|
||||
TODO.togl \
|
||||
autogen.sh \
|
||||
libtool
|
||||
|
||||
|
||||
@@ -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.)
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
@@ -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 = \
|
||||
|
||||
@@ -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
File diff suppressed because it is too large
Load Diff
+27
-1
@@ -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 */
|
||||
|
||||
@@ -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
@@ -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 \
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
@@ -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;
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
@@ -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
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user