-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
hot code reload with graphics not working on Windows 10 #3054
Copy link
Copy link
Closed
Labels
BugThis tag is applied to issues which reports bugs.This tag is applied to issues which reports bugs.OS: WindowsBugs/feature requests, that are specific to Windows OS.Bugs/feature requests, that are specific to Windows OS.Status: ConfirmedThis bug has been confirmed to be valid by a contributor.This bug has been confirmed to be valid by a contributor.Unit: CompilerBugs/feature requests, that are related to the V compiler in general.Bugs/feature requests, that are related to the V compiler in general.
Metadata
Metadata
Assignees
Labels
BugThis tag is applied to issues which reports bugs.This tag is applied to issues which reports bugs.OS: WindowsBugs/feature requests, that are specific to Windows OS.Bugs/feature requests, that are specific to Windows OS.Status: ConfirmedThis bug has been confirmed to be valid by a contributor.This bug has been confirmed to be valid by a contributor.Unit: CompilerBugs/feature requests, that are related to the V compiler in general.Bugs/feature requests, that are related to the V compiler in general.
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_wndmust be initializedwarning: bounce.v:68:2: reference field
Game*.draw_fnmust be initializedwarning: bounce.v:86:2: reference field
gg.Cfg.window_user_ptrmust be initializedwarning: bounce.v:33:6: the following imports were never used:
warning: E:\Vlang\The_Way_to_V\Chapter_12_Advanced_Topics\hot_reload\bounce.v:68:2: reference field
Game*.main_wndmust be initializedwarning: E:\Vlang\The_Way_to_V\Chapter_12_Advanced_Topics\hot_reload\bounce.v:68:2: reference field
Game*.draw_fnmust be initializedwarning: E:\Vlang\The_Way_to_V\Chapter_12_Advanced_Topics\hot_reload\bounce.v:86:2: reference field
gg.Cfg.window_user_ptrmust be initializedcompiling 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.