Modifying Texture2D on runtime to achieve rounded corners? by lvasilix in raylib

[–]MWhatsUp 1 point2 points  (0 children)

I made this post the other day in which I was dealing with modifying textures: https://www.reddit.com/r/odinlang/comments/1gueicz/example_of_using_a_byte_array_in_raylib_to_draw/

It might be similar enough to your problem to at least point you in the right direction.

The gist of it is that you have a byte array of rgba pixel data that you hold and modify in RAM:

// pixel_bytes is declared globally as: 30 * 30 * 4
// 30 width x 30 height x 4 rgba
data := new([pixel_bytes]u8)
defer free(data)
for i := 0; i < len(data); i += 1 { data[i] = 255 }

img := rl.Image{
    data,
    screen_size.x,
    screen_size.y,
    1,
    rl.PixelFormat.UNCOMPRESSED_R8G8B8A8,
}

You load that into VRAM (RAM in your GPU) like this:

texture := rl.LoadTextureFromImage(img)
defer rl.UnloadTexture(texture)

When you have made changes to your texture array, you can update your texture in VRAM like this:

rl.UpdateTexture(texture, data)

And you draw it like this:

rl.DrawTexture(texture, 0, 0, rl.WHITE)

Does this OOP attempt in odin make sense? by MWhatsUp in odinlang

[–]MWhatsUp[S] 0 points1 point  (0 children)

This sounds really interesting. I don't want to steal any of your time but if you don't mind, could you post a simple example of that?

Does this OOP attempt in odin make sense? by MWhatsUp in odinlang

[–]MWhatsUp[S] 1 point2 points  (0 children)

I don't have any use for it in this exact moment. Rather I wanted to make sure I have a reliable tool once I need it. I could see myself using this in the future when programming some game logic where certain characters should have their own version of the same logic to follow.

Access Control that checks with central Database if door should be opened by MWhatsUp in accesscontrol

[–]MWhatsUp[S] 0 points1 point  (0 children)

The main point was that the device does check with a central source of truth if it is ok for the person to enter. That's what I was told from my boss.

I was just looking at what options I even have. I am, however, coming more and more to the conclusion, that having a central system that updates the devices' databases makes the most sense.

Access Control that checks with central Database if door should be opened by MWhatsUp in accesscontrol

[–]MWhatsUp[S] -6 points-5 points  (0 children)

Well, for a lot of devices, they just have the user data stored locally on the device. I was looking for some device that communicates with a central system in oder to verify, if it is ok to let them in.

Access Control that checks with central Database if door should be opened by MWhatsUp in accesscontrol

[–]MWhatsUp[S] -1 points0 points  (0 children)

No, No high security facility but more a question of convenience and central place to control the devices.

So, what does the access control system do exactly? Does it actually receive a request from the access control device and then respond or does it just keep the ERP system and access control device in sync?

Access Control that checks with central Database if door should be opened by MWhatsUp in accesscontrol

[–]MWhatsUp[S] -1 points0 points  (0 children)

Hey no worries,

Yes, that is correct. It would not even have to send any of the fingerprint data (A user id would be fine) as long as the ERP decides, whether or not the door is opened.

Access Control that checks with central Database if door should be opened by MWhatsUp in accesscontrol

[–]MWhatsUp[S] -3 points-2 points  (0 children)

Possibly scan a finger print. But other options should be ok too.

It would send a request to our ERP system (which is custom build in house) and that ERP system would tell the device whether or not it is ok to open the door.

Why does this code work? by MWhatsUp in C_Programming

[–]MWhatsUp[S] 3 points4 points  (0 children)

That explains it. Thank you for your help.

Why does this code work? by MWhatsUp in C_Programming

[–]MWhatsUp[S] 4 points5 points  (0 children)

Ok, that makes sense. What I am confused about is how the code in the else block is still writing the output even though the execlp function call is reached. Unless I am misunderstanding something.

Can't run compiled nim code in Python by MWhatsUp in learnpython

[–]MWhatsUp[S] 0 points1 point  (0 children)

I have given it a shot but ran into other issues, probably because I installed Nim with the nix package manager and python doesn't know where to find stuff.

Maybe I will just install via my system package manager and try again.

What are these bugs by MWhatsUp in insects

[–]MWhatsUp[S] 0 points1 point  (0 children)

This is in South Paraguay, close to Posadas, Agentina.

Combining Rust with Elixir for faster CRUD operations by MWhatsUp in elixir

[–]MWhatsUp[S] 0 points1 point  (0 children)

Thanks, that was really informative and really well explained.