diff options
| author | Ray <raysan5@gmail.com> | 2019-04-23 18:10:38 +0200 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2019-04-23 18:10:38 +0200 |
| commit | 0c567cd259285fb33b3e2ab514c48322da0a0000 (patch) | |
| tree | 40e15773092fd0180cd4f9ac35d94bf546a877a2 /src | |
| parent | 3aafa9d5ba3fa0a2cbb5759b569c8772a0385d41 (diff) | |
| download | raylib-0c567cd259285fb33b3e2ab514c48322da0a0000.tar.gz raylib-0c567cd259285fb33b3e2ab514c48322da0a0000.zip | |
WARNING: Issues on web building
Found some issues when building for web using latest emscripten 1.38.30, traced the error and found that eglGetProcAdress does not return function pointers for VAO functionality, supported by extension.
It requires more investigation but now it works (avoiding VAO usage)
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile | 2 | ||||
| -rw-r--r-- | src/core.c | 3 | ||||
| -rw-r--r-- | src/external/cgltf.h | 4 | ||||
| -rw-r--r-- | src/external/miniaudio.h | 2 | ||||
| -rw-r--r-- | src/rlgl.h | 12 |
5 files changed, 17 insertions, 6 deletions
diff --git a/src/Makefile b/src/Makefile index 997f041c..ea09aa9f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -42,7 +42,7 @@ .PHONY: all clean install uninstall # Define required raylib variables -RAYLIB_VERSION = 2.4.0 +RAYLIB_VERSION = 2.5.0 RAYLIB_API_VERSION = 2 # See below for alternatives. @@ -3172,7 +3172,8 @@ static void PollInputEvents(void) // NOTE: GLFW3 joystick functionality not available in web #if defined(PLATFORM_WEB) // Get number of gamepads connected - int numGamepads = emscripten_get_num_gamepads(); + int numGamepads = 0; + if (emscripten_sample_gamepad_data() == EMSCRIPTEN_RESULT_SUCCESS) numGamepads = emscripten_get_num_gamepads(); for (int i = 0; (i < numGamepads) && (i < MAX_GAMEPADS); i++) { diff --git a/src/external/cgltf.h b/src/external/cgltf.h index 4302e77b..85d5c985 100644 --- a/src/external/cgltf.h +++ b/src/external/cgltf.h @@ -369,7 +369,7 @@ typedef struct cgltf_light { cgltf_float spot_outer_cone_angle; } cgltf_light; -typedef struct cgltf_node { +struct cgltf_node { char* name; cgltf_node* parent; cgltf_node** children; @@ -388,7 +388,7 @@ typedef struct cgltf_node { cgltf_float rotation[4]; cgltf_float scale[3]; cgltf_float matrix[16]; -} cgltf_node; +}; typedef struct cgltf_scene { char* name; diff --git a/src/external/miniaudio.h b/src/external/miniaudio.h index a5646c71..dae605f2 100644 --- a/src/external/miniaudio.h +++ b/src/external/miniaudio.h @@ -21915,8 +21915,6 @@ extern "C" { #endif EMSCRIPTEN_KEEPALIVE void ma_device_process_pcm_frames_capture__webaudio(ma_device* pDevice, int frameCount, float* pFrames) { - ma_result result; - if (pDevice->type == ma_device_type_duplex) { ma_device__handle_duplex_callback_capture(pDevice, (ma_uint32)frameCount, pFrames, &pDevice->webaudio.duplexRB); } else { @@ -1559,7 +1559,19 @@ void rlglInit(int width, int height) glBindVertexArray = (PFNGLBINDVERTEXARRAYOESPROC)eglGetProcAddress("glBindVertexArrayOES"); glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSOESPROC)eglGetProcAddress("glDeleteVertexArraysOES"); //glIsVertexArray = (PFNGLISVERTEXARRAYOESPROC)eglGetProcAddress("glIsVertexArrayOES"); // NOTE: Fails in WebGL, omitted + + if (glGenVertexArrays == NULL) printf("glGenVertexArrays is NULL.\n"); // WEB: ISSUE FOUND! ...but why? + if (glBindVertexArray == NULL) printf("glBindVertexArray is NULL.\n"); // WEB: ISSUE FOUND! ...but why? } + + // TODO: HACK REVIEW! + // For some reason on raylib 2.5, VAO usage breaks the build + // error seems related to function pointers but I can not get detailed info... + // Avoiding VAO usage is the only solution for now... :( + // Ref: https://emscripten.org/docs/porting/guidelines/function_pointer_issues.html + #if defined(PLATFORM_WEB) + vaoSupported = false; + #endif // Check NPOT textures support // NOTE: Only check on OpenGL ES, OpenGL 3.3 has NPOT textures full support as core feature |
