-
Notifications
You must be signed in to change notification settings - Fork 131
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
Implemented font atlas support for the renderer text engine #386
Merged
Conversation
This file contains 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
|
Trivial build fix for sort callback: diff --git a/src/SDL_renderer_textengine.c b/src/SDL_renderer_textengine.c
--- a/src/SDL_renderer_textengine.c
+++ b/src/SDL_renderer_textengine.c
@@ -86,5 +86,5 @@ typedef struct TTF_RendererTextEngineData
-static int SDLCALL SortMissing(const void *userdata, const void *a, const void *b)
+static int SDLCALL SortMissing(void *userdata, const void *a, const void *b)
{
const TTF_DrawOperation *ops = (const TTF_DrawOperation *)userdata; Didn't touch stb header. (Its permissions need changing to 0644, btw...) |
Fixed! |
About stb_rect_pack.h: There is this open PR at mainstream you might want to include. |
You may also want to do this: diff --git a/src/SDL_renderer_textengine.c b/src/SDL_renderer_textengine.c
index 9b707e4..4aa1093 100644
--- a/src/SDL_renderer_textengine.c
+++ b/src/SDL_renderer_textengine.c
@@ -29,4 +29,5 @@
#define STBRP_SORT SDL_qsort
#define STBRP_ASSERT SDL_assert
+#define STBRP__CDECL SDLCALL
#include "stb_rect_pack.h"
diff --git a/src/stb_rect_pack.h b/src/stb_rect_pack.h
index 6a633ce..099b132 100644
--- a/src/stb_rect_pack.h
+++ b/src/stb_rect_pack.h
@@ -216,9 +216,14 @@ struct stbrp_context
#ifdef _MSC_VER
#define STBRP__NOTUSED(v) (void)(v)
-#define STBRP__CDECL __cdecl
#else
#define STBRP__NOTUSED(v) (void)sizeof(v)
+#endif
+#ifndef STBRP__CDECL
+#ifdef _MSC_VER
+#define STBRP__CDECL __cdecl
+#else
#define STBRP__CDECL
#endif
+#endif /* STBRP__CDECL */
enum |
Good call, I'll pull them in shortly. |
This turns most text drawing into a single draw call.
This will also potentially allow us to change the triangle winding order if it becomes important.
This was written by Joshua Simmons <[email protected]> nothings/stb#1299
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.
This turns most text drawing into a single draw call.