Skip to content

Commit

Permalink
delay invocation of OpenGL until we instantiate a CyRasterizer
Browse files Browse the repository at this point in the history
  • Loading branch information
jabooth committed Jan 13, 2015
1 parent 530e28b commit 6fa28a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cyrasterize/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import numpy as np

from cyrasterize.glrasterizer import GLRasterizer


class CyRasterizerBase(object):
r"""Offscreen OpenGL rasterizer of fixed width and height.
Expand Down Expand Up @@ -56,6 +54,8 @@ class CyRasterizerBase(object):

def __init__(self, width=1024, height=768, model_matrix=None,
view_matrix=None, projection_matrix=None):
# delay import so we only check for GL setup at first initialization
from .glrasterizer import GLRasterizer
self._opengl = GLRasterizer(width, height)
if not self._opengl.successfully_initialized():
raise RuntimeError("Failed to initialize CyRasterizer")
Expand Down

0 comments on commit 6fa28a2

Please sign in to comment.