Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: refactor spinner using raylib #33738

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deanlee
Copy link
Contributor

@deanlee deanlee commented Oct 7, 2024

  1. Add selfdrive/ui/raylib/util.cc for Helper Functions: Introduced a new raylib/util.cc file containing utility functions to manage common tasks such as font handling, application initialization, and other reusable operations.
  2. refactor spinner using raylib:
    Screenshot from 2024-10-07 02-23-09
    Screenshot from 2024-10-07 02-22-38

Copy link
Contributor

github-actions bot commented Oct 7, 2024

UI Preview

All Screenshots

@deanlee deanlee force-pushed the raylib_spinner branch 4 times, most recently from 00dba45 to c8fdc0c Compare October 7, 2024 20:14
Copy link
Contributor

@adeebshihadeh adeebshihadeh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

It's even a (slight) red diff, even with setting up all the new raylib infrastructure.

Comment on lines +59 to +60
Vector2 textSize = MeasureTextEx(getFont(), userInput.c_str(), kFontSize, 1.0);
DrawTextEx(getFont(), userInput.c_str(), {center.x - textSize.x / 2, yPos}, kFontSize, 1.0, WHITE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make a helper for this?

}
}

EndDrawing();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raylib handles the FPS here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, raylib hand FPS and poll input events in EndDrawing().

@deanlee
Copy link
Contributor Author

deanlee commented Oct 9, 2024

@adeebshihadeh: Raylib failed to initialize GLFW on the C3X:

INFO: Initializing raylib 5.5-dev
INFO: Platform backend: DESKTOP (GLFW)
INFO: Supported raylib modules:
INFO:     > rcore:..... loaded (mandatory)
INFO:     > rlgl:...... loaded (mandatory)
INFO:     > rshapes:... loaded (optional)
INFO:     > rtextures:. loaded (optional)
INFO:     > rtext:..... loaded (optional)
INFO:     > rmodels:... loaded (optional)
INFO:     > raudio:.... loaded (optional)
WARNING: GLFW: Error: 65544 Description: Wayland: Failed to load libwayland-client entry point
WARNING: GLFW: Failed to initialize GLFW

The error occurs because two functions, wl_proxy_get_tag and wl_proxy_set_tag, are missing from the /lib/aarch64-linux-gnu/libwayland-client.so :

https://github.com/raysan5/raylib/blob/3fb1ba25aca0a6b023ca254a0910df36b0744e64/src/external/glfw/src/wl_init.c#L605-L626

To resolve this issue, we need to update Wayland on the device to the correct version and ensure raylib is compiled with the appropriate build options ( https://github.com/raysan5/raylib/blob/3fb1ba25aca0a6b023ca254a0910df36b0744e64/CMakeOptions.txt)

@adeebshihadeh
Copy link
Contributor

Unfortunately, we can't easily update our Weston. Can we just patch those out in raylib?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants