nimraylib_now icon indicating copy to clipboard operation
nimraylib_now copied to clipboard

Black Window with `WINDOW_TRANSPARENT`

Open qb-0 opened this issue 2 years ago • 1 comments

Heya,

I don't get a transparent framebuffer with the window state. Not sure if it's a issue on my end, a issue with raylib itself or with the wrapper.

echo isWindowState(WINDOW_TRANSPARENT) returns false

import nimraylib_now

const screenWidth = 1000
const screenHeight = 1000

setWindowState(WINDOW_TRANSPARENT)
initWindow screenWidth, screenHeight, "Window"

while not windowShouldClose():
    drawLine 500, 0, 500, getScreenHeight(), fade(LIGHTGRAY, 0.6)
    echo isWindowState(WINDOW_TRANSPARENT)
    clearBackground Blank
    endDrawing()
closeWindow()

Bildschirmfoto vom 2022-06-04 07-09-07

qb-0 avatar Jun 04 '22 05:06 qb-0

You can use core_window_flags example as a reference https://github.com/greenfork/nimraylib_now/blob/3207f457be0f3204df15a1367111159d3c888c4c/examples/core/core_window_flags.nim#L37

adding or WindowTransparent to the list activates transparency. For me it is also black screen.

You can check the C version as well https://github.com/raysan5/raylib/blob/0851960397f02a477d80eda2239f90fae14dec64/examples/core/core_window_flags.c#L39

adding | FLAG_WINDOW_TRANSPARENT will activate transparency. Compiles with gcc -lraylib -lm core_window_flags.c on Linux. For me same effect - black screen.

I suppose this is a question for a general topic on discord, I saw that you asked it in a Nim-specific channel.

greenfork avatar Jun 04 '22 05:06 greenfork