如何指定“宽度"或“点大小"在 SDL 2.0 中绘制点、线或矩形 [英] how to specify "width" or "point size" in SDL 2.0 draw points, lines or rect
本文介绍了如何指定“宽度"或“点大小"在 SDL 2.0 中绘制点、线或矩形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用 SDL 2.0 函数 SDL_RenderDrawPoints()
在屏幕上绘制数据点.
I am trying to use SDL 2.0 function SDL_RenderDrawPoints()
to plot data points on the screen.
在processing.org"中,我可以使用 strokeWeight()
来改变我的点"的大小.如何在 SDL 2.0 中执行此操作
In "processing.org", I can use strokeWeight()
to change the size of my "points". How to do this in SDL 2.0
推荐答案
SDL 本身不支持,请使用 SDL_gfx 库.
SDL does not support it natively,use the SDL_gfx library.
有一个函数thicklineRGBA 允许你指定线宽.
There's a function thicklineRGBA which allows you to specify line width.
int thickLineRGBA (SDL_Renderer *rd, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
这篇关于如何指定“宽度"或“点大小"在 SDL 2.0 中绘制点、线或矩形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文