Closed SavostinVladimir closed 7 years ago
Could you please post the complete Go stack trace when the error occurs ?
this is my stack if glfw.CreateStandardCursor
get type int
:
GOROOT=C:/go
GOPATH=C:/GoProjects
C:/go\bin\go.exe build -i -o "C:\Users\ASUS\AppData\Local\Temp\Build main.go and rungo" C:/GoProjects/src/github.com/g3n/demos/gopher3d/main.go
# github.com/g3n/engine/window
..\..\engine\window\glfw.go:159: cannot use int(glfw.ArrowCursor) (type int) as type glfw.StandardCursor in argument to glfw.CreateStandardCursor
..\..\engine\window\glfw.go:160: cannot use int(glfw.IBeamCursor) (type int) as type glfw.StandardCursor in argument to glfw.CreateStandardCursor
..\..\engine\window\glfw.go:161: cannot use int(glfw.CrosshairCursor) (type int) as type glfw.StandardCursor in argument to glfw.CreateStandardCursor
..\..\engine\window\glfw.go:162: cannot use int(glfw.HandCursor) (type int) as type glfw.StandardCursor in argument to glfw.CreateStandardCursor
..\..\engine\window\glfw.go:163: cannot use int(glfw.HResizeCursor) (type int) as type glfw.StandardCursor in argument to glfw.CreateStandardCursor
..\..\engine\window\glfw.go:164: cannot use int(glfw.VResizeCursor) (type int) as type glfw.StandardCursor in argument to glfw.CreateStandardCursor
But if I change the glfw.go myself in the following way(remove int
):
w.arrowCursor = glfw.CreateStandardCursor(glfw.ArrowCursor)
w.ibeamCursor = glfw.CreateStandardCursor(glfw.IBeamCursor)
w.crosshairCursor = glfw.CreateStandardCursor(glfw.CrosshairCursor)
w.handCursor = glfw.CreateStandardCursor(glfw.HandCursor)
w.hresizeCursor = glfw.CreateStandardCursor(glfw.HResizeCursor)
w.vresizeCursor = glfw.CreateStandardCursor(glfw.VResizeCursor)
I get this stack in run-mode:
GOROOT=C:/go
GOPATH=C:/GoProjects
C:/go\bin\go.exe build -i -o "C:\Users\ASUS\AppData\Local\Temp\Build main.go and rungo" C:/GoProjects/src/github.com/g3n/demos/gopher3d/main.go
"C:\Program Files (x86)\JetBrains\Gogland 171.3780.106\bin\runnerw.exe" "C:\Users\ASUS\AppData\Local\Temp\Build main.go and rungo"
and after I close window "Gopher3D" it ends with exit code 0
Process finished with exit code 0
and in debug-mode I have:
GOROOT=C:/go
GOPATH=C:/GoProjects
C:/go\bin\go.exe build -i -o "C:\Users\ASUS\AppData\Local\Temp\Build main.go and rungo" -gcflags "-N -l" "-ldflags=-linkmode internal" C:/GoProjects/src/github.com/g3n/demos/gopher3d/main.go
# command-line-arguments
github.com/go-gl/glfw/v3.2/glfw(.text): relocation target strdup not defined
github.com/go-gl/glfw/v3.2/glfw(.text): relocation target strdup not defined
github.com/go-gl/glfw/v3.2/glfw(.text): relocation target strdup not defined
github.com/go-gl/glfw/v3.2/glfw(.text): relocation target strdup not defined
github.com/go-gl/glfw/v3.2/glfw(.text): undefined: "strdup"
github.com/go-gl/glfw/v3.2/glfw(.text): undefined: "strdup"
github.com/go-gl/glfw/v3.2/glfw(.text): undefined: "strdup"
github.com/go-gl/glfw/v3.2/glfw(.text): undefined: "strdup"
Hi, there was a recent modification of the glfw API which removed the necessity to cast the standard cursor type to int. The g3n engine repository was updated right now to fix this. After this change we were able to build the demos and run them OK.
Update your packages and try again, it seems you are getting a linker error.
>go get -u github.com/go-gl/glfw/v3.2/glfw
>go get -u github.com/g3n/engine/...
Hello! I looked your commit. I did same thing, but its not enough. So I folowed your advice and updated my packages... You may see my screen during implementation: It still does not render((
And this is same example, during debug:
may be it helps... This is my stack, when I run your "G3N demo" demo-programm:
"C:\Program Files (x86)\JetBrains\Gogland 171.3780.106\bin\runnerw.exe" C:/go\bin\go.exe run C:/GoProjects/src/github.com/g3n/g3nd/main.go
09:34:08.691806:I:G3ND:G3N Demo v0.1 starting
09:34:08.691806:I:G3ND:Using data directory:data
09:34:09.317842:I:G3ND:OpenGL version: 3.3.11159 Core Profile Context
09:34:09.318842:W:G3ND:Error trying to load OpenAL library
09:34:10.145889:F:G3ND:Render error: Error compiling Vertex Shader: Vertex shader was successfully compiled to run on hardware.
01:
02:#version 330 core
03:
04:// Vertex attributes
05:
06:// Vertex attributes
07:layout(location = 0) in vec3 VertexPosition;
08:layout(location = 1) in vec3 VertexNormal;
09:layout(location = 2) in vec3 VertexColor;
10:layout(location = 3) in vec2 VertexTexcoord;
11:layout(location = 4) in float VertexDistance;
12:layout(location = 5) in vec4 VertexTexoffsets;
13:
14:
15:// Input uniforms
16:uniform mat4 ModelMatrix;
17:
18:// Outputs for fragment shader
19:out vec2 FragTexcoord;
20:
21:
22:void main() {
23:
24: // Always flip texture coordinates
25: vec2 texcoord = VertexTexcoord;
26: texcoord.y = 1 - texcoord.y;
27: FragTexcoord = texcoord;
28:
29: // Set position
30: vec4 pos = vec4(VertexPosition.xyz, 1);
31: gl_Position = ModelMatrix * pos;
32:}
33:
panic: LOG FATAL
goroutine 1 [running, locked to thread]:
github.com/g3n/engine/util/logger.(*Logger).Log(0xc04214eee0, 0x4, 0x73c6b6, 0x11, 0xc042029d98, 0x1, 0x1)
C:/GoProjects/src/github.com/g3n/engine/util/logger/logger.go:253 +0x89b
github.com/g3n/engine/util/logger.(*Logger).Fatal(0xc04214eee0, 0x73c6b6, 0x11, 0xc042029d98, 0x1, 0x1)
C:/GoProjects/src/github.com/g3n/engine/util/logger/logger.go:194 +0x6d
main.main()
C:/GoProjects/src/github.com/g3n/g3nd/main.go:256 +0xc38
exit status 2
Process finished with exit code 1
It is very strange. The log shows that an error occurred while compiling the vertex shader, but the error message says it was compiled OK.
Hi, I just tried to update my drivers, you can look at it: System says that the relevant driver is already installed. I use the windows 7, Service Pack 1, 64 bit What about other 3D applications, I find it dificult to check this. This area of knowledge is new for me, sorry. But I run some 3D games on my computer, I think some of them use the OpenGL... Thank you for your attention. May be this information will help to understand what's wrong
It seems your drivers are OK.
Try to eliminate a check we do when we compile the shaders:
In file: github.com/g3n/engine/gls/program.go
, comment lines 503,504 and 505
503 //if len(slog) > 2 {
504 // return shader, fmt.Errorf("%s", slog)
505 //}
Then build g3nd
and try again.
Great! It works! I remain it, but will this not cause errors in future projects? But now there is other problems in your demo program "g3nd"...
I will try to read other issues and solve it myself. If I will failure, it will be the topic of a new issue. Thank you very much! I appreciate your help!
OK, a new commit was sent which logs the shader compiler log instead of returning an error. Please open a new issue for other problems.
I use windows 64. Downloaded the engine from the gitnab and try to run the examples, such as "HelloG3n" or "gopher3d". But only new window appears and shows nothing. Nothing exept the background color. After I close the window programm ends with exit-code:0.
I do not understand what's the matter! Please,I need your help!
additionaly, the first time it got error, that it don't may use type int as argument of glfw.CreateStandartCursor in "glfw.go". This fragment introduced below: // Preallocate standard cursors w.arrowCursor = glfw.CreateStandardCursor(int(glfw.ArrowCursor)) w.ibeamCursor = glfw.CreateStandardCursor(int(glfw.IBeamCursor)) w.crosshairCursor = glfw.CreateStandardCursor(int(glfw.CrosshairCursor)) w.handCursor = glfw.CreateStandardCursor(int(glfw.HandCursor)) w.hresizeCursor = glfw.CreateStandardCursor(int(glfw.HResizeCursor)) w.vresizeCursor = glfw.CreateStandardCursor(int(glfw.VResizeCursor)) After this I remove all int from showed strings. But I don't think that it's reason...