Skip to content

[rlgl] glVertexAttribPointer() error client-side with WebGL 2.0 (OpenGL ES 3.0) #4330

@tomlikesnakes

Description

@tomlikesnakes

Hello,

There is an error when targetting webgl2 and using whatever Draw function you want (like DrawRectangle/cube/text etc)

index.js:7373 Uncaught TypeError: Cannot set properties of undefined (setting 'clientside')
    at _glVertexAttribPointer

I did a very minimal example here :

#include <raylib.h>
#include <emscripten.h>

const int screenWidth = 800;
const int screenHeight = 450;

void draw(void) {
    BeginDrawing();

    ClearBackground(RAYWHITE);

    DrawRectangle(200, 150, 400, 200, RED);

    DrawText("Hello, WebAssembly with Raylib!", 210, 200, 20, BLACK);

    EndDrawing();
}

int main() {
    InitWindow(screenWidth, screenHeight, "raylib with Emscripten - Simple Draw");

    SetTargetFPS(60);

    emscripten_set_main_loop(draw, 0, 1);

    CloseWindow();

    return 0;
}


compilation flag :

emcc -o index.html testthatfail.c -I/home/tom/raylib-wasm/src     
-L/home/tom/raylib-wasm/src -lraylib -DPLATFORM_WEB     -s USE_GLFW=3 -s FULL_ES3=1 -s MIN_WEBGL_
VERSION=2 -s MAX_WEBGL_VERSION=2 -s ASYNCIFY

I tried with only full_es2, with different things for memory and so.

For this kind of things it is not really problematic but for my other project I need to create vertex buffer and go with opengl (not rlgl) and use shaders for a cube, and i need the webgl2/opengl300es for my futures things on the project

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions