Commit d0941dad authored by Dalai Felinto's avatar Dalai Felinto
Browse files

Use the new gpu/offscreen API

parent 867cd000
...@@ -130,7 +130,7 @@ class HMD_Base: ...@@ -130,7 +130,7 @@ class HMD_Base:
""" """
try: try:
for i in range(2): for i in range(2):
self._offscreen_object[i] = gpu.offscreen_object_create(self._width[i], self._height[i]) self._offscreen_object[i] = gpu.offscreen.new(self._width[i], self._height[i])
self._framebuffer_object[i] = self._offscreen_object[i].framebuffer_object self._framebuffer_object[i] = self._offscreen_object[i].framebuffer_object
self._color_object[i] = self._offscreen_object[i].color_object self._color_object[i] = self._offscreen_object[i].color_object
...@@ -162,8 +162,7 @@ class HMD_Base: ...@@ -162,8 +162,7 @@ class HMD_Base:
""" """
try: try:
for i in range(2): for i in range(2):
if self._offscreen_object[i]: self._offscreen_object[i] = None
gpu.offscreen_object_free(self._offscreen_object[i])
except Exception as E: except Exception as E:
print(E) print(E)
......
...@@ -170,7 +170,7 @@ class VirtualRealityDisplayOperator(bpy.types.Operator): ...@@ -170,7 +170,7 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
modelview_matrix = self._hmd.modelview_matrix modelview_matrix = self._hmd.modelview_matrix
# drawing # drawing
gpu.offscreen_object_draw(offscreen_object, projection_matrix, modelview_matrix) offscreen_object.draw(projection_matrix, modelview_matrix)
self._hmd.frameReady() self._hmd.frameReady()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment