如何使用SDL2逐像素设置颜色

3
我希望您能为我提供一种简单/快速的方法,使用SDL2完成以下容易事项: 我有一个窗口和一个渲染器,我想为我所处的每个像素设置一个(32位)颜色:
例如,我有一个5120×2880的窗口:
y = 0;
while (y < 2880)
{
    x = 0;
    while (x < 5120)
    {
        Do what ever I want with the pixel pos x, y;
        x++;
    }
    y++;
}
1个回答

2

对于那些想知道的人,这是

SDL_SetRenderDrawColor(renderer, r, v, b, n);
SDL_RenderDrawPoint(renderer, x, y);

我其实在想这是什么编程语言。它看起来相当重要。 - Jongware
@Jongware 这是C还是C++。 - OverShifted

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接