快速像素绘图库 [英] Fast pixel drawing library

查看:92
本文介绍了快速像素绘图库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序以每个像素的方式生成动画",因此我需要有效地绘制它们.我尝试了不同的策略/库,但结果却不尽人意,尤其是在高分辨率下.

My application produces an "animation" in a per-pixel manner, so i need to efficiently draw them. I've tried different strategies/libraries with unsatisfactory results especially at higher resolutions.

这是我尝试过的:

  • SDL:好的,但是很慢;

  • SDL: ok, but slow;

OpenGL:无效的像素操作;

OpenGL: inefficient pixel operations;

xlib:更好,但仍然太慢;

xlib: better, but still too slow;

svgalibdirectfb,(其他帧缓冲区实现):它们似乎完美,但对于最终用户来说肯定太棘手了.

svgalib, directfb, (other frame buffer implementations): they seem perfect but definitely too tricky to setup for the end user.

(注意:这些断言我可能错了,如果是的话,请纠正我)

我需要以下内容:

  • 快速像素绘制,性能与OpenGL渲染相当;

它应该可以在Linux上运行(作为奖励功能,跨平台);

it should work on Linux (cross-platform as a bonus feature);

它应该支持双重缓冲和垂直同步;

it should support double buffering and vertical synchronization;

对于涉及硬件的问题,它应该是可移植的;

it should be portable for what concerns the hardware;

它应该是开源的.

您能给我一些启示/想法/建议吗?

Can you please give me some enlightenment/ideas/suggestions?

推荐答案

您的像素稀疏还是密集(例如,位图)?如果要用像素创建密集的位图,则另一种选择是将位图转换为OpenGL纹理,并使用OpenGL API以一定的帧速率进行渲染.

Are your pixels sparse or dense (e.g. a bitmap)? If you are creating dense bitmaps out of pixels, then another option is to convert the bitmap into an OpenGL texture and use OpenGL APIs to render at some framerate.

基本问题是图形硬件在不同的硬件平台上会有很大的不同.您可以选择一个抽象层来减慢速度,或者更紧密地编码与当前不可移植的图形硬件类型.

The basic problem is that graphics hardware will be very different on different hardware platforms. Either you pick an abstraction layer, which slows things down, or code more closely to the type of graphics hardware present, which isn't portable.

这篇关于快速像素绘图库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆