Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local W,H = 1024, 1024
- local tex = Texture(1024, 1024, ETF_A8R8G8B8)
- ffi.cdef("typedef struct { uint8_t r, g, b, a; } rgba_pixel;")
- local length = W*H
- local img = ffi.new("rgba_pixel[?]", length)
- for i = 0, length-1 do
- img[i].r = math.random(255)
- img[i].g = math.random(255)
- img[i].b = math.random(255)
- img[i].a = math.random(255)
- end
- tex:SetData(img)
- local rect = Rect(0, 0, W, H)
- hook.Add("PostDrawMenu", "draw_texture_noise", function()
- rect.x, rect.y = mouse.GetPos()
- graphics.Set2DFlags()
- graphics.DrawTexture(tex, rect, nil, nil, true)
- end)
Advertisement
Add Comment
Please, Sign In to add comment