Hello everyone, I'm making a game engine in Go and I have a question about exposing the API.

This API is what allows developers to define the behaviors of their game and/or software. Despite being far into the development, I was never been able to figure out how to expose the API in a good way and I'm stuck on whether to expose an interface or struct.

I tried both approaches and they have their own pros and cons. So, I wanted to ask for your opinion on which approach is the most "Go" for these kinds of problems.

I have the following behaviors: - Load/OnSpawn : When the game is started. - Unload/OnDespawn : When the game engine swap contexs. - Destroy/OnDispose : When the game is terminated. - Draw : A call for each fr...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help