Skip to content

How to use raywasm? #12

Description

@konsumer

So, I downloaded the mac asset from last successful action workflow, and compiled this:

#include "raylib.h"

int main(void) {
  const int screenWidth = 800;
  const int screenHeight = 450;

  InitWindow(screenWidth, screenHeight, "raylib [textures] example - texture loading and drawing");
  Texture2D texture = LoadTexture("raylib_logo.png");

  while (!WindowShouldClose()) {
    BeginDrawing();
    ClearBackground(RAYWHITE);
    DrawTexture(texture, screenWidth / 2 - texture.width / 2, screenHeight / 2 - texture.height / 2, WHITE);
    DrawText("this IS a texture!", 360, 370, 10, GRAY);
    EndDrawing();
  }

  UnloadTexture(texture);
  CloseWindow();
  return 0;
}

with ./emraylib textures_logo_raylib.c -o textures_logo_raylib then ran ./raywasm textures_logo_raylib.wasm, and it opens and closes, without error. Do I need to structure my code differently?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions