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

Replace std::string #84

Open
jnthbdn opened this issue Aug 8, 2023 · 1 comment
Open

Replace std::string #84

jnthbdn opened this issue Aug 8, 2023 · 1 comment

Comments

@jnthbdn
Copy link
Contributor

jnthbdn commented Aug 8, 2023

Dans le frameBuffer, la fonction drawText utilise une std::string ce qui demande une allocation de mémoire pour recopier le text, il faudrait au mieux mettre const std::string& ou même cont char* pour ne plus avoir d'allocation (dans le cas où l'on fait ssd.drawText("Hello World", ...))

void drawText(std::string str, unsigned x, unsigned y, uint16_t color);

@jnthbdn
Copy link
Contributor Author

jnthbdn commented Jan 18, 2024

De manière général faire la "chasse" au constructeur par recopie... Dans le même fichier :

void drawMatrix(std::vector<std::vector<uint16_t>> matrix, unsigned x, unsigned y);

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

No branches or pull requests

1 participant