Skip to content

Conversation

sleeptightAnsiC
Copy link
Contributor

This is quite big, so maybe lets treat it more like a DRAFT than PR. I can either split it to smaller PR's or change few things. However, have in mind it may take some time. The rl_gputex.h is pretty hard to change. Currently, almost everything in it depends on headers that come from Raylib (rtextures.c and raylib.h). This PR tries to fix and document most of those problems, but it's not everything by any means. This should at least fix all the problems mentioned in #5039 Every little change should be documented in the commit message.

commit message with full change list

  • make sure that src/external/rl_gputex.h uses it's own macros for printing warnings and allocating memory
  • add few additional macros in order to decouple rl_gputex from headers that are being included by Raylib (e.g. *_MEMSET, *_NULL and so on)
  • make sure that rl_gputex uses RL_*ALLOC, TRACELOG and RLAPI macros when (and only when) being included by src/rtextures.c
  • replace LOG() and RL_GPUTEX_SHOW_LOG_INFO macros with: RL_GPUTEX_WARN and RL_GPUTEX_SHOW_WARN_INFO (this is a breaking change, but it was broken and unusable anyway, see: [rcore] LogLevel none don't stop dds warning from appearing ! #5039 (comment) )
  • fixes issue all issues mentioned in: [rcore] LogLevel none don't stop dds warning from appearing ! #5039 (comment)
  • remove logging upon successfully saving a file; Raylib does this anyway and we want rl_gputex to only print WARNings upon failures; see: https://discord.com/channels/426912293134270465/541710686468702250/1394406734306480352
  • add additional condition when saving a file; now checks for both fwrite() and fclose() failures; before it would warn about both, but only return result based on fclose()
  • add some notes about the current state of compiling rl_gputex without depending on Raylib (spoiler: it's still broken...)
  • bump rl_gputex version to 1.1 since this is a potential breaking change (only for people attempting to use it without Raylib)

Fixes: #5039
Reference: https://discord.com/channels/426912293134270465/541710686468702250/1394403611852931255

- make sure that src/external/rl_gputex.h uses it's own macros
    for printing warnings and allocating memory
- add few additional macros in order to decouple rl_gputex from headers
    that are being included by Raylib (e.g. *_MEMSET, *_NULL and so on)
- make sure that rl_gputex uses RL_*ALLOC, TRACELOG and RLAPI macros
    when (and only when) being included by src/rtextures.c
- replace LOG() and RL_GPUTEX_SHOW_LOG_INFO macros with: RL_GPUTEX_WARN
    and RL_GPUTEX_SHOW_WARN_INFO (this is a breaking change, but it was
    broken and unusable anyway, see:
    raysan5#5039 (comment) )
- fixes issue all issues mentioned in:
    raysan5#5039 (comment)
- remove logging upon successfully saving a file; Raylib does this
    anyway and we want rl_gputex to only print WARNings upon failures;
    see: https://discord.com/channels/426912293134270465/541710686468702250/1394406734306480352
- add additional condition when saving a file; now checks for both
    fwrite() and fclose() failures; before it would warn about both,
    but only return result based on fclose()
- add some notes about the current state of compiling rl_gputex
    without depending on Raylib (spoiler: it's still broken...)
- bump rl_gputex version to 1.1 since this is a potential breaking
    change (only for people attempting to use it without Raylib)

Fixes: raysan5#5039
Reference: https://discord.com/channels/426912293134270465/541710686468702250/1394403611852931255
@raysan5
Copy link
Owner

raysan5 commented Jul 15, 2025

@sleeptightAnsiC thanks for the review, definitely there is more than I expected... I need to review it carefully

@raysan5 raysan5 merged commit 94d8d71 into raysan5:master Jul 26, 2025
15 checks passed
@raysan5
Copy link
Owner

raysan5 commented Jul 26, 2025

@sleeptightAnsiC thanks for the review! merging and reviewing any missing bits!

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.

[rcore] LogLevel none don't stop dds warning from appearing !
2 participants