Skip to content

Code refactor: Refactor engine API#477

Merged
nighca merged 1 commit intogoplus:devfrom
JiepengTan:pr_code_refactor
Dec 11, 2024
Merged

Code refactor: Refactor engine API#477
nighca merged 1 commit intogoplus:devfrom
JiepengTan:pr_code_refactor

Conversation

@JiepengTan
Copy link
Copy Markdown
Contributor

  1. Clarify main thread and non-main thread functions.
  2. Split the engine wrap code into an independent namespace.
  3. Delete useless functions.
  4. Use vectors to implement some algorithms.

@JiepengTan JiepengTan requested a review from nighca December 10, 2024 12:47
Comment thread game.go
Comment thread internal/engine/sprite.go

type ProxySprite struct {
Sprite
// !!!Warning all method belong to this class can only be called in main thread
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: To ensure developers always remember this when manipulating Sprite, we may use a specific prefix or suffix for related methods, such as UpdateTexture_MustFromMainThread. While it may look ugly, it could be beneficial. 🤣

@nighca nighca merged commit 767e2f7 into goplus:dev Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants