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

Atlas First Draft #358

Closed
wants to merge 1 commit into from
Closed

Atlas First Draft #358

wants to merge 1 commit into from

Conversation

LevoDeLellis
Copy link

It's not complete but there's enough to start using it. I'm not happy with the name 'TTF_DestroyAtlas' and I'll need to improve the header documentation. I'm not sure what to do with the example. Using the hashmap in C++ looks nice but it appears no C++ examples are allowed? The C code is close enough. I'd want to improve both.

Another thing I plan on implementing is a way to reserve a series of rectangles so I can draw into them before creating a texture. IIRC GL supports a texture with 8bit alpha channel (GL_Alpha8 and GL_R8 for pixel shaders). Is it possible to use an alpha texture? Right now I use SDL_PIXELFORMAT_ARGB8888 and I only set the alpha bits (0x00FFFFFF | ((Uint32)*src << 24);)

If I can get feedback I'll adjust it while implementing the reserve rectangle code and upload a second draft. I'm not expecting this to be merged

@LevoDeLellis
Copy link
Author

LevoDeLellis commented May 10, 2024

I don't have a windows machine. It should be easy enough to replace #ifdef WIN32 with SDL_PLATFORM_WINDOWS. I'm not sure why MSVC doesn't like my macro for variable length array

@slouken slouken marked this pull request as draft May 10, 2024 23:12
@slouken
Copy link
Collaborator

slouken commented May 10, 2024

This code compiles with C89, which doesn't have variable length arrays. I haven't looked at the context, but usually those should be SDL_malloc() or SDL_small_alloc(), which falls back to SDL_malloc if the variable size is too big.

@LevoDeLellis
Copy link
Author

I have more inspiration. I'll send a new pull request tonight.

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

Successfully merging this pull request may close these issues.

None yet

2 participants