各位大虾好!最近准备做一个简单的类似泡泡堂的小游戏,由于以前没有做过这样的东西,所以现在感觉有点无从下手,在网上看到不少有关delphiX与Open GL的介绍,可是不知道这两者有和区别,都有什么样的特点。哪一个学起来更简单呢?还有,针对现在我要做的这个单机泡泡堂游戏,用哪个更合适一点呢?
谢谢!

解决方案 »

  1.   

    Delphi he OPenGL 比较,真奇怪
      

  2.   

    OpenGL是工业标准,你注重可移植性的话就用它写这种小东西用DirectX就可以了,不推荐用DelphiX,用这个快餐学不到什么东西的
      

  3.   

    Direct3D vs. OpenGL: A Comparison
    Summary
    This page is an informal attempt to summarize the main differences between SGI's OpenGL and Microsoft's Direct3D. First, each API is summarized in an attempt to bring a balanced presentation of the two APIs. Then a feature comparison is made between the capabilities of OpenGL and Direct3D. Unless otherwise noted, "OpenGL" refers to the OpenGL 1.2 core with no extensions and "Direct3D" refers to Direct3D8, the Direct3D interface in DirectX 8. When a difference between Direct3D7 and Direct3D8 is noteworthy, version numbers are given. Intended Audience
    This document assumes that the reader is familiar with the architecture of a traditional 3D graphics pipeline as commonly used with scanline rendering techniques. For more information on such architectures, the reader is encouraged to consult a 3D graphics text such as "3D Computer Graphics" by Alan Watt and Mark Watt. This is only one book of many 3D graphics books, the interested reader is encouraged to browse a good technical bookstore and find one that speaks to them most effectively. SGI's OpenGL
    SGI's OpenGL is a procedural 3D graphics API, the successor to Iris GL which originated in the unix workstation et. Iris GL is the graphics API used on a succession of 3D graphics workstations designed and built by Silicon Graphics, Inc. "OpenGL" is a trade of the OpenGL Architectural Review Board (ARB). The ARB controls the definition of OpenGL through control of the specification by which an implementation may call itself "OpenGL". The specification is an English prose document with associated mathematics that define the semantics of the API. The ARB also governs a suite of conformance tests that serve as a validation suite for an implementation. The ARB was formed in 1992 and functions under a set of bylaws to revise and oversee the specification of the API. OpenGL defines a state machine that controls the rendering pipeline. State machine attributes are modified through procedure calls and vertices defining graphic primitives are specified to the pipeline through procedure calls. Only the OpenGL 1.2 core is considered in this document, not extensions. Microsoft's Direct3D
    Microsoft's Direct3D is a COM based 3D graphics API originating in a third-party 3D graphics API for x86 architectures. Microsoft acquired the technology in 1996 and has been offering the API as a component of its DirectX technology. Direct3D contains an immediate-mode interface and a strctured hierarchical scene graph interface called retained mode. Only the immediate-mode interface is considered in this document. Microsoft defines the Direct3D API through its COM interfaces, and the semantics are defined by the the help files and sample code accompanying the software development kit provided by Microsoft. Direct3D first appeared in DirectX 3 with execute buffers as its display paradigm. All subsequent releases, beginning with DirectX 5 (there was no DirectX 4), replaced execute buffers with a more traditional graphics primitive display paradigm. Feature Comparison
    OpenGL and Direct3D both expose a traditional graphics rendering pipeline. This basic pipeline design has been present since the earliest days of computer graphics and has been enhanced and extended over the years as hardware has become more capable, but the fundamental paradigm has not changed. Vertices are described to the pipeline as a bundle of data consisting of coordinates in space defining the vertex's location and associated per-vertex data. A graphics primitive is described to the pipeline as an ordered set of vertices. How vertices are combined into various primitives -- generally points, lines and triangles -- is defined by the particular API. Rather than provide an exhaustive list of features where both OpenGL and Direct3D provide the same feature, I will list the differences. Feature OpenGL 1.2 Core Direct3D 7 Direct3D 8 
    System Mechanics 
    Operating System Support Windows (9x, NT, 2000), MacOS, BeOS, *nix, others Windows (9x, 2000, CE) [12] Windows (9x, 2000) [12] 
    API Definition Control OpenGL ARB Microsoft Microsoft 
    API Specification OpenGL Specification [10] SDK/DDK Documentation and DDK Reference SDK Documentation 
    API Mechanism includes and libraries COM COM 
    Software Emulation of Unaccelerated Features [4] Yes No No [11] 
    Extension Mechanism [5] Yes No Yes 
    Source Implementation Available [6] Yes Yes No 
    Modeling 
    Fixed-Function Vertex Blending No Yes Yes 
    Programmable Vertex Blending No No Yes 
    Parametric Curve Primitives Yes No Yes 
    Parametric Surface Primitives Yes No Yes 
    Hierarchical Display Lists Yes No [8] No [8] 
    Rendering 
    Two-sided Lighting Yes No [1] No [1] 
    Point Size Rendering Attributes [9] Yes No Yes 
    Line Width Rendering Attributes [9] Yes No No 
    Programmable Pixel Shading No [14] No Yes 
    Triadic Texture Blending Operations No No Yes 
    Cube Environment Mapping No Yes Yes 
    Volume Textures Yes No Yes 
    Multitexture Cascade No [13] Yes Yes 
    Texture Temporary Result Register No No Yes 
    Mirror Texture Addressing No Yes Yes 
    Texture "Wrapping" No Yes Yes 
    Range-Based Fog No Yes Yes 
    Bump Mapping No Yes Yes 
    Modulate 2X Texture Blend No Yes Yes 
    Modulate 4X Texture Blend No Yes Yes 
    Add Signed Texture Blend No Yes Yes 
    Frame Buffer 
    Hardware Independent Z Buffer Access Yes No [2] No [2] 
    Full-Screen Antialiasing Yes Yes Yes 
    Motion Blur Yes No Yes 
    Depth of Field Yes No Yes 
    Accumulation Buffers Yes No No [7] 
    Miscellaneous 
    Picking Support Yes No [3] No [3] 
    Multiple Monitor Support No Yes Yes 
    Stereo Rendering Yes Yes No 
      

  4.   

    Notes: Two-sided lighting can be emulated by an application that desires two-sided polygon surfaces. First, the application sets the pipeline to cull back facing polygons and draws the front side of all two-sided polygons. Next, the pipeline is set to cull front facing polygons and the application draws the back side of all two-sided polygons. 
    Access to the Z buffer is provided, but the values stored in the Z buffer are hardware dependent. 
    Picking can be done entirely in the application by traversing its own data structures. 
    OpenGL provides software emulation when hardware cannot accomodate the requested feature to guarantee that a rendering feature will exist. Direct3D exposes extensive information about hardware capabilities and lets the application determine how to obtain the requested feature. 
    OpenGL provides an extension mechanism for an implementation to expose additional features not yet adopted by the ARB. Direct3D7 has one implementation with no extension mechanism. Direct3D8 has one implementation and provides support for pluggable software devices. 
    An open source sample implementation of OpenGL is available. Microsoft's Windows 2000 DDK (driver development kit) contains the reference rasterizer for Direct3D 7. 
    Multisampling is provided Direct3D8, but not as an accumulation buffer. This allows Direct3D8 to perform full-screen antialiasing, depth of field and motion blur effects without providing an accumulation buffer. 
    Hierarchical display lists are not provided by Direct3D, but Direct3D does provide storage for polygon vertices and vertex indices to avoid data copying. These are flat array-like storages consisting only of geometry data and no state changes. State changes may be aggregated into state blocks for efficient transmission to the device. Neither state blocks, nor index buffers nor vertex buffers are hierarchical. 
    Point and line width attributes can be emulated by drawing textured triangles (for points) or quadrilaterals (for lines) when the size of the point or line is significant. This also provides the application with more control over the exact rendering of these large points and thick lines. This additional control over rendering may be important for OpenGL applications even though OpenGL provides point and line rendering attributes. 
    OpenGL's specification, while still being an English prose specification, is more rigorously defined than Direct3D. 
    Direct3D8 provides software emulation for vertex processing (blending, vertex shaders, fixed-function vertex processing, etc.), but not for pixel processing (pixel shaders, multitexturing, etc.). 
    Windows NT 4 only supports DirectX 3. 
    Multitexture cascade is provided in OpenGL 1.2 through an ARB extension. While still an extension and not part of the official 1.2 core, it is expected to be widely implemented as it is a "standard" extension and not a vendor extension. 
    Programmable pixel shading is provided by some vendors in OGL through the register combiner vendor extension. 
    In several aspects, a comparison between OpenGL and Direct3D is similar to a comparison between OpenGL and PEX. Many of the same differences exist for Direct3D. 
      

  5.   

    OpenGL的文档多点,不过多数基于C/C++的开发小程序建议用OPENGL好点,在其它平台下不用怎么修改就可移植了,毕竟你用到的特性不是很多,用OpenGL也比较容易点.DelphiX封装了DirectX的功能,而且不是OpenSource,真的是学不到什么.
      

  6.   

    DelphiX同OpenGL不是同类事物,不能比较的应该是DirectX和OpenGL的区别在Windows下DirectX的效能更高而已特别是D3D 9.0C功能更强,唯一的不好就是M$的东西,没Open
    好处就是,Windows下最强的3D系统,ATI,NVidia所谓高端Gamer显卡都冲着DirectX来的写Windows下的游戏选择它是没错的,想移植就OpenGL了
    虽然Dx没Open,就象DotNet,Windows系统一样,同样是N多人选择它~http://lysoft.7u7.net
      

  7.   

    听听老外怎么说的:API -- 祝福和诅咒  (转)
      那么什么是API? 它是应用程序编程接口,将不一致的后端用一致的前端呈现出来。举例来说,很大程度上每种3D显示卡的3D实现方式都有所差别。然而,他们全部都呈现一个一致的前端给最终使用者或者程序员,所以他们知道他们为X 3D显示卡写的代码将会在Y 3D显示卡上面有相同的结果。好吧,不管怎样理论上是那样。 大约在三年以前这可能是相当真实的陈述,但自那以后,在nVidia 公司的引领下,3D显卡行业的事情发生了变化。   如今在PC领域,除非你正计划建造自己的软件光栅引擎,使用CPU来绘制你所有的精灵,多边形和粒子 -- 而且人们仍然在这样做。跟Unreal一样,Age of Empires II: Age of Kings有一个优秀的软件渲染器 – 否则你将使用两种可能的图形API,OpenGL或者 DirectX 之一。OpenGL是一种真正的跨平台API (使用这种API写的软件可以在Linux,Windows和MacOS上运行。), 而且有多年的历史了,为人所熟知,但也开始慢慢地显示出它的古老。 大约在四年以前,定义OpenGL驱动特征集一直是所有显示卡厂商工作的方向。  然而,一旦在目标达成以后,没有预先制定特征工作方向的路线图,这时候,所有的显卡开发商开始在特征集上分道扬镳,使用OpenGL扩展。
     
      3dfx 创造了T- 缓冲。 nVidia 努力寻求硬件变换和光照计算。Matrox努力获取凹凸贴图。等等。 我以前说过的一句话,"过去几年以来,3D显示卡领域的事情发生了变化。"委婉地说明了这一切。   无论如何,另一个可以选择的API是 DirectX。这受Microsoft公司控制,且在PC 和 Xbox 上被完美地支持。由于明显的原因,DirectX 没有Apple或者 Linux 版本。因为Microsoft控制着 DirectX,大体上它容易更好地集成在Windows里面。   OpenGL和DirectX之间的基本差别是前者由‘社区’拥有,而后者由Microsoft拥有。如果你想要 DirectX 为你的 3D 显示卡支持一个新的特征,那么你需要游说微软,希望采纳你的愿望,并等待新的 DirectX发行版本。对于OpenGL,由于显示卡制造商为3D显示卡提供驱动程序,你能够通过OpenGL扩展立即获得显示卡的新特征。这是好,但作为游戏开发者,当你为游戏编码的时候,你不能指望它们很普遍。它们可能让你的游戏速度提升50%,但你不能要求别人有一块GeForce 3 来跑你的游戏。好吧,你可以这么做,但如果你想来年还在这个行业的话,这是个相当愚蠢的主意。  这是对这个问题极大的简单化,对我所有描述的也有各种例外情况,但这里一般的思想是很确实的。对于DirectX ,在任何既定时间你容易确切地知道你能从显示卡获得的特征,如果一个特征不能获得,DirectX 将会用软件模拟它(也不总是一件好事情,因为这样有时侯非常的慢,但那是另外一回事)。对于OpenGL,你可以更加贴近显示卡的特征,但代价是不能确定将会获得的准确特征。
      

  8.   

    游戏大部分逻辑部分是与渲染无关的.特别是这种小游戏,图形编程上基本不花时间.随便你如何选择.说Windows下DirectX的效能更高是不对的,HL的引擎就是最明显的例证,所有CS玩家都使用OpenGL.现在的魔兽3也是如此,我一直使用OpenGL来玩,在1024*768下明显流畅一些.别忘了还有ID Soft.这完全要看游戏开发者的态度.DX 9.0C是很强大,但OpenGL 2.0其实也不错.这种2D游戏根本不值得在此问题上花脑筋.其实纯粹Soft Render都能很块.甚至GDI绘图都可以胜任.初学嘛,自然两个都要去学.这部分学习光熟悉API是不够的.还要掌握Shader指令,Shader编程模型,学习几种高级Shader Language(HLSL,CGSL,GLSL).只有掌握了这些,才算是为用DirectX/OpenGL进行图形编程打下了一些基础.另外计算机图形学的各种相关知识也是一定要熟悉的.图形编程是游戏编程的基础嘛.
      

  9.   

    HOHO傻眼了!  多多指教!接着你给的分!谢谢!
      

  10.   

    请问那里有delphiX的下载?我找了很多地方怎么都下载不了  难过!我用的是Delphi 7  
    因为我准备做的是一个简单的泡泡堂游戏  所以认为用delphiX相对来说要简单些  不知道各位大虾认为呢?如果有下载delphiX-D7的  在这里说一下了  我找的好辛苦呢   55555
      

  11.   

    比什么比啊,要比也是direct3D vs opengl,delphix不过是封装了directDraw(Dx7)的小组件罢了,我写的泡泡堂游戏带源码的,你看了没有?delphix for d7的还不容易找?去这里下个http://turbo.gamedev.net
      

  12.   

    另外,你想用delphi写游戏的话,先看看这个表,delphix不算什么,不过是组件封装的不错http://blog.csdn.net/s.f.%20/archive/2004/10/06/125686.aspx
      

  13.   

    Jedi 翻译的 DirectX SDK 不错,搞一份可以直接用
      

  14.   

    同意如果非要在DELPHI下学习dx还是用sdk,不要用DELPHIX
      

  15.   

    同意楼上几位的意见,最好用Jedi翻译的SDK。
    不过你一定要用DelphiX的话,www.2ccc.com有下载。
      

  16.   

    http://turbo.gamedev.net 上有现在delphi下所有关于directx封装的控件的比较
    delphix 从2001年后就停止开发了。delphix只封装到了directx7,所以新的directx功能用不到。它的3D与与2D是分开的,所以2D用不上3D加速,除非你自己再封装一下。后面有人写了undelphix,在刚才那个地址也可以找到,不过也只是小改动。
    opengl的好处是跨平台。它和directx一样,如果你直接用API的话要写的东西都很多。所以大部分也是在用别人封装好了的控件。
    http://terraqueous.f2o.org/dgdev/index.php 是国外一个相对来说人比较多一些的delphi的游戏开发论坛。这里你可以找到一些资料的
    如果你只是初步了解的话,用delpihx会比较容易入门。而且它的例子也是比较全的,同时你可以学习别人是如何进行封装的。我不太认同要从SDK开始的说法。毕竟真正的大游戏都是把底层封装成一个专用的引擎后才用的。你可以用的时候同时分析一下人家的封装,那样更容易理解一些使用上的要点