MCPcopy Create free account
hub / github.com/KaisenAmin/c_std / plot_set_title

Function plot_set_title

plot/plot.c:950–967  ·  view source on GitHub ↗

* @brief Replace the plot title; passing NULL clears it to "". * * Deep-copies @p title into the plot, then frees the previous title * string. Passing NULL stores the empty string "" (which renders as * a blank title bar) rather than leaving the field NULL — so the * renderer can always safely dereference @c plot->title. * * Ownership semantics: the caller may free its copy of @p title * i

Source from the content-addressed store, hash-verified

948 }
949
950 /* Reuse a window that is already open (closing it would tear down the
951 caller's context); otherwise open a hidden one just for the export. */
952 bool ownWindow = !IsWindowReady();
953 if (ownWindow) {
954 SetTraceLogLevel(LOG_NONE);
955 SetConfigFlags(FLAG_WINDOW_HIDDEN);
956 InitWindow(plot->width, plot->height, "Plot Export");
957 if (!IsWindowReady()) {
958 /* no display / GL context: the GL calls below would crash */
959 SetTraceLogLevel(LOG_INFO);
960 PLOT_LOG("[plot_export_image]: InitWindow failed -> false");
961 return false;
962 }
963 }
964
965 RenderTexture2D target = LoadRenderTexture(plot->width, plot->height);
966 if (target.id == 0) {
967 if (ownWindow) {
968 CloseWindow();
969 SetTraceLogLevel(LOG_INFO);
970 }

Callers

nothing calls this directly

Calls 1

p_strdupFunction · 0.85

Tested by

no test coverage detected