Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f22635d20b | ||
|
|
01678c0f0e | ||
|
|
2f22157375 | ||
|
|
ea801d0d7b |
+1
-1
@@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(reaktor VERSION 0.5.0 LANGUAGES C CXX)
|
||||
project(reaktor VERSION 0.5.1 LANGUAGES C CXX)
|
||||
|
||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
set(_reaktor_top ON)
|
||||
|
||||
+12
-1
@@ -176,10 +176,21 @@ img_lookup(App *app, const char *src, int px)
|
||||
w = plutovg_surface_get_width(surf);
|
||||
h = plutovg_surface_get_height(surf);
|
||||
stride = plutovg_surface_get_stride(surf);
|
||||
reaktor_unpremultiply(plutovg_surface_get_data(surf), w, h, stride);
|
||||
|
||||
sdlsurf = SDL_CreateSurfaceFrom(w, h, SDL_PIXELFORMAT_ARGB8888,
|
||||
plutovg_surface_get_data(surf), stride);
|
||||
while (sdlsurf && (w >= 2 * px || h >= 2 * px) && w > 1 && h > 1) {
|
||||
SDL_Surface *half = SDL_ScaleSurface(sdlsurf, w / 2, h / 2,
|
||||
SDL_SCALEMODE_LINEAR);
|
||||
|
||||
SDL_DestroySurface(sdlsurf);
|
||||
sdlsurf = half;
|
||||
w /= 2;
|
||||
h /= 2;
|
||||
}
|
||||
if (sdlsurf)
|
||||
reaktor_unpremultiply((unsigned char *)sdlsurf->pixels, w, h,
|
||||
sdlsurf->pitch);
|
||||
tex = sdlsurf ? SDL_CreateTextureFromSurface(app->ren, sdlsurf) : NULL;
|
||||
if (sdlsurf) SDL_DestroySurface(sdlsurf);
|
||||
plutovg_surface_destroy(surf);
|
||||
|
||||
@@ -72,7 +72,7 @@ errors, so an internal function cannot slip back in.
|
||||
| `reaktor_lang_pref(app)` | The language `--lang` asked for, or `NULL` |
|
||||
| `reaktor_set_borderless(app, on)`, `reaktor_borderless(app)` | Switch the main window's frame off for a titlebar of your own, drawn with `.window.hit_test` |
|
||||
| `reaktor_set_visible(app, on)` | Show or hide that App's window; with `.window.hidden`, the main window waits for it |
|
||||
| `reaktor_version()` | Reaktor's version, such as `"0.5.0"` |
|
||||
| `reaktor_version()` | Reaktor's version, such as `"0.5.1"` |
|
||||
|
||||
The `set` calls are for the main thread, take effect at the next frame, and do
|
||||
nothing when nothing changes.
|
||||
|
||||
Reference in New Issue
Block a user