OpenGL实用开源代码列表

这篇博客整理了一份关于OpenGL编程的免费资源列表,包括游戏编程、3D和2D图形、音频处理、文件系统等多个领域的开源库。重点介绍了SDL、GLEW和ShaderGen等工具,并提供了相关链接。此外,还提到了物理引擎、数学库和碰撞检测库等,适合游戏开发者和图形编程爱好者参考。
摘要由CSDN通过智能技术生成

有了网络的最大好处就是可以资源共享。网络是最大的知识库,也是最好的老师,正所谓没有你想不到的,只有你找不到的。以下是我收集的以游戏编程,OpenGL 3D编程相关的免费扩展库资料。不断更新中,如果你有好的建义,也请把函数库名及大概功能写上,本人负责收集整理。免费共享

SDL

3D的世界里,SDL可真所胃是大名顶顶,正所谓为人不知陈近南,自称英雄也枉然,因此呢,如果你是做OpenGL开发的,一定要认识一下SDL。我们都知道,在windows系统中,有一个DirectX是游戏开发商的首选的开发包,其背后只支持的Direct3D作为三维图形接口。而SDL就被认为是非window系统中的DirectX,而且是开源的。SDL所使用的3D图形接口是OpenGL。但除了图形之外,它还支持对声音、键盘、鼠标、操纵杆、2D图像等等的底层处理。现在已有不少游戏使用这个开发包进行开发。

SDL是跨平台的,目前支持的系统有:Linux, Windows, Windows CE, BeOS, MacOS, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX

SDL 是用C语言写的,但是能很好地兼容C++语言。并且能被其它语言绑定使用,如: Ada, C#, Eiffel, Erlang, Euphoria, Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, Pike, Pliant, Python, Ruby, and Smalltalk.

SDL发布支持GNU LGPL v2.0 许可协议。也就是说SDL可以免费用于商业应用。

http://www.libsdl.org/index.php

 

glew(OpenGL Extension Wrangler Library )

GLEW是一个跨平台的C++扩展库,基于OpenGL图形接口。使用OpenGL的朋友都知道,window目前只支持OpenGL1.1的涵数,但OpenGL现在都发展到2.0以上了,要使用这些OpenGL的高级特性,就必须下载最新的扩展,另外,不同的显卡公司,也会发布一些只有自家显卡才支持的扩展函数,你要想用这数涵数,不得不去寻找最新的glext.h,有了GLEW扩展库,你就再也不用为找不到函数的接口而烦恼,因为GLEW能自动识别你的平台所支持的全部OpenGL高级扩展涵数。也就是说,只要包含一个glew.h头文件,你就能使用gl,glu,glext,wgl,glx的全部函数。GLEW支持目前流行的各种操作系统(including Windows, Linux, Mac OS X, FreeBSD, Irix, and Solaris)。

下载:http://glew.sourceforge.net/

ShaderGen 提供简单的UI接口让你可以产生固定管线(Fixed Pipeline)Shader.如果你对Shader不熟悉的话,这是一个不错的入门工具.详细网址如下:
http://developer.3dlabs.com/downloads/shadergen/

 

NVSG

The NVIDIA Scene Graph Software Development Kit (NVSGSDK) is an object-oriented programming library for creating scenegraph-based applications. The NVSGSDK provides a comprehensive set of classes that developers can easily combine and extend to create fast and reliable graphics applications.

 

CG_GL

CG_GL is OpenGL API-based open source engine for creating 3D effects. The new release adds depth-of-field with lens blur, and motion blur using shaders. Older version of the engine work on GeForce4 and support full screen blur, transparent object distortion, and glow. Engine is available here: http://tweety3d.no-ip.org. There are also other 3D related programs.

OpenSteer for AI. [MIT license]

Fluid Studios provides a memory manager, matrix class, font generator, radiosity processor, and various other things.

Panda3D (Game/graphics lib, released by Disney after being used for Toontown Online)

math3d++ provides the normal matrix, vector and quaternion classes, and their associated operations.

BMF_Font bitmap font library (and font texture generator)

OpenSceneGraph - 3D engine.

Demeter Terrain Engine [LGPL]

 OGLWFW OpenGL Window Framework  and basically does what it says on the tin, acts as a framework to create OpenGL windows. here

 ARToolKit An augmented reality toolkit, works really nice and very fun to play with. Documentation is still in the works though so you will have to do with the examples.

MXRToolKit I haven't used this one but it appears to offer about the same as ARToolKit except it comes with documentation.

MathGL++
 MathGL++ is a class library for fast C++ maths for use in OpenGL C++ projects. Easy to use and similar to the OpenGL API. Matricies, Vectors, Quaternions, Linear polynomials with eigen systems are all going to be included.

ManagedGL - The cross-platform .NET game library. Development ManagedGL 1 is stalled in faviour of ManagedGL 2. Currently mostly 2D graphics.

LibUFO GUI library (for OpenGL) [LGPL] 一个基于OpenGL的界面库

Crazy Eddie's GUI (another GUI lib)另一个比较有名气的游戏界面库,被OGRE游戏引擎收录使用。

HGE is a greate library for creating hardware accelerated 2D games for windows that is free for freeware games.

Novodex under physics libraries, free for non-commercial use.一个物理引擎,现在被收购了,改名为:PhysX

Pixel Toaster
http://www.pixeltoaster.com/
Open source c++ library for realtime software rendering.
It gives you a truecolor or floating point framebuffer at your choice, then converts the pixels to the display on the fly. Keyboard and mouse input, and a high resolution timer are also provided.
Currently supports only Windows (DirectX9), but ports to MacOS X and Unix (XWindows etc) are underway.

PTK . PTK is a great Mac/Windows 2d library running on top of OpenGL (so it's fast). It's free for freeware but it does have a PTK Watermark in the corner

MMXRand Almost twice as fast as the original Wagner's C++ code using Pentium MMX instruction by Matthew Bellew:
Tao Framework - .Net libraries for Cg, DevIL, FreeGLUT, ODE, OpenAL, OpenGL, and SDL.

OPAL - Open Physics Abstraction Layer, currently wraps just ODE I think but could be adapted to use other libraries. Choice of BSD or LGPL license.

Blitz++ (math library for C++)

 

PortAudio does cross-platform audio output and input using callbacks.

 

GLFTFont - zlib license
Not exactly a library, but a simple class that bridges freetype and OpenGL allowing drawing of truetype fonts in OpenGL. It's functionality is requested often enough I figured I'd release it

 

Object-Oriented Input System (OIS)
OIS is a library for cross-platform input management. It is under the zlib/libpng license. The library supports keyboard, mouse, and joystick/gamepad input. Action mapping is included in one of the demos, and force feedback is planned for the 0.4.0 release (currently in development).

 

libMikMod is a audio module player and library supporting many formats, including mod, s 3m , it, and xm. Originally a player for MS-DOS, MikMod has been ported to other platforms, such as Unix, Macintosh, BeOS, and Java. libMikMod falls under the LGPL agreement.

 

GLM - a Math Library for OpenGL

 

http://members.tripod.com/markus_ilmola

This library contains useful math functions that are needed when

programming with OpenGL. Mostly vector and matrix math.

 

GIMPACT : Collision detection library.
http://gimpact.sourceforge.net/

 


============================================

目录

 

General purpose libraries

AgateLib (.NET library)

(MPL)

Alchemist's Game Library (2D game engine)

(Free for non-commercial use)

Allegro

(giftware)

Amaltheia (game programming API)

LGPL

Basic Game Library (Docs in Spanish?)

Creative Commons

DXGame (Visual Basic 6, 2D game engine/toolkit)

("100% free to use"), but check for details

IKA (generic gaming engine)

('free')

作者对游戏的说明: 首先,您应当以一种批判的眼光来看待本程序。这个游戏是我制作 的第一部RPG游戏,无任何经验可谈,完全按照自己对游戏的理解进 行设计的。当我参照了《圣剑英雄2》的源码之后,才体会到专业游 戏引擎的博大精深。 该程序的内核大约有2000余行,能够处理人物的行走、对话、战斗, 等等。由于该程序的结构并不适于这种规模的程序,故不推荐您详 细研究该程序。所附地图编辑器的源程序我已经添加了详细的注释, 其程序结构也比较合理,可以作为初学VC的例子。 该程序在VC的程序向导所生成的SDI框架的基础上修改而成。它没有 使用任何关于VC底层的东西。程序的绝大部分都是在CgameView类中 制作的,只有修改窗口特征的一段代码在CMainFrm类中。其他的类 统统没有用到。另外添加的一个类是CEnemy类。 整个游戏的故事情节分成8段,分别由Para1.h ~ Para8.h八个文件 实现。由于程序仅仅能够被动的处理各种各样的消息,所以情节的 实现也只能根据系统的一些参数来判断当前应当做什么。在程序中 使用了冗长的if……else if……结构来实现这种判断。 当然,在我的记录本上,详细的记录了每个事件的判断条件。这种 笨拙的设计当然是不可取的。成都金点所作《圣剑英雄II》采用了 剧本解读的方式,这才是正统的做法。但这也需要更多的编程经验 和熟练的code功夫。 下面列举的是程序编制过程中总结出来的经验和教训。 第一,对话方式应该采用《圣剑英雄II》的剧本方式。 现在的方式把一个段落中所有的对话都混在一个文件中,然后给每 句话一个号码相对应。这样做虽然降低了引擎的难度,却导致剧情的 编写极其繁琐。 第二,运动和显示应当完全分。 现在的程序中,运动和显示是完全同步的。即:在定时器中调用所有 敌人的运动函数,然后将主角的动画向前推一帧,接着绘制地图,调 用所有敌人的显示函数、重绘主角。这样的好处是不会掉帧,但带来 的问题是,如果要提高敌人的运动速度,那么帧数也跟着上去了。所 以当DEMO版反馈说速度太慢的时候,我修改起来非常困难。而这个问 题到最后也仅仅是将4步一格该成了2步一格。 第三,VC中数组存在上限。如果用“int aaa[1000000000]”定义一个 数组,编译器肯定不会给分配那么大的内存空间。而在这个程序中, 地图矩阵、NPC矩阵都超过了VC中数组的上限。但这一点知道的太晚了。 在1.0版本中已经发现地图最右端缺少了几行,但不知道是什么原因 造成的。(地图编辑器中未出现此问题,因为地图编辑器是用“序列 化”的方式存盘读盘的。)解决这个问题的方法是用“new”来分配 内存空间。 第四,由于不知道应该如何使用“new”和“delete”,几乎所有的DC 都使用了全局变量。这是完全没有必要的。程序运行期大约会耗用20 多M的内存空间,相当于一个大型游戏所使用的内存空间了。 另外,在游戏的剧情、美工方面也有许多问题,总之一个词“业余”。 我就不总结了。下一部作品,我将争取在程序上有一个质的飞跃。
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值