diff --git a/demos/.gitignore b/demos/.gitignore index 7ccfc2f..30c9e9c 100644 --- a/demos/.gitignore +++ b/demos/.gitignore @@ -11,4 +11,5 @@ !external/**/*.d !.gitignore !compile_wasm.py -!cimgui.bc \ No newline at end of file +!cimgui.bc +.dub \ No newline at end of file diff --git a/demos/assets/shaders/base.vp b/demos/assets/shaders/base.vp index 50fc27e..42ed4a7 100644 --- a/demos/assets/shaders/base.vp +++ b/demos/assets/shaders/base.vp @@ -25,9 +25,9 @@ precision lowp samplerCube; #endif #else #if __VERSION__ > 320 - layout(location = 0) uniform vec4 matrix_1; - layout(location = 1) uniform vec4 matrix_2; - layout(location = 2) uniform vec4 uv_transform; + uniform vec4 matrix_1; + uniform vec4 matrix_2; + uniform vec4 uv_transform; layout(location = 0) in vec2 positions; layout(location = 1) in vec2 tex_coords; diff --git a/demos/compile_wasm.py b/demos/compile_wasm.py index 06845cf..9e3f46a 100644 --- a/demos/compile_wasm.py +++ b/demos/compile_wasm.py @@ -24,11 +24,11 @@ def compile(sources, output): for f in files: ldc_cmd += f + ' ' - print ldc_cmd + print(ldc_cmd) if os.system(ldc_cmd): exit(0) - print + print() shared_flags = '' @@ -74,7 +74,7 @@ for arg in sys.argv[1:]: elif(arg == '-pthread'): shared_flags += '-O3 ' ldc_flags += '-release -enable-inlining ' - emc_flags += '-s PTHREAD_POOL_SIZE=16 -Wl,--no-check-features -s USE_PTHREADS=1 ' + emc_flags += '-s PTHREAD_POOL_SIZE=16 -s USE_PTHREADS=1 ' elif(arg == '--demo=simple'): demo = 0 else: @@ -101,6 +101,6 @@ emcc_cmd += 'cimgui.bc ' emcc_cmd += 'mmutils.bc ' emcc_cmd += 'demo.bc ' -print emcc_cmd +print(emcc_cmd) os.system(emcc_cmd) diff --git a/demos/dub.json b/demos/dub.json index 009bf9e..43d248c 100644 --- a/demos/dub.json +++ b/demos/dub.json @@ -16,6 +16,8 @@ "source" ], "libs-windows-x86_64": ["libs/windows/x64/SDL2","libs/windows/x64/SDL2_Image","libs/windows/x64/cimgui"], + "libs-linux-x86_64": ["cimgui","SDL2","SDL2_image"], + "lflags-linux-x86_64": ["-rpath=libs/linux/x64/","-Llibs/linux/x64/"], "configurations" : [ { "name" : "default", diff --git a/demos/libs/linux/x64/libcimgui.so b/demos/libs/linux/x64/libcimgui.so new file mode 100755 index 0000000..9c2a0bc Binary files /dev/null and b/demos/libs/linux/x64/libcimgui.so differ diff --git a/demos/utils/source/ecs_utils/gfx/shader.d b/demos/utils/source/ecs_utils/gfx/shader.d index f7cd21a..7749013 100644 --- a/demos/utils/source/ecs_utils/gfx/shader.d +++ b/demos/utils/source/ecs_utils/gfx/shader.d @@ -67,7 +67,7 @@ struct Shader } version(WebAssembly)const char* glsl = "#version 100\n"; - else const char* glsl = "#version 450\n"; + else const char* glsl = "#version 330\n"; const char* buffer = data.code.ptr; char* ver; version(WebAssembly)ver = cast(char*)"#define ver1 1\n#define GLES\n".ptr; @@ -136,6 +136,11 @@ struct Shader if(compile == GL_FALSE) { SDL_Log("Shader compile error! %u %s",data.type,glsl); + char[256] log; + int log_len; + glGetShaderInfoLog(data.gl_handle, 256, &log_len, log.ptr); + import ecs_utils.utils; + if(log_len)printf("%s",log.ptr); return false; }