Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hot code reload with graphics not working on Windows 10 #3054

Open
Ivo-Balbaert opened this issue Dec 11, 2019 · 2 comments
Open

hot code reload with graphics not working on Windows 10 #3054

Ivo-Balbaert opened this issue Dec 11, 2019 · 2 comments
Assignees
Labels
Bug This tag is applied to issues which reports bugs. OS: Windows Bugs/feature requests, that are specific to Windows OS. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general.
Projects

Comments

@Ivo-Balbaert
Copy link
Contributor

V version: 0.1.23 3486118
OS: Windows 10

What did you do?
v -live bounce.v
Compiles ok (with warnings)
then: bounce

What did you expect to see?
A bouncing ball in a graphical window. Change source rgb to change color of ball in realtime.

What did you see instead?
The window with title appears for some seconds, then disappears. No bouncing ball.
Same phenomenon with graph.v example.

Both examples work flawlessly on Ubuntu.
The hot code reloading works on Windows with the example message.v
Cause here seems some kind of wrong interaction between graphics and hot code reloading on Windows.

If the compilation is done with v bounce.v, then bounce shows the bouncing ball (and the warning below about import gx never used does NOT appear, only first 3 warnings)!

Here are the warnings of the compilation with v - live bounce.v:
warning: bounce.v:68:2: reference field Game*.main_wnd must be initialized
warning: bounce.v:68:2: reference field Game*.draw_fn must be initialized
warning: bounce.v:86:2: reference field gg.Cfg.window_user_ptr must be initialized
warning: bounce.v:33:6: the following imports were never used:

  • gx
    warning: E:\Vlang\The_Way_to_V\Chapter_12_Advanced_Topics\hot_reload\bounce.v:68:2: reference field Game*.main_wnd must be initialized
    warning: E:\Vlang\The_Way_to_V\Chapter_12_Advanced_Topics\hot_reload\bounce.v:68:2: reference field Game*.draw_fn must be initialized
    warning: E:\Vlang\The_Way_to_V\Chapter_12_Advanced_Topics\hot_reload\bounce.v:86:2: reference field gg.Cfg.window_user_ptr must be initialized
    compiling shared library took 3343 ms
    =========

This is what appears in the command window with bounce started:
create window wnd=00000000037A90A0 ptr==0000000000DFEC70
#version 330 core
layout (location = 0) in vec4 vertex; // <vec2 pos, vec2 tex>
out vec2 TexCoords;

uniform mat4 projection;

void main()
{
gl_Position = projection * vec4(vertex.xy, 0.0, 1.0);
TexCoords = vertex.zw;
}
Starting the game loop...

Windows pops up for +- 5 s, then crashes.

@Ivo-Balbaert Ivo-Balbaert added the Bug This tag is applied to issues which reports bugs. label Dec 11, 2019
@emily33901
Copy link
Member

Yeah this is a known issue - Due to the way linking works on windows you would have to call gladInit() on every hot reload, which is possible, but allowing libraries some triggers for it would complicate things.

Not sure when this is going to be "fixed".

@Ivo-Balbaert
Copy link
Contributor Author

Thanks for the explanation Emily!

@M4SSD35TRUCT10N M4SSD35TRUCT10N added this to Issues, bugs, features and similar in V 0.2 Apr 5, 2020
@M4SSD35TRUCT10N M4SSD35TRUCT10N added this to the Beta Release milestone Apr 5, 2020
@M4SSD35TRUCT10N M4SSD35TRUCT10N added Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. labels Apr 5, 2020
@ArtemkaKun ArtemkaKun added the OS: Windows Bugs/feature requests, that are specific to Windows OS. label May 26, 2023
@ArtemkaKun ArtemkaKun removed this from the Beta Release milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. OS: Windows Bugs/feature requests, that are specific to Windows OS. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general.
Projects
No open projects
V 0.2
  
Issues, bugs, features and similar
Development

No branches or pull requests

5 participants