Running web assembly not working for C and Raylib - FATAL: Failed to initialize Graphic Device

121 views Asked by At

I have a small raylib game that compiles and runs fine locally. I made the web version of raylib, downloaded and installed emcc and it compiled file.

Here is the relevant part of my make file

CWEB =-Wall -std=c99 -Wno-missing-braces -O3 -s USE_GLFW=3 -s FORCE_FILESYSTEM=1 -s ASYNCIFY  -I. -I$(HOME)/git/raylib/src -I$(HOME)/git/raylib/src/external -L. -L$(HOME)/git/raylib/src -L$(HOME)/git/raylib/src $(HOME)/git/raylib/src/web/libraylib.a -DPLATFORM_WEB 

web: src_files/main.c src_files/config.h
    emcc src_files/main.c -o quick_maths.html $(CWEB) -lm

It will compile fine, but if I spin up a quick python web server and run quick_maths.html I get the error WARNING: GLFW: Failed to initialize Window FATAL: Failed to initialize Graphic Device

enter image description here

Any help will be much appreciated.

I have tried installing glfw stand alone, re-compiling raylib,

Placing this is my zprofile and sourcing before re-compiling source "/home/sherlly/git/emsdk/emsdk_env.sh" export LIBGL_ALWAYS_INDIRECT=0 export DISPLAY=:0

0

There are 0 answers