-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement limit WebGL textures to gl.MAX_TEXTURE_SIZE #6651
Changes from 9 commits
f223d9e
6f5ea64
7c92d81
d469bed
4a268fe
e755c68
b4c9787
d537edb
d7d794e
fa2e615
6d8919f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,6 +89,32 @@ suite('Rendering', function() { | |
assert.equal(fbo.width, 5); | ||
assert.equal(fbo.height, 15); | ||
}); | ||
|
||
test('should resize the dimensions of canvas based on max texture size', function() { | ||
let glStub; | ||
glStub = sinon.stub(p5.RendererGL.prototype, '_getParam'); | ||
const fakeMaxTextureSize = 100; | ||
glStub.returns(fakeMaxTextureSize); | ||
myp5.createCanvas(200, 200, myp5.WEBGL); | ||
assert.equal(myp5.canvas.width, 100); | ||
assert.equal(myp5.canvas.height, 100); | ||
|
||
glStub.restore(); | ||
}); | ||
|
||
test('should resize the dimensions of canvas by resizeCanvas based on max texture size', function() { | ||
|
||
let glStub; | ||
glStub = sinon.stub(p5.RendererGL.prototype, '_getParam'); | ||
const fakeMaxTextureSize = 100; | ||
glStub.returns(fakeMaxTextureSize); | ||
myp5.createCanvas(10, 10, myp5.WEBGL); | ||
myp5.resizeCanvas(200, 200); | ||
assert.equal(myp5.canvas.width, 100); | ||
assert.equal(myp5.canvas.height, 100); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think |
||
|
||
glStub.restore(); | ||
}); | ||
}); | ||
|
||
suite('p5.prototype.blendMode', function() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want this for both graphics and the main canvas, so maybe we should do the check inside RendererGL instead?