Skip to content

Commit

Permalink
raylib on device (commaai#34126)
Browse files Browse the repository at this point in the history
* setup

* tp

* more

* device
  • Loading branch information
maxime-desroches authored Nov 28, 2024
1 parent 4226ef5 commit ce948f7
Show file tree
Hide file tree
Showing 9 changed files with 1,569 additions and 358 deletions.
2 changes: 1 addition & 1 deletion system/ui/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mac_frameworks = []
if arch == "Darwin":
mac_frameworks += ['OpenCL', 'CoreVideo', 'Cocoa', 'GLUT', 'CoreFoundation', 'OpenGL', 'IOKit']
elif arch == 'larch64':
linked_libs += []
linked_libs += ['GLESv2', 'GL', 'EGL', 'wayland-client', 'wayland-egl']
else:
linked_libs += ['OpenCL', 'dl', 'pthread']

Expand Down
4 changes: 2 additions & 2 deletions system/ui/raylib/spinner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ int main(int argc, char *argv[]) {
std::cin.sync_with_stdio(false);
std::cin.tie(nullptr);

Texture2D commaTexture = LoadTextureResized("../../assets/img_spinner_comma.png", kTextureSize);
Texture2D spinnerTexture = LoadTextureResized("../../assets/img_spinner_track.png", kTextureSize);
Texture2D commaTexture = LoadTextureResized("../../selfdrive/assets/img_spinner_comma.png", kTextureSize);
Texture2D spinnerTexture = LoadTextureResized("../../selfdrive/assets/img_spinner_track.png", kTextureSize);

float rotation = 0.0f;
std::string userInput;
Expand Down
4 changes: 1 addition & 3 deletions system/ui/raylib/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ struct FontManager {
FontManager() {
for (int i = 0; i < fonts.size(); ++i) {
fonts[i] = LoadFontEx(FONT_FILE_PATHS[i], 120, nullptr, 250);
SetTextureFilter(fonts[i].texture, TEXTURE_FILTER_TRILINEAR);
}
}

Expand All @@ -43,14 +42,13 @@ Texture2D LoadTextureResized(const char *fileName, int size) {
Image img = LoadImage(fileName);
ImageResize(&img, size, size);
Texture2D texture = LoadTextureFromImage(img);
SetTextureFilter(texture, TEXTURE_FILTER_TRILINEAR);
return texture;
}

void initApp(const char *title, int fps) {
Hardware::set_display_power(true);
Hardware::set_brightness(65);
// SetTraceLogLevel(LOG_NONE);
InitWindow(0, 0, title);
InitWindow(2160, 1080, title);
SetTargetFPS(fps);
}
270 changes: 158 additions & 112 deletions third_party/raylib/include/raylib.h

Large diffs are not rendered by default.

Loading

0 comments on commit ce948f7

Please sign in to comment.