summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chroma/camera.py4
-rw-r--r--chroma/gpu/tools.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/chroma/camera.py b/chroma/camera.py
index f938bd6..0d3e225 100644
--- a/chroma/camera.py
+++ b/chroma/camera.py
@@ -58,7 +58,7 @@ def encode_movie(dir):
class Camera(multiprocessing.Process):
"The camera class is used to render a Geometry object."
def __init__(self, geometry, size=(800,600), device_id=None):
- multiprocessing.Process.__init__(self)
+ super(Camera, self).__init__()
self.geometry = geometry
self.device_id = device_id
self.size = size
@@ -622,6 +622,7 @@ class Camera(multiprocessing.Process):
return
def run(self):
+ pygame.init()
self.window = pygame.display.set_mode(self.size)
self.screen = pygame.Surface(self.size, pygame.SRCALPHA)
pygame.display.set_caption('')
@@ -825,3 +826,4 @@ def view(obj, size=(800,600), **camera_kwargs):
geometry = create_geometry_from_obj(obj)
camera = Camera(geometry, size, **camera_kwargs)
camera.start()
+ camera.join()
diff --git a/chroma/gpu/tools.py b/chroma/gpu/tools.py
index 98c7e6a..8bf5d81 100644
--- a/chroma/gpu/tools.py
+++ b/chroma/gpu/tools.py
@@ -8,8 +8,6 @@ from pycuda import gpuarray as ga
from chroma.cuda import srcdir
-cuda.init()
-
# standard nvcc options
cuda_options = ('--use_fast_math',)#, '--ptxas-options=-v']