subsoap / defos

Extra native OS functions for games written using the Defold game engine
Creative Commons Zero v1.0 Universal
112 stars 16 forks source link

Setting initial view size causes error `Could not find '@render' socket` #130

Closed unindented closed 11 months ago

unindented commented 11 months ago

If I add these lines to game.project (as described here in the README):

[defos]
view_width = 960
view_height = 540

The following error message gets printed on launch:

ERROR:ENGINE: Could not find '@render' socket.
britzl commented 11 months ago

On which OS is this happening?

unindented commented 11 months ago

@britzl sorry, forgot to include detailed info. This is on macOS, using Defold 1.5.0. Here's a recording, starting from a desktop template project:

https://github.com/subsoap/defos/assets/69485/2f026f68-4b44-4f8c-b52a-7eb2dfb66b05

AGulev commented 11 months ago

@unindented it happens because when we change window size we are trying to send event to render script that window size has changed. But there is no render_script exist at this point. So we can't send this message.

So this error just says "ok, I can't notify render_script" about window size change which isn't critical at all because at the moment when render_script will be created it will be able to use the new updated window size

I can fix it by moving window size change to the first update, but then window will be created with one size for a frame and changed to another right after that. It looks ugly tbh. I would suggest keeping it as is

unindented commented 11 months ago

@unindented it happens because when we change window size we are trying to send event to render script that window size has changed. But there is no render_script exist at this point. So we can't send this message.

So this error just says "ok, I can't notify render_script" about window size change which isn't critical at all because at the moment when render_script will be created it will be able to use the new updated window size

I can fix it by moving window size change to the first update, but then window will be created with one size for a frame and changed to another right after that. It looks ugly tbh. I would suggest keeping it as is

Nah, sounds good to leave as-is. I just needed that extra reassurance that nothing horrible is gonna happen down the line. Maybe worth adding a note in the README when talking about [defos] in game.project?