treeform / fidget

Figma based UI library for nim, with HTML and OpenGL backends.
MIT License
766 stars 31 forks source link

[Windows] Failed to open window. #29

Closed Dev1lroot closed 4 years ago

Dev1lroot commented 4 years ago
nim c -r minimal.nim
minimal.exe
Failed to open window.
skervista commented 4 years ago

OpenGL 3?

Dev1lroot commented 4 years ago

4.0

UNIcodeX commented 4 years ago

I'm also getting a Failed to open GLFW window. after copying a working example for hovers to another windows machine and attempting to run over remote desktop. Placing the downloaded GLFW windows 64 bit libraries in the same directory as the demo executable, does not remedy the issue. I'm sure I'm missing something that may be otherwise obvious to you.

treeform commented 4 years ago

GLFW needs openGL to run. Maybe the problem with openGL drivers or some thing like that?

Please list your os and openGL names and versions.

Dev1lroot commented 4 years ago

Windows 10 1903 x64 , OpenGL 4.0 by NVIDIA DRIVER 342.01

UNIcodeX commented 4 years ago

Would this work for OpenGL apps over RDP perhaps? https://fdossena.com/?p=mesa/index.frag

treeform commented 4 years ago

I never tried openGL apps over RDP. I doubt it works over RDP as RDP is based on low level windows draw commands.

UNIcodeX commented 4 years ago

I got another Nim GUI demo to run over RDP with that Mesa library. I don't remember which it was at the moment though. LOL

On Wed, Apr 1, 2020, 6:18 PM treeform notifications@github.com wrote:

I never tried openGL apps over RDP. I doubt it works over RDP as RDP is based on low level windows draw commands.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/treeform/fidget/issues/29#issuecomment-607536160, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB62P6STQXUWJGFRIN2CZBTRKPDWBANCNFSM4LQZ3XZA .

UNIcodeX commented 4 years ago

I think it was rdgui. Haven't really looked at the internals but the Mesa library in the same folder as the executable worked with it.

retsyo commented 4 years ago

I met the same problem in msys2+mingw64 on my windows 7 64 bits

however, the https://github.com/treeform/staticglfw/blob/master/examples/basic.nim can be compiled and run without any problem

mchome commented 4 years ago

Setting openglVersion = (3, 3) in startFidget fix my problem because default value is (4, 1).

retsyo commented 4 years ago

I used openglVersion = (4, 0), then

1. on win7 64 bits

I got

Hint: R:\fidget\examples\minimal\minimal.exe  [Exec]
3.4.0 Win32 WGL EGL OSMesa MinGW
GL_VERSION:4.0.0 - Build 9.17.10.2963
GL_SHADING_LANGUAGE_VERSION:4.00 - Build 9.17.10.2963
Vertex shader compilation failed:
R:\fidget\examples\minimal\minimal.nim(14) minimal
C:\Users\USER\.nimble\pkgs\fidget-0.3.2\fidget\openglbackend.nim(316) startFidget
C:\Users\USER\.nimble\pkgs\fidget-0.3.2\fidget\openglbackend.nim(297) runFidget
C:\Users\USER\.nimble\pkgs\fidget-0.3.2\fidget\openglbackend.nim(259) setupFidget
C:\Users\USER\.nimble\pkgs\fidget-0.3.2\fidget\opengl\context.nim(101) newContext
C:\Users\USER\.nimble\pkgs\fidget-0.3.2\fidget\opengl\shaders.nim(223) newShader
C:\Users\USER\.nimble\pkgs\fidget-0.3.2\fidget\opengl\shaders.nim(101) compileShaderFiles
E:\msys64\home\USER\_nim\nim\lib\core\macros.nim(557) getErrorLog
E:\msys64\home\USER\_nim\nim\lib\system.nim(2451) []
E:\msys64\home\USER\_nim\nim\lib\system\fatal.nim(49) sysFatal
Error: unhandled exception: value out of range: -2 notin 0 .. 9223372036854775807 [RangeDefect]
Error: execution of an external program failed: 'R:\fidget\examples\minimal\minimal.exe '

2. I found that minimal.exe runs on win 10 64 bits and says

3.4.0 Win32 WGL EGL OSMesa MinGW
GL_VERSION:4.0.0 NVIDIA 431.07
GL_SHADING_LANGUAGE_VERSION:4.00 NVIDIA via Cg compiler
retsyo commented 4 years ago

further more, no matter I use openglVersion = (4, 0) in startFidget or not, the produced EXE file can run on my win 10 64 bits

treeform commented 4 years ago

@mchome, @retsyo I think the problem here is that I requires openGL 4. But your systems only support OpenGL 3. I need to make OpenGL 3 compatible shaders.

treeform commented 4 years ago

Hey I tagged a new release (0.4.2) that is known to fix some linux bugs. Please give it a try.

treeform commented 4 years ago

I believe this has been fixed.

Here is the packages you need for GUI development (and run tests) on Ubuntu:

sudo apt install -y  build-essential libalut-dev libasound2-dev libc6-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev mesa-utils pkg-config xorg-dev xvfb
retsyo commented 4 years ago

@treeform nothing changed on my win7 64 bits. latest nim and fidget

$ nim
Nim Compiler Version 1.3.5 [Windows: amd64]
Compiled at 2020-07-16

and

$ nimble path fidget
C:\Users\USER\.nimble\pkgs\fidget-0.4.2

when I try to compile and run

nim c -r minimal.nim
...
CC: minimal.nim
Hint:  [Link]
Hint: 183413 lines; 27.437s; 226.516MiB peakmem; Debug build; proj: R:\fidget-master\examples\minimal\minimal.nim; out: R:\fidget-master\examples\minimal\minimal.exe [SuccessX]
Hint: R:\fidget-master\examples\minimal\minimal.exe  [Exec]
Failed to open window.
Error: execution of an external program failed: 'R:\fidget-master\examples\minimal\minimal.exe '