TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Hot Reload Gameplay Code

11 点作者 dsego6 个月前

2 条评论

flysand76 个月前
&gt; The answer is that the Raylib DLL is implicitly pulled in by game.dll, but unloading game.dll does not unload the implicitly pulled in Raylib DLL<p>Was about to comment on this one, this only applies on Windows. So far as my experimentation with Hot Reloading with Odin on Linux went though, on linux that would work differently. It seemed as though there was some kind of reference counter on shared objects, so if your main exe didn&#x27;t use raylib, it would also get yeeted when you unload the game and all of the state would reset.<p>So if you really want to make this work on both windows and linux, you&#x27;d insert<p><pre><code> @require import &quot;vendor:raylib&quot; _ :: raylib </code></pre> In the main program and iirc you don&#x27;t have to do anything else. Actually it was like a year ago the last time I did this, I don&#x27;t remember what the issue was haha. Pretty sure I ran into a bug with GLFW thread locals but yea. no idea.
chrisjj6 个月前
&gt; This can be fixed by only using global variables that are pointers to fields within GameMemory. When a hot reload occurs and game_hot_reloaded is run, you can then reassign those global pointers to the correct memory inside the GameMemory struct.<p>This being manual sounds like a recipe for bugs. Can it not be automated?