Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dalai Felinto
virtual_reality_viewport
Commits
aba36557
Commit
aba36557
authored
Sep 29, 2015
by
Dalai Felinto
Browse files
Preview does not need width/height
parent
7a101aa0
Changes
2
Hide whitespace changes
Inline
Side-by-side
space_view3d_virtual_reality/operator.py
View file @
aba36557
...
...
@@ -142,7 +142,7 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
height
=
self
.
_hmd
.
height
texture
=
self
.
_hmd
.
texture
self
.
_preview
.
init
(
texture
,
width
,
height
)
self
.
_preview
.
init
(
texture
)
self
.
_area_hash
=
hash
(
context
.
area
)
# setup modal
...
...
space_view3d_virtual_reality/preview.py
View file @
aba36557
...
...
@@ -20,23 +20,16 @@ TODO = True
class
Preview
:
__slots__
=
{
"_texture"
,
"_width"
,
"_height"
,
}
def
init
(
self
,
texture
,
width
,
height
):
def
init
(
self
,
texture
):
"""
Initialize preview window
:param texture: 2D Texture binding ID (bind to the Framebuffer Object)
:type texture: bgl.GLint
:param width: Horizontal dimension of preview window
:type width: int
:param height: Vertical dimension of preview window
:type height: int
"""
self
.
_texture
=
texture
self
.
update
(
texture
,
width
,
height
)
self
.
update
(
texture
)
def
quit
(
self
):
"""
...
...
@@ -44,20 +37,14 @@ class Preview:
"""
pass
def
update
(
self
,
texture
,
width
,
height
):
def
update
(
self
,
texture
):
"""
Resize preview window
:param texture: 2D Texture binding ID (bind to the Framebuffer Object)
:type texture: bgl.GLint
:param width: Horizontal dimension of preview window
:type width: int
:param height: Vertical dimension of preview window
:type height: int
"""
self
.
_texture
=
texture
self
.
_width
=
width
self
.
_height
=
height
def
loop
(
self
,
scale
):
"""
...
...
@@ -69,7 +56,7 @@ class Preview:
texture
=
self
.
_texture
act_tex
=
Buffer
(
GL_INT
,
1
)
glGetIntegerv
(
GL_
ACTIVE_
TEXTURE
,
act_tex
)
glGetIntegerv
(
GL_TEXTURE
_2D
,
act_tex
)
if
scale
!=
100
:
viewport
=
Buffer
(
GL_INT
,
4
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment