Spaces:
Sleeping
Sleeping
import abc | |
import six | |
class Platform(object): | |
"""Base class for all OpenGL platforms. | |
Parameters | |
---------- | |
viewport_width : int | |
The width of the main viewport, in pixels. | |
viewport_height : int | |
The height of the main viewport, in pixels | |
""" | |
def __init__(self, viewport_width, viewport_height): | |
self.viewport_width = viewport_width | |
self.viewport_height = viewport_height | |
def viewport_width(self): | |
"""int : The width of the main viewport, in pixels. | |
""" | |
return self._viewport_width | |
def viewport_width(self, value): | |
self._viewport_width = value | |
def viewport_height(self): | |
"""int : The height of the main viewport, in pixels. | |
""" | |
return self._viewport_height | |
def viewport_height(self, value): | |
self._viewport_height = value | |
def init_context(self): | |
"""Create an OpenGL context. | |
""" | |
pass | |
def make_current(self): | |
"""Make the OpenGL context current. | |
""" | |
pass | |
def make_uncurrent(self): | |
"""Make the OpenGL context uncurrent. | |
""" | |
pass | |
def delete_context(self): | |
"""Delete the OpenGL context. | |
""" | |
pass | |
def supports_framebuffers(self): | |
"""Returns True if the method supports framebuffer rendering. | |
""" | |
pass | |
def __del__(self): | |
try: | |
self.delete_context() | |
except Exception: | |
pass | |