NeHe OpenGL Lesson29 – Blitter Function, RAW Texture Loading

screen_shot12-300x210 This samples shows us how to load raw texture (or customized texture format file) and image alpha blend, image copy operations (namely Blitter function).
When I got into the source code, I found several thing that we could do to improve this sample.
1) use fread to read a block of data instead of fgetc to read one character by one character; Reading a big block (of course a certain size) should be much faster than read one by one. Actually, we will create some disc read cache buffer or DVD reading cache buffer to improve the reading speed at the application level on some lower access speed device. Also we need to care about that some operating system level API provide some system file cache function.
2) The Blitter function used here is very proto-type. For more advanced features, we could ask more special libraries like FreeImage, SDL and so on.
3) Use hard coding Blitter for texture is not  a good idea. Usually, we would like to paint well in PS, then apply them into the game.
4) For texture data, it is much better if we apply some compress format. Like DXT1 or DXT5, for this we could get less disc space usage and less memory usage.

 

For more details, you could check the source code from here.

转载于:https://www.cnblogs.com/open-coder/archive/2012/08/23/2653229.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值