Skip to content

Commit

Permalink
Add new togl in new branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
culler committed Jan 16, 2024
1 parent 6c6bcd7 commit cb71037
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 18 deletions.
19 changes: 6 additions & 13 deletions opengl/CyOpenGL.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include "CySnapPyfont.pxi"
include "CySnapPyimages.pxi"

from .infowindow import InfoWindow
from . import togl
from . import togl3

from cpython cimport array

Expand All @@ -22,7 +22,7 @@ from math import sqrt, ceil, floor, pi, sin, cos, tan
from random import random
import time

Togl_dir = os.path.abspath(os.path.dirname(togl.__file__))
Togl_dir = os.path.abspath(os.path.dirname(togl3.__file__))

import tkinter as Tk_

Expand Down Expand Up @@ -106,18 +106,11 @@ class RawOpenGLWidget(Tk_.Widget, Tk_.Misc):

curr_platform = sys.platform
cpu_width = platform.architecture()[0]
if curr_platform[:5] == 'linux':
curr_platform = 'linux2'
if curr_platform[:5] == "linux" and cpu_width == '64bit':
curr_platform += "-x86_64"
if curr_platform[:5] == 'linux2':
curr_platform = 'linux'
if curr_platform == 'win32':
windows_version = sys.getwindowsversion()
if (windows_version.major, windows_version.minor) > (6,0):
curr_platform += 'VC'
if cpu_width == '64bit':
curr_platform += '-x86_64'
suffix = curr_platform + "-tk" + master.getvar("tk_version")
Togl_path = os.path.join(Togl_dir, suffix)
current_platform = 'windows'
Togl_path = os.path.join(Togl_dir, curr_platform)
if not os.path.exists(Togl_path):
raise RuntimeError('Togl directory "%s" missing.' % Togl_path)

Expand Down
3 changes: 3 additions & 0 deletions python/togl3/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Dummy module to help CyOpenGL find togl

pass
10 changes: 10 additions & 0 deletions python/togl3/linux/,
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- tcl -*-
# Tcl package index file, version 1.1
#
if {[package vsatisfies [package provide Tcl] 9.0-]} {
package ifneeded Togl 3.0 \
[list load [file join $dir libtcl9Togl3.0.so] [string totitle Togl]]
} else {
package ifneeded Togl 3.0 \
[list load [file join $dir libTogl3.0.so] [string totitle Togl]]
}
Binary file added python/togl3/linux/Togl3.0/libTogl3.0.so
Binary file not shown.
10 changes: 10 additions & 0 deletions python/togl3/linux/Togl3.0/pkgIndex.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- tcl -*-
# Tcl package index file, version 1.1
#
if {[package vsatisfies [package provide Tcl] 9.0-]} {
package ifneeded Togl 3.0 \
[list load [file join $dir libtcl9Togl3.0.so] [string totitle Togl]]
} else {
package ifneeded Togl 3.0 \
[list load [file join $dir libTogl3.0.so] [string totitle Togl]]
}
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def add(self, source_file, dependency_mod_time=0.0):
'snappy/raytracing',
'snappy/raytracing/shaders',
'snappy/raytracing/zoom_slider',
'snappy/togl',
'snappy/togl3',
'snappy/dev',
'snappy/dev/extended_ptolemy',
'snappy/dev/vericlosed',
Expand All @@ -583,9 +583,7 @@ def add(self, source_file, dependency_mod_time=0.0):
'doc/_static/js/*',
'doc/_static/css/*',
'doc/_static/css/fonts/*'],
'snappy/togl': ['*-tk*/Togl2.0/*',
'*-tk*/Togl2.1/*',
'*-tk*/mactoolbar*/*'],
'snappy/togl3': ['*/Togl3.0/*'],
'snappy/manifolds' : ['HTWKnots/*.gz'],
'snappy/twister' : ['surfaces/*'],
'snappy/ptolemy':['magma/*.magma_template',
Expand Down Expand Up @@ -622,7 +620,7 @@ def add(self, source_file, dependency_mod_time=0.0):
'snappy/raytracing':'python/raytracing',
'snappy/raytracing/shaders':'python/raytracing/shaders',
'snappy/raytracing/zoom_slider':'python/raytracing/zoom_slider',
'snappy/togl': 'python/togl',
'snappy/togl3': 'python/togl3',
'snappy/dev':'dev/python',
'snappy/dev/extended_ptolemy':'dev/extended_ptolemy',
'snappy/dev/vericlosed':'dev/vericlosed',
Expand Down

0 comments on commit cb71037

Please sign in to comment.