Commit Graph

435 Commits

Author SHA1 Message Date
Andrew Gerrand
a60976f260 internal/graphics: increase defaultViewportSize to 8192 (#538)
This makes it possible to run ebiten applications in full screen on 5k
displays, such as Apple's 27" iMac.

Fix issue #537
2018-03-08 11:53:49 +09:00
Hajime Hoshi
8d98f297f2 graphics: Refactoring: Avoid type switch 2018-03-05 00:00:25 +09:00
Hajime Hoshi
3479b80f1c opengl: Use unsafe-way to convert []float32/[]uint16 to []byte; Remove internal/endian 2018-03-04 18:06:35 +09:00
Hajime Hoshi
e5089934db graphics: Bug fix: Don't delete buffers on browsers (#526) 2018-03-02 01:06:21 +09:00
Hajime Hoshi
db738676ce restorable: Refactoring: clearIfVolatile 2018-03-01 23:13:23 +09:00
Hajime Hoshi
127f6c09c8 graphics: Specify rect to glTexSubImage2D 2018-03-01 01:58:09 +09:00
Hajime Hoshi
9f6fd0db9a graphics: Use the original width/height for glTexSubImage2D 2018-03-01 00:47:37 +09:00
Hajime Hoshi
15d2e6b82b graphics: Fix comments 2018-02-28 23:40:43 +09:00
Hajime Hoshi
c624359163 graphics: Remove glClear before glTexSubImage2D, that is no longer needed 2018-02-28 23:35:05 +09:00
Hajime Hoshi
9db042ae9e graphics: Refactoring: easier way to clear framebuffer 2018-02-28 22:46:57 +09:00
Hajime Hoshi
8c8e512059 affine: User nillable pattern for ColorM 2018-02-28 02:14:06 +09:00
Hajime Hoshi
86671f3337 opengl: Remove pixels argument from NewTexture 2018-02-25 23:34:34 +09:00
Hajime Hoshi
85b133dad0 graphics: Remove NewImageFromImage command 2018-02-25 23:22:49 +09:00
Hajime Hoshi
a2d40e0908 graphics: Remove offsetX/offsetY from framebuffer 2018-02-24 23:35:55 +09:00
Hajime Hoshi
c5d1f11d95 graphics: Remove unused argument from projectionMatrix 2018-02-24 23:33:28 +09:00
Hajime Hoshi
9da5099060 graphics: Refactoring: Flip Y by geometry matrix instead of projection matrix 2018-02-24 23:32:36 +09:00
Hajime Hoshi
b58dc26832 graphics: Remove fillCommand 2018-02-24 16:19:43 +09:00
Hajime Hoshi
af64f8689a graphics: Fix screen filter calculation 2018-02-24 04:25:07 +09:00
Hajime Hoshi
9fba60ca03 Revert "graphics: Adjust texel positions for consitency"
This reverts commit 816fb314a4.
2018-02-24 01:52:49 +09:00
Hajime Hoshi
816fb314a4 graphics: Adjust texel positions for consitency
On second thought, given pixel coords represent a center of texels...
2018-02-24 01:52:05 +09:00
Hajime Hoshi
7c66d884d4 graphics: Adjusting position is no longer needed
Now pixel position is treated as left-upper in linear filter
2018-02-24 01:32:48 +09:00
Hajime Hoshi
e5a2cf29c0 graphics: Bug fix: pixel coord is upper-left by default 2018-02-24 01:16:32 +09:00
Hajime Hoshi
c76ff5ceb2 graphics: Bug fix: fix screen filter calculation
Fixes #512
2018-02-23 23:13:20 +09:00
Hajime Hoshi
b036cac616 graphics: Fix screen filter calculation 2018-02-23 02:36:12 +09:00
Hajime Hoshi
591e0ad995 graphics: Add 'screen' filter for fast rendering (#509) 2018-02-23 01:28:35 +09:00
Hajime Hoshi
092cb2f3f6 graphics: Reset source size parameter just in case 2018-02-22 11:27:15 +09:00
Hajime Hoshi
30e48d5c3c graphics: Stop unnecessary copy of elements (projection matrix) 2018-02-20 01:36:56 +09:00
Hajime Hoshi
40b1948baa graphics: Stop unnecessary copy of elements 2018-02-20 01:17:21 +09:00
Hajime Hoshi
f1f7e5bcec affine: Transpose ColorM implementation for optimization 2018-02-20 00:53:53 +09:00
Hajime Hoshi
9b361086d7 affine: Use float32 inside of ColorM 2018-02-20 00:33:56 +09:00
Hajime Hoshi
2db1753503 opengl: Remove struct usages to avoid copying (texture) 2018-02-19 02:49:00 +09:00
Hajime Hoshi
6ef4bbde2d graphics: Add FilterDefault; Make DrawImageOptions specify Filter (#453) 2018-02-14 02:59:44 +09:00
Hajime Hoshi
95480d0644 affine: Separate ColorM impl into two slices
This fix avoids unnecessary allocating arrays.
2018-02-12 19:01:01 +09:00
Hajime Hoshi
24d7487fc7 graphics: Bug fix: TestImageTooManyFill didin't pass on some machines (reland)
Fixes #492
2018-02-03 23:03:18 +09:00
Hajime Hoshi
9ece27e7e8 Revert "graphics: Bug fix: TestImageTooManyFill didin't pass on some machines"
This reverts commit 7cb7b7b4ff.
2018-02-03 20:39:33 +09:00
Hajime Hoshi
7cb7b7b4ff graphics: Bug fix: TestImageTooManyFill didin't pass on some machines
Fixes #492
2018-02-03 20:36:16 +09:00
Hajime Hoshi
4bbb4b0445 graphics: Remove unneeded comments (#491) 2018-02-03 03:32:03 +09:00
Hajime Hoshi
52350c1b1b graphics: Bug fix: TestImageEdge failed on MacBook Pro (#491) 2018-02-03 03:30:09 +09:00
Hajime Hoshi
beaa060ce3 graphics: Adjust texel values that can be exactly on the edges of the source rect (#491) 2018-02-03 02:07:46 +09:00
Hajime Hoshi
80596820cf graphics: Replace []uint8 with []byte 2018-01-28 22:40:36 +09:00
seebs
0b7ba8e573 Do GeoM projection on CPU (#477)
Handling GeoM projection on CPU may seem like a weird choice, given
how fast GPU is, but it pays off:

* You only have to do a very small subset of the actual matrix
  multiply.
* You don't have to construct a matrix in the vertex shader.
* Six fewer float32 values per vertex.
* You do still have to do the matrix computation for each vertex,
  though.

Signed-off-by: Seebs <seebs@seebs.net>
2018-01-14 16:01:55 +09:00
Hajime Hoshi
5d4c4f1283 graphics: Bug fix: Don't delete the screen framebuffer (iOS) 2017-12-31 20:55:04 +09:00
Hajime Hoshi
c636dec721 graphics: Remove glFlush() for performance 2017-12-21 03:19:28 +09:00
Hajime Hoshi
e13bb0769b graphics: Add 'not-reached' clause 2017-12-21 00:57:36 +09:00
Hajime Hoshi
0a99103bc1 graphics: Call roundTexel only on linear filter (#461) 2017-12-21 00:38:22 +09:00
Hajime Hoshi
8e72906f3d graphics: Separate GLSL programs for filters (#461) 2017-12-21 00:33:08 +09:00
Hajime Hoshi
f072e8f1c5 graphics: Optimize GLSL 2017-12-18 03:10:04 +09:00
Hajime Hoshi
44dc9f6220 graphics: Optimize fragment shader 2017-12-16 18:35:45 +09:00
Hajime Hoshi
6eb148b9a1 graphics: Fragment shader optimization (#461) 2017-12-16 05:05:21 +09:00
Hajime Hoshi
078d107c24 graphics: Bug fix: vertex position should be highp 2017-12-16 03:30:52 +09:00
Hajime Hoshi
d45a975e3d graphics: Remove one unnecessary check from fragment shader (#461) 2017-12-16 01:42:36 +09:00
Hajime Hoshi
d6878d6887 graphics: Remove one bound check from fragment shader (#461) 2017-12-16 01:33:35 +09:00
Hajime Hoshi
98532d8983 graphics: Add TestImageOutside 2017-12-14 00:25:35 +09:00
Hajime Hoshi
704d4cf464 graphics: texel should be represented as highp for precision
Fixes #460
2017-12-13 23:45:05 +09:00
Hajime Hoshi
aea2e491c3 graphics: Temporary hack for mobile browers
roundTexel doesn't work well on moible browsers
2017-12-12 03:27:56 +09:00
Hajime Hoshi
723d153800 Reland(2): graphics: Appropriate rendering of edges on linear filter 2017-12-12 00:03:01 +09:00
Hajime Hoshi
362d1c417f Revert 'graphics: Appropriate rendering of edges on linear filter (Reland)' (#458) 2017-12-11 20:30:54 +09:00
Hajime Hoshi
7b74a8f29f graphics: Improve roundTexel implementation 2017-12-07 03:24:46 +09:00
Hajime Hoshi
1152439e65 graphics: Appropriate rendering of edges on linear filter (Reland)
Fixes #456
2017-12-07 02:26:16 +09:00
Hajime Hoshi
8091aa5190 Revert 'graphics: Appropriate rendering of edges on linear filter' #456 2017-12-06 23:40:29 +09:00
Hajime Hoshi
bc0432f310 graphics: Appropriate rendering of edges on linear filter
Fixes #315
2017-12-06 21:40:24 +09:00
Hajime Hoshi
264ca49a43 graphics: Bug fix: revert viewport size for Edge 2017-12-05 03:13:40 +09:00
Hajime Hoshi
f74c1e67ea graphics: Use power-of-2 size for the default framebuffer 2017-12-05 02:33:04 +09:00
Hajime Hoshi
eeea25f202 opengl: Remove 'normalize' argument from VertexAttribPointer 2017-12-03 19:21:59 +09:00
Hajime Hoshi
2e1e4adb84 graphics: Fix some variables in GLSL 2017-12-03 19:07:12 +09:00
Hajime Hoshi
847ba9de0c graphics: Refactoring: Move adjustment logic for glClearColor to opengl package 2017-12-03 03:51:42 +09:00
Hajime Hoshi
8e7e960b56 graphics: Limit source-rectangle range
Remove texture adjustment introduced due to #317
2017-12-02 23:13:44 +09:00
Hajime Hoshi
c2fab6cca3 graphics: Bug fix: glClear doesn't treat 0 or 1 correctly
Fixes #452
2017-12-02 22:25:02 +09:00
Hajime Hoshi
d455b9b8bb opengl: SetViewport no longer returns error 2017-09-25 00:17:20 +09:00
Hajime Hoshi
ade56f8176 opengl: BindTexture no longer returns error 2017-09-25 00:11:19 +09:00
Hajime Hoshi
37d8bd312a graphics: Refactoring 2017-09-25 00:06:45 +09:00
Hajime Hoshi
8fbe423125 graphics: Delete programs explicitly and add comments 2017-09-24 23:41:37 +09:00
Hajime Hoshi
e5ca84013c graphics: Bug fix: Delete buffer when necessary 2017-09-24 23:20:26 +09:00
Hajime Hoshi
ecc9d0b3b1 graphics: Add comments 2017-09-24 22:56:50 +09:00
Hajime Hoshi
ceceed951f graphics: Add comments 2017-09-22 02:49:37 +09:00
Hajime Hoshi
6145ecee74 graphics: Misspelling 2017-09-21 23:33:27 +09:00
Hajime Hoshi
b47e564762 graphics: Add comments 2017-09-20 01:35:56 +09:00
Hajime Hoshi
0831fd2a0d graphics: Add comments 2017-09-19 01:37:24 +09:00
Hajime Hoshi
fc125eb531 graphics: Add comments 2017-09-16 15:49:29 +09:00
Hajime Hoshi
b51d93a707 restorable: Add comments 2017-09-12 03:14:13 +09:00
Hajime Hoshi
72c02fc398 graphics: Bug fix: viewport size must be within the framebuffer size
This fixes #71 and #420
2017-09-09 19:33:51 +09:00
Hajime Hoshi
d30f8a2bbf graphics: Fix viewport sizes for Edge (#71) 2017-09-07 03:08:22 +09:00
Hajime Hoshi
2d5b062c3c opengl: Refactoring: Replace NewBuffer with new funcs
Replace NewBuffer with NewArrayBuffer and NewElementArrayBuffer
2017-09-01 01:30:09 +09:00
Hajime Hoshi
12c24215b1 graphics: Bug fix: Flush after filling (#419) 2017-08-24 00:11:08 +09:00
Hajime Hoshi
9ab517cf82 restorable: Refactoring 2017-08-07 00:06:35 +09:00
Hajime Hoshi
c0ecb7a386 graphics: Move CopyImage to restorable 2017-08-06 21:21:38 +09:00
Hajime Hoshi
631264fce1 Add 'internal/math' package 2017-08-06 20:05:14 +09:00
Hajime Hoshi
ee98148b54 graphics: Use default precisions in the fragment shader 2017-07-29 04:08:03 +09:00
Hajime Hoshi
84a7787ac9 graphics: No need to specify precision on vertex shaders (highp is default) 2017-07-29 02:57:56 +09:00
Hajime Hoshi
d46d9ac7c2 opengl: Remove GlslHighpSupported 2017-07-24 22:59:25 +09:00
Hajime Hoshi
85d39699d3 graphics: Bug fix: Need to specify default precisions (#390) 2017-07-24 21:56:40 +09:00
Hajime Hoshi
3a3a4af035 graphics: Avoid type assertions for Fill 2017-07-02 21:32:07 +09:00
Hajime Hoshi
c694851765 ui: Center the screen on fullscreen mode (#374) 2017-07-01 04:12:09 +09:00
Hajime Hoshi
7d181e3182 opengl: Hide OpenGL context usages into internal/graphics package 2017-05-31 02:18:04 +09:00
Hajime Hoshi
e53262bfac graphics: Replace copy with for-loop 2017-05-28 00:14:53 +09:00
Hajime Hoshi
a816c9c7fe Reduce defer sentences for performance 2017-05-27 21:35:38 +09:00
Hajime Hoshi
1b1b996817 graphics: Avoid copying ColorM 2017-05-27 16:17:49 +09:00
Hajime Hoshi
1b72263ce1 sync: Add sync package 2017-05-27 02:37:01 +09:00
Hajime Hoshi
e1b5c992b4 graphics: Refactoring: remove unnecessary empty slices 2017-05-26 22:32:38 +09:00
Hajime Hoshi
5699822d64 graphics: Avoid creating struct as much as possible 2017-05-02 22:45:09 +09:00