feat: player hud and text renderer - #39
Closed
OmarGamal10 wants to merge 8 commits into
Closed
Conversation
… bitmap font rendering, doesn't affect normal textures
…on of drawn text, and refactor HUD code
…ever systems that use it
OmarGamal10
force-pushed
the
feat/player-hud
branch
from
April 19, 2026 01:07
d0fe73b to
e7bf3ff
Compare
Comment on lines
+88
to
+92
| glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof(Vertex), vertices.data(), GL_DYNAMIC_DRAW); | ||
|
|
||
| glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO); | ||
| glBufferData(GL_ELEMENT_ARRAY_BUFFER, elements.size() * sizeof(unsigned int), elements.data(), | ||
| GL_DYNAMIC_DRAW); |
Owner
There was a problem hiding this comment.
this reallocates the buffer each call
consider using BufferSubData
if (newSize <= currentCapacity) {
glBufferSubData(...);
}
else {
glBufferData(...); // reallocate
currentCapacity = newSize;
}| if (!data.is_object()) return; | ||
| maxHealth = data.value("maxHealth", maxHealth); | ||
| currentHealth = data.contains("currentHealth") ? data["currentHealth"].get<float>() : maxHealth; | ||
| currentHealth = data.value("currentHealth", currentHealth); |
Owner
There was a problem hiding this comment.
why this change in this pr ?
Collaborator
Author
There was a problem hiding this comment.
I forgot to change it back, same reason as below
| public: | ||
| float maxHealth = 100.0f; | ||
| float currentHealth = 100.0f; | ||
| float currentHealth = 75.0f; |
Collaborator
Author
There was a problem hiding this comment.
mb, I had it less than 100 to show the reviewer how health looks when it's not full
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PLEASE DON'T PANIC, THE JSON FILE FOR THE FONT IS ABOUT 4300 LINES, SO THE PR IS ONLY ABOUT 500 LINES.
Limitations
assetLoaderand just get the reference from there. I didn't want to touch the asset loader now because of feat: model loader #28