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.

posted @   opencoder  阅读(228)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示