Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions core/texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ X.texture = function() {
* @protected
*/
this._grayscale = false;

this._needs_update = false;

// inject functionality
inject(this, new X.loadable()); // this object is loadable from a file
Expand All @@ -113,6 +115,19 @@ X.texture = function() {
goog.inherits(X.texture, X.base);


/**
* Get the raw data of this texture.
*
* @return {?Object} The raw data array (Uint8Array).
*/
X.texture.prototype.__defineGetter__('rawData', function() {

return this._rawData;

});



/**
* Set the raw data of this texture.
*
Expand Down Expand Up @@ -168,4 +183,14 @@ X.texture.prototype.__defineSetter__('grayscale', function(grayscale) {

});

X.texture.prototype.updateTexture = function(data) {

this._rawData = data;
this._needs_update = true;

this._dirty = true;

};

goog.exportSymbol('X.texture', X.texture);
goog.exportSymbol('X.texture.prototype.updateTexture', X.texture.prototype.updateTexture);
32 changes: 16 additions & 16 deletions io/interactor.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,17 +363,17 @@ X.interactor.prototype.init = function() {
this._element.oncontextmenu = null;
}

if (this._config['KEYBOARD_ENABLED']) {
// if (this._config['KEYBOARD_ENABLED']) {

// the google closure way did not work, so let's do it this way..
window.onkeydown = this.onKey_.bind(this);
// // the google closure way did not work, so let's do it this way..
// window.onkeydown = this.onKey_.bind(this);

} else {
// } else {

// remove the keyboard observer
window.onkeydown = null;
// // remove the keyboard observer
// window.onkeydown = null;

}
// }

// touch events
if (this._config['TOUCH_ENABLED']) {
Expand Down Expand Up @@ -561,13 +561,13 @@ X.interactor.prototype.onMouseMovementOutside_ = function(event) {

// reset the click flags
this._mouseInside = false;
if (this._config['KEYBOARD_ENABLED']) {
// if (this._config['KEYBOARD_ENABLED']) {

// if we observe the keyboard, remove the observer here
// this is necessary if there are more than one renderer in the document
window.onkeydown = null;
// // if we observe the keyboard, remove the observer here
// // this is necessary if there are more than one renderer in the document
// window.onkeydown = null;

}
// }

this._leftButtonDown = false;
this._middleButtonDown = false;
Expand Down Expand Up @@ -940,13 +940,13 @@ X.interactor.prototype.onMouseMovementInside_ = function(event) {

this._mouseInside = true;

if (this._config['KEYBOARD_ENABLED'] && window.onkeydown == null) {
// if (this._config['KEYBOARD_ENABLED'] && window.onkeydown == null) {

// we re-gained the focus, enable the keyboard observer again!
window.onkeydown = this.onKey_.bind(this);
// // we re-gained the focus, enable the keyboard observer again!
// window.onkeydown = this.onKey_.bind(this);


}
// }

// prevent any other actions by the browser (f.e. scrolling, selection..)
event.preventDefault();
Expand Down
Loading