Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
prp
sage2
Commits
1b997e68
Commit
1b997e68
authored
May 13, 2014
by
Thomas Marrinan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
starting to handle webgl context lost
Former-commit-id: fafacf964436c30a788b83e82740ec7973bcee86
parent
8314c4cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
public_HTTPS/uploads/apps/texture_cube/texture_cube.js
public_HTTPS/uploads/apps/texture_cube/texture_cube.js
+16
-0
No files found.
public_HTTPS/uploads/apps/texture_cube/texture_cube.js
View file @
1b997e68
...
...
@@ -68,6 +68,9 @@ var texture_cube = SAGE2_App.extend( {
this
.
roty
=
null
;
this
.
resizeEvents
=
"
continuous
"
;
this
.
webglContextLost
=
this
.
webglContextLostMethod
.
bind
(
this
);
this
.
webglContextRestored
=
this
.
webglContextRestoredMethod
.
bind
(
this
);
},
init
:
function
(
id
,
width
,
height
,
resrc
,
date
)
{
...
...
@@ -77,6 +80,9 @@ var texture_cube = SAGE2_App.extend( {
// application specific 'init'
this
.
initGL
();
if
(
this
.
gl
){
this
.
element
.
addEventListener
(
"
webglcontextlost
"
,
this
.
webglContextLost
,
false
);
this
.
element
.
addEventListener
(
"
webglcontextrestored
"
,
this
.
webglContextRestored
,
false
);
this
.
initShaders
();
this
.
initLighting
();
this
.
initBuffers
();
...
...
@@ -112,6 +118,16 @@ var texture_cube = SAGE2_App.extend( {
}
},
webglContextLostMethod
:
function
(
event
)
{
console
.
log
(
"
WebGL Context Lost
"
);
console
.
log
(
event
);
},
webglContextRestoredMethod
:
function
(
event
)
{
console
.
log
(
"
WebGL Context Restored
"
);
console
.
log
(
event
);
},
initShaders
:
function
()
{
var
fragmentShader
=
this
.
getShader
(
shader_fs
,
"
x-shader/x-fragment
"
);
var
vertexShader
=
this
.
getShader
(
shader_vs
,
"
x-shader/x-vertex
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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