Commit Graph

69 Commits

Author SHA1 Message Date
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
Hajime Hoshi
97ddef0047 ui: Protect defaultGame's memers with mutex 2019-12-16 01:44:55 +09:00
Hajime Hoshi
46a7ae6175 ui: Define and use defaultGame
This is a pareparation for Game interface and RunGame.

Updates #943
2019-12-16 01:21:16 +09:00
Hajime Hoshi
12a13892cd ui: Protect uiContext.scaleForWindow by mutex 2019-12-15 20:15:13 +09:00
Hajime Hoshi
bda11b0e17 driver: Add UI.SetWindowSize and UIContext.Layout
This is a preparation to introduce RunGame function.

Updates # 943 (Fix this line before committing)
2019-12-15 02:29:43 +09:00
Hajime Hoshi
8e9f5b9535 driver: Remove Suspend/ResumeAudio from UIContext 2019-12-08 16:17:02 +09:00
Hajime Hoshi
42056c2d61 restorable: Refactoring: Remove Clear
Fill now fills the whole texture.
2019-12-02 03:03:07 +09:00
Hajime Hoshi
69c781a03d ui: Refactoring 2019-11-25 02:26:12 +09:00
Hajime Hoshi
79b32c7601 graphics: Add buffered package
Moved the command queue to the package.
2019-09-21 22:34:37 +09:00