schveiguy / raylib-d

Resurrected copy of onroundit's raylib-d
zlib License
57 stars 14 forks source link

Blank screen #42

Closed joelcnz closed 1 year ago

joelcnz commented 1 year ago

I hope I'm not annoying (not being the proper place for this problem).

I had one program working, but I get blank screens with converting from other programs of mine.

I'm using macOS 13.5.1 - rayLib 5.0 This attachment has commented out most of the stuff, and just got one texture to draw, (which it doesn't). I think the sound doesn't play either. url

schveiguy commented 1 year ago

I'm also on macos.

I clicked on the link, but it says I don't have permission.

joelcnz commented 1 year ago

Go into security putting open anyway. I have a new trick though, start with a working program, and keep adding to it. Also, needs a little fixing for it even to even compile.

joelcnz commented 1 year ago

Oh, try it now. Google was blocking it (it's now set to anyone with the link can open it). Sorry.

schveiguy commented 1 year ago

The problem is this:

DrawTexture(textest, 0,0, Color(128,128,128));

A Color struct looks like this:

struct Color
{
    ubyte r; // Color red value
    ubyte g; // Color green value
    ubyte b; // Color blue value
    ubyte a; // Color alpha value
}

You have left off the alpha value, which leaves it at 0 (meaning 0 opacity). Once I changed the line to this:

DrawTexture(textest, 0,0, Colors.WHITE);

It worked.

Not sure what the tinting intention is, but I have found it's best to use WHITE, or use WHITE with some opacity difference.

joelcnz commented 1 year ago

Oh, thanks. I was thinking I was putting a number for the alpha channel, but I wasn't.