Commit Graph

77 Commits

Author SHA1 Message Date
Hajime Hoshi
19702619ee ebiten: Bug fix: AdjustPosition could return Inf
Before the initialization finishes, AdjustPosition could return Inf
values and in this case AdjustPosition's returning values don't make
sense. Let's return NaN in this case.

Closes #1545
2021-03-27 18:46:14 +09:00
Hajime Hoshi
c3ddc2089a ebiten: Update comments 2021-03-01 12:07:55 +09:00
Hajime Hoshi
7dda2d8e4b ebiten: Do not skip Draw when vsync is disabled
Closes #1520
2021-03-01 12:06:14 +09:00
Hajime Hoshi
0b30ed5959 Revert "ebiten: Skip calling Draw when the update count is 0"
This reverts commit 4d545b9ad8.

Reason: Restricting calls of Draw was counter-intuitive for users.
See the discussion at #1486
2021-02-09 23:32:30 +09:00
Hajime Hoshi
a0a8d41ff6 uidriver/js: Force to update the screen when resizing
Updates #1204
2021-01-18 01:17:58 +09:00
Hajime Hoshi
ce24640da8 ebiten: Ensure that Layout is called before Update in the first frame 2020-12-20 21:10:47 +09:00
Hajime Hoshi
4d545b9ad8 ebiten: Skip calling Draw when the update count is 0 2020-11-27 00:20:27 +09:00
Hajime Hoshi
e7fafb5527 ebiten: Add a new log to dump update count
Fixes #1425
2020-11-24 22:36:32 +09:00
Hajime Hoshi
1d82aec712 ebiten: Fix comments 2020-10-17 17:30:52 +09:00
Hajime Hoshi
1864c22ad6 uidriver/glfw: Reduce (*thread).Call at (*Input).update 2020-10-17 05:22:23 +09:00
Hajime Hoshi
d49d8db15d ebiten: Refactoring: Remove scaleForWindow 2020-10-15 02:29:04 +09:00
Hajime Hoshi
0aa98d3113 ebiten: Refactoring: Reduce calls of updateOffscreen 2020-10-15 02:26:31 +09:00
Hajime Hoshi
770661c609 driver: Refactoring: Remove (UIContext).Draw 2020-10-15 01:27:50 +09:00
Hajime Hoshi
c6053bcf14 ebiten: Remove the error returning value from NewImage
Updates #1380
2020-10-06 00:48:56 +09:00
Hajime Hoshi
54da0d9763 ebiten: Remove the returning value from (*Image).DrawImage
Updates #1380
2020-10-06 00:21:17 +09:00
Hajime Hoshi
525d16bec8 ebiten: Remove the returning value from (*Image).Dispose
Updates #1380
2020-10-06 00:13:23 +09:00
Hajime Hoshi
fe97e7b0a5 ebiten: Remove the filter argument from NewImage and NewImageFromImage
Updates #503
2020-10-05 01:40:44 +09:00
Hajime Hoshi
8f00c8fbf5 ebiten: Remove the argument from Update
Fixes #1260
2020-10-04 19:33:10 +09:00
Hajime Hoshi
81f336ac46 ebiten: Remove IsDrawingSkipped
Fixes #1127
2020-10-04 17:21:44 +09:00
Hajime Hoshi
ec6e4a16ce ebiten: Bug fix: Clear the offscreen every frame 2020-10-04 17:16:26 +09:00
Hajime Hoshi
ad07e31727 ebiten: Add Draw function to Game interface
Fixes #1368
2020-10-04 17:13:51 +09:00
Hajime Hoshi
bf515bb594 Update version to v2.0.0-alpha 2020-10-04 04:30:40 +09:00
Tom Lister
65d5b64d29
ebiten: Rename SetClearingScreenSkipped/IsClearingScreenSkipped functions (#1317)
Fixes #1315
2020-08-20 17:12:22 +09:00
Hajime Hoshi
7ec63acd1d ebiten: Bug fix: Set the state of being volatile on SetClearingScreenSkipped
Fixes #1309
2020-08-19 01:23:30 +09:00
Hajime Hoshi
8aef1f9080 restorable: Enable to set the 'volatile' state later
Updates #1309
2020-08-19 00:57:23 +09:00
Tom Lister
e96a1fb1c7
ebiten: Implement SetClearingScreenSkipped/IsClearingScreenSkipped (#1302)
Fixes #1132
2020-08-13 18:19:56 +09:00
Hajime Hoshi
f7f507e912 ebiten: Ensure that Update is called at least once before Draw in the first frame
Fixes #1155
2020-05-15 04:04:29 +09:00
Hajime Hoshi
697835a313 ebiten: Remove a redundant comment 2020-05-08 18:37:58 +09:00
Hajime Hoshi
8029dc352a driver: Use framebuffer's Y directions 2020-05-08 16:49:19 +09:00
Hajime Hoshi
8777140e91 driver: Simplify UIContext.Update 2020-04-03 00:18:27 +09:00
Hajime Hoshi
a4f6909710 ui: Add comments 2020-04-01 03:38:32 +09:00
Hajime Hoshi
4976460af3 ui: Refactoring 2020-04-01 03:02:32 +09:00
Hajime Hoshi
a718ddbf7e driver: Add UIDriver.Draw
This is a preparation for XNA.

Updates #1078
2020-04-01 02:55:50 +09:00
Hajime Hoshi
35eb9e77a0 ui: Improve comments about Game interface
This change also fixes comments in uiConttext, which seems pretty
old.
2020-03-31 02:04:27 +09:00
Hajime Hoshi
237498e51f
ui: Add an optional function Draw function to Game interface (#1107)
This change adds an optional function Draw to the Game interface.
With Draw function, the game logic and rendering are separate.
There are some benefits:

  * The API is clearer and easier to understand.
  * When TPS < FPS, smoother rendering can be performed without
    changing the game logic depending on TPS.
  * Porting to XNA, which has separate functions Update and Draw,
    would be a little easier.

Draw is optional due to backward compatibility. Game interface was
already used before v1.11.x in mobile packages, and adding a
function would break existing code unfortunately. Then, we adopted
switching the behavior based on whether Draw is implemented or not
by type assertions.

IsDrawingSkipped will always return false when Draw is implemented.

Fixes #1104
2020-03-24 12:01:37 +09:00
Hajime Hoshi
c927d33457 mobile/ebitenmobileview: Use the common uiContext for layouting
This means that the whole offscreen is cleared correctly.

This change is a little breaking change: SetScreenSize or other
functions no longer works on ebitenmobile. Use Layout instead.

Fixes #1019
2020-02-11 19:40:47 +09:00
Hajime Hoshi
024fc48647 Refactoring: Add init.go 2020-02-11 11:14:19 +09:00
Hajime Hoshi
b3bdf51905
graphicscommand: Return the error immediately (#1060)
Now grpahicscommand saves the error and shows the error after a
while. This was good to simplify the API but was the cause to hide
some issues.

This change fixes all the errors to be returned immediately, and
buffer this in the ebiten package instead.

Fixes #971
2020-01-19 01:18:56 +09:00
Hajime Hoshi
4c8137ccf5 mipmap: Bug fix: Use more negative mipmaps when float precision is low
Fixes #1044
2020-01-08 02:06:36 +09:00
Hajime Hoshi
982b7d6ddc driver: Let UI have Graphics
Now UIs own the implementation of Graphics.

Updates #1026
2020-01-03 18:32:27 +09:00
Hajime Hoshi
662a22461d run: Bug fix: The screen can be nil in the initial state
Fixes #1039
2019-12-29 23:14:59 +09:00
Hajime Hoshi
9ed8279fc8 driver: Add interface Window 2019-12-25 00:24:21 +09:00
Hajime Hoshi
1d9c00688c ui: Panic if Layout returns non-positive numbers 2019-12-23 04:43:04 +09:00
Hajime Hoshi
049aa552d4 ui: Add SetWindowResizable
This change also fixes example/windowsize.

Fixes #320
2019-12-22 19:26:04 +09:00
Hajime Hoshi
812a29bf07 ui: Refactoring: theUIContext is always non-nil 2019-12-22 18:53:23 +09:00
Hajime Hoshi
7d56e4335e ui: Add RunGame, WindowSize and SetWindowSize
This change introduces the new APIs RunGame, WindowSize and
SetWindowSize. These new APIs hides the notion of 'scale', and is
more flexible with the outside size change. This means that we can
introduce a resizable window.

This change also adds -legacy flag to examples/windowsize. If the
flag is off, the new APIs are used.

This change deprecates these functions since the notion of 'scale'
is deprecated:

  * ScreenScale
  * ScreenSizeInFullscreen
  * SetScreenScale
  * SetScreenSize

Fixes #943, #571
Updates #320
2019-12-22 03:35:31 +09:00
Hajime Hoshi
f3712a7e62 ui: Add comments about scaleForWindow 2019-12-20 03:59:32 +09:00
Hajime Hoshi
ba0279ebe3 ui: Bug fix: Stop the loop of window-size recalculation 2019-12-20 01:56:27 +09:00
Hajime Hoshi
6a8013ed37 ui: Reduce arguments from newUIContext 2019-12-16 11:12:38 +09:00
Hajime Hoshi
664cf62a29 ui: Reduce members from uiContext 2019-12-16 02:10:58 +09:00