diff --git a/lib/renderer/src/renderer/ResourceStorage.h b/lib/renderer/src/renderer/ResourceStorage.h index 09a5642c..906d2741 100644 --- a/lib/renderer/src/renderer/ResourceStorage.h +++ b/lib/renderer/src/renderer/ResourceStorage.h @@ -69,7 +69,8 @@ namespace renderer { iterator it = _storage.find(rid); if(it == _storage.end()){ - throw ResourceDoesNotExistsException (rid); + printf("Resource does not exists %d\n", rid); + abort(); } return it; } diff --git a/lib/renderer/src/renderer/compositor/gles3/GLES3Compositor.cpp b/lib/renderer/src/renderer/compositor/gles3/GLES3Compositor.cpp index 0c383d30..ff10d628 100644 --- a/lib/renderer/src/renderer/compositor/gles3/GLES3Compositor.cpp +++ b/lib/renderer/src/renderer/compositor/gles3/GLES3Compositor.cpp @@ -183,10 +183,12 @@ void GLES3Compositor::texture_render(Texture texture, const renderer::Rect& src_ glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, t->name()); +#ifndef EMSCRIPTEN GLuint gl_error = glGetError(); if(gl_error != 0){ std::cout << "glBindTexture error: " << gl_error << std::endl; } +#endif _texture_shader->use(); _vertex_array->bind(); @@ -352,5 +354,6 @@ void GLES3Compositor::set_logical_screen_size(int32_t width, int32_t height) void GLES3Compositor::read_pixels(uint8_t*) { // TODO: - throw CompositorException("GLES3Compositor::read_pixels is not implemented"); + printf("GLES3Compositor::read_pixels is not implemented\n"); + abort(); } diff --git a/lib/renderer/src/renderer/compositor/gles3/GLES3Texture.cpp b/lib/renderer/src/renderer/compositor/gles3/GLES3Texture.cpp index 7124ba7a..bc2e2176 100644 --- a/lib/renderer/src/renderer/compositor/gles3/GLES3Texture.cpp +++ b/lib/renderer/src/renderer/compositor/gles3/GLES3Texture.cpp @@ -20,10 +20,13 @@ GLES3Texture::GLES3Texture(int32_t width, int32_t height, TextureType texture_ty glGenTextures(1, &_name); glBindTexture(GL_TEXTURE_2D, _name); +#ifndef EMSCRIPTEN gl_error = glGetError(); if(gl_error != 0){ - throw CompositorException(std::string("glBindTexture error: ") + std::to_string(gl_error)); + printf("%s\n", (std::string("glBindTexture error: ") + std::to_string(gl_error)).c_str()); + abort(); } +#endif glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); @@ -39,17 +42,22 @@ GLES3Texture::GLES3Texture(int32_t width, int32_t height, TextureType texture_ty format = GL_RGBA; type = GL_UNSIGNED_BYTE; break; - default: - throw CompositorException(std::string("Unknown TextureType: ") + std::to_string((int)_texture_type)); + default: { + printf("%s\n", (std::string("Unknown TextureType: ") + std::to_string((int) _texture_type)).c_str()); + abort(); + } } glTexImage2D(GL_TEXTURE_2D, 0, internalformat, width, height, 0, format, type, pixels); +#ifndef EMSCRIPTEN gl_error = glGetError(); if(gl_error != 0){ - throw CompositorException(std::string("glTexImage2D error: ") + std::to_string(gl_error)); + printf("%s\n", ((std::string("glTexImage2D error: ") + std::to_string(gl_error)).c_str())); + abort(); } +#endif glGenerateMipmap(GL_TEXTURE_2D); } diff --git a/lib/renderer/src/renderer/compositor/gles3/Shader.cpp b/lib/renderer/src/renderer/compositor/gles3/Shader.cpp index 8a54f75d..c4664d19 100644 --- a/lib/renderer/src/renderer/compositor/gles3/Shader.cpp +++ b/lib/renderer/src/renderer/compositor/gles3/Shader.cpp @@ -23,7 +23,8 @@ void Shader::initialize(const char* vs_shader, const char* fs_shader) if(!success){ char infoLog[1024]; glGetShaderInfoLog(vertex_shader, 1024, nullptr, infoLog); - throw CompositorException(std::string("Vertex shader compilation error: " + std::string(infoLog))); + printf("%s\n", (std::string("Vertex shader compilation error: " + std::string(infoLog))).c_str()); + abort(); } } @@ -36,7 +37,8 @@ void Shader::initialize(const char* vs_shader, const char* fs_shader) if(!success){ char infoLog[1024]; glGetShaderInfoLog(fragment_shader, 1024, nullptr, infoLog); - throw CompositorException(std::string("Fragment shader compilation error: " + std::string(infoLog))); + printf("%s\n", (std::string("Fragment shader compilation error: " + std::string(infoLog))).c_str()); + abort(); } } @@ -49,7 +51,9 @@ void Shader::initialize(const char* vs_shader, const char* fs_shader) glGetProgramiv(_program, GL_LINK_STATUS, &success); if(!success){ char infoLog[1024]; - throw CompositorException(std::string("Program link error: " + std::string(infoLog))); + glGetShaderInfoLog(fragment_shader, 1024, nullptr, infoLog); + printf("%s\n", (std::string("Program link error: " + std::string(infoLog))).c_str()); + abort(); } } glDeleteShader(vertex_shader); @@ -59,7 +63,8 @@ void Shader::initialize(const char* vs_shader, const char* fs_shader) void Shader::use() { if(_program == 0){ - throw CompositorException("shader is not initialized"); + printf("shader is not initialized\n"); + abort(); } glUseProgram(_program); } @@ -72,7 +77,8 @@ void Shader::unuse() void Shader::set_uniform(const char* name, int value) { if(_program == 0){ - throw CompositorException("shader is not initialized"); + printf("shader is not initialized\n"); + abort(); } glUniform1i(glGetUniformLocation(_program, name), value); @@ -81,7 +87,8 @@ void Shader::set_uniform(const char* name, int value) void Shader::set_uniform(const char* name, float value[4]) { if(_program == 0){ - throw CompositorException("shader is not initialized"); + printf("shader is not initialized\n"); + abort(); } glUniform4f(glGetUniformLocation(_program, name), value[0], value[1], value[2], value[3]); @@ -90,7 +97,8 @@ void Shader::set_uniform(const char* name, float value[4]) void Shader::set_uniform_mat(const char* name, float value[]) { if(_program == 0){ - throw CompositorException("shader is not initialized"); + printf("shader is not initialized\n"); + abort(); } glUniformMatrix4fv(glGetUniformLocation(_program, name), 1, false, value); diff --git a/lib/renderer/src/renderer/visualbackend/rust/RustVisualBackend.cpp b/lib/renderer/src/renderer/visualbackend/rust/RustVisualBackend.cpp index baa9af72..f52492de 100644 --- a/lib/renderer/src/renderer/visualbackend/rust/RustVisualBackend.cpp +++ b/lib/renderer/src/renderer/visualbackend/rust/RustVisualBackend.cpp @@ -16,9 +16,12 @@ RustVisualBackend::RustVisualBackend(int32_t width, int32_t height) { std::cout << "RustVisualBackend::RustVisualBackend" << std::endl; +#ifndef EMSCRIPTEN if(rv_api_1 != 1){ - throw RendererException("Invalid libvangers_ffi version"); + printf("Invalid librusty_vangers version expected 1, actual %d\n", rv_api_1); + abort(); } +#endif rv_init_descriptor desc { .width = (uint32_t) width, diff --git a/lib/renderer/src/renderer/visualbackend/rust/vange_rs.h b/lib/renderer/src/renderer/visualbackend/rust/vange_rs.h index 94aefeff..6f135b51 100644 --- a/lib/renderer/src/renderer/visualbackend/rust/vange_rs.h +++ b/lib/renderer/src/renderer/visualbackend/rust/vange_rs.h @@ -71,7 +71,9 @@ typedef void* rv_context; #ifdef __cplusplus extern "C" { #endif +#ifndef EMSCRIPTEN extern int32_t rv_api_1; +#endif rv_context rv_init(rv_init_descriptor desc); diff --git a/lib/xgraph/xgraph.cpp b/lib/xgraph/xgraph.cpp index 5fc93329..d4ab250e 100644 --- a/lib/xgraph/xgraph.cpp +++ b/lib/xgraph/xgraph.cpp @@ -132,7 +132,7 @@ int XGR_Screen::init(int x,int y,int flags_in) std::cout<<"XGR_Screen::init"<