Commit Graph

80 Commits

Author SHA1 Message Date
Hajime Hoshi
ed09406655 graphicscommand: Bug fix: wrong adjustment of texels
Fixes #887
2019-06-26 11:45:09 +09:00
Hajime Hoshi
f40798b586 graphics: Move const definitions to driver package
Let's keep 'graphics' package as a package for utility functions
or testable functions as much as possible.
2019-06-26 01:05:13 +09:00
Hajime Hoshi
93c31654da graphicscommand: Refactoring 2019-06-25 23:55:33 +09:00
Hajime Hoshi
7e0dee0730 graphicscommand: Bug fix: Use graphics.InternalImageSize before specifying the size
Fixes #887
2019-06-25 22:47:37 +09:00
Hajime Hoshi
9bff33472a driver: Add (Graphics).HasHighPrecisionFlaot
This enables to determine whether vertices should be adjusted or
not.

Fixes #879
2019-06-22 14:57:53 +09:00
Hajime Hoshi
cddb93b9f6 graphicscommand: Move the texel adjustment logic to graphicscommand package
This is a preparation for #879. The value of the texel adjustment
depends on the graphics driver (GLSL float precisions), and this
can be accessed only after the run loop runs. The place where
graphics commands are executed seems an appropriate place.

Updates #879
2019-06-22 03:52:51 +09:00
Hajime Hoshi
f3cdb0537b graphics: Move the vertices backend to ebiten package
Now restorable/sharable packages cannot use the same vertices
backend, but I think this won't affect the performance
significantly.
2019-06-22 00:02:22 +09:00
Hajime Hoshi
69ebc481e8 graphics: Refactoring: Unify PutVertex and PutQuadVertices implementation 2019-06-21 23:49:05 +09:00
Hajime Hoshi
008de78cec graphics: Refactoring: Change QuadVertices -> PutQuadVertices for consistency 2019-06-21 02:20:31 +09:00
Hajime Hoshi
ffb9871839 restorable: Bug fix: Skip the screen image to check invalidation 2019-05-28 11:29:34 +09:00
Hajime Hoshi
3ab56778e7 graphicscommand: Bug fix: restorable should be enabled if not sure
init function in restorable package might reach this condition,
and for fail-safe, restoring should be enabled.
2019-05-26 22:15:41 +09:00
Hajime Hoshi
83254d30d9 restorable: Bug fix: semantic inconsistency at forceRestoring 2019-05-26 21:40:10 +09:00
Hajime Hoshi
fcb5554aa1 driver: Add Graphics.NeedsRestoring 2019-05-26 19:46:12 +09:00
Hajime Hoshi
39395c4c76 graphicscommand: Rename draw-image -> draw-triangles 2019-05-08 11:58:17 +09:00
Hajime Hoshi
cce41e8152 graphics: Rename DrawImage -> DrawTriangles for consistency 2019-04-22 23:12:36 +09:00
Hajime Hoshi
a064955a13 graphicsdriver/metal: Use NSAutoreleasePool to release drawable correctly
Fixes #847
2019-04-20 15:20:38 +09:00
Hajime Hoshi
e6c0c73b9e graphicscommand: Add assertion (the screen cannot be a render source) 2019-04-13 00:22:11 +09:00
Hajime Hoshi
7445144194 Move graphicsdriver.GrapahicsDriver to driver.Graphics 2019-03-30 22:38:02 +09:00
Hajime Hoshi
747d1be54e driver: Move getting actual drivers to ebiten package 2019-03-30 22:19:21 +09:00
Hajime Hoshi
8ec7ae4c08 Rename drivers -> driver 2019-03-28 01:48:45 +09:00
Hajime Hoshi
5e38f81462 Create packages drivers having actual drivers 2019-03-25 00:29:56 +09:00
Hajime Hoshi
8e42484294 graphicscommand: Add 'address' to (*DrawImageCommand).String 2019-02-10 14:27:49 +09:00
Hajime Hoshi
a3eddeb50f Improve panic messages 2019-02-06 23:43:03 -10:00
Hajime Hoshi
d3d56c076d shareable: Use CopyPixels
CopyPixels is basically Pixels and ReplacePixels, but executed
lazily while Pixels reads pixels from GPU immediately. Thanks to
this, restorable.Image no longer need to keep pixel data if not
needed.
2019-02-03 02:51:56 +09:00
Hajime Hoshi
ce21125345 graphicscommand: Rename functions 2019-01-12 01:33:27 +09:00
Hajime Hoshi
dc0c6e0907 graphicscommand: Use GL on macOS 10.11 or older (#781) 2019-01-12 01:30:47 +09:00
mebusy
0419aec617 graphicscommand: Use Opengl instead on early MacOSX platform which does not support Metal (#779) 2019-01-11 22:34:23 +09:00
Hajime Hoshi
b34834a895 graphicscommand: Explicitly forbide ReplacePixels for a part after DrawImage 2019-01-06 05:15:27 +09:00
Hajime Hoshi
f1582c2d73 graphics: Add Address representing a sampler address mode
Fixes #761
2018-12-24 17:29:31 +09:00
Hajime Hoshi
bf67998fc5 graphicscommand: Bug fix: Do not assure the initial state of the image 2018-12-23 01:18:05 +09:00
Hajime Hoshi
ff62876552 Add Metal implementation
Fixes #621
2018-12-20 02:37:10 +09:00
Hajime Hoshi
9628e629ae graphicscommand: Fix tests to be more deterministic
Fixes #751
2018-12-17 21:46:53 +09:00
Hajime Hoshi
5d0420cea0 graphicscommand: Simplify Image
First I thought Metal requried an initialization process by
replacing pixels, but now this is not needed. Initialize images by
the dummy texture.
2018-12-16 22:36:03 +09:00
Hajime Hoshi
8b72ff5ec0 graphicscommand: Add tests 2018-12-16 17:38:02 +09:00
Hajime Hoshi
d29cabca43 graphicsdriver: Remove MaxImageSize 2018-12-15 03:46:32 +09:00
Hajime Hoshi
e537cb2c27 graphics: Bug fix: render source might not be initialized 2018-12-01 21:36:51 +01:00
Hajime Hoshi
c6dd0a75d9 graphicscommand: Optimize replace-image calls
Now ReplacePixels command is called only when necessary.

This also ensures that DrawImage must be called after ReplacePixels
is called since there is a potential problem that rendering images
on a texture without initializing by replacing pixels might cause
problems (escpecially on Metal. Perhaps #593 might be related).
2018-12-01 21:36:47 +01:00
Hajime Hoshi
b48d501bc0 graphics: Explicit limitation of indices at DrawTriangles
Fixes #728
2018-11-23 19:02:10 +09:00
Hajime Hoshi
e24f6b7848 graphicsdriver/opengl: Rename GetDriver -> Get 2018-11-13 00:01:26 +09:00
Hajime Hoshi
2313f79160 graphicsdriver: Rename Delete -> Dispose 2018-11-12 23:44:39 +09:00
Hajime Hoshi
cc2174bd69 graphicsdriver: Adjust API 2018-11-11 23:57:23 +09:00
Hajime Hoshi
907a28c434 graphicsdriver: Rename BufferSubData -> SetVertices 2018-11-11 23:54:58 +09:00
Hajime Hoshi
846a719d6c graphicsdriver: Merge UseProgram and DrawElements into Draw 2018-11-11 23:53:23 +09:00
Hajime Hoshi
575af7e416 graphicsdriver: Change indexOffsetInBytes -> indexOffset at DrawElements 2018-11-11 23:51:16 +09:00
Hajime Hoshi
2f692d98c7 graphicsdriver: Rename TexSubImage2D -> ReplacePixels 2018-11-11 01:35:10 +09:00
Hajime Hoshi
61ca48225c graphicsdriver: Rename MaxTextureSize -> MaxImageSize 2018-11-11 01:26:37 +09:00
Hajime Hoshi
241716d0e6 Add package graphicsdriver; Move opengl to graphicsdriver/opengl 2018-11-10 22:52:37 +09:00
Hajime Hoshi
09c8516545 graphcis: Move IndicesNum from opengl to graphics 2018-11-07 01:49:45 +09:00
Hajime Hoshi
07ae1db0dd opengl: Add Driver 2018-11-07 01:43:07 +09:00
Hajime Hoshi
ed961505d2 opengl: Refactoring: Hide projection matrix inside opengl package 2018-11-06 03:45:44 +09:00