How do engines like Unreal relate to OpenGL or D3D?

TL;DR: An engine is just a collection of reusable components.

Wall of text:Games store a representation of the world, e.g. you'd have an entity like a house, which has a mesh that defines what its geometry looks like and a position.

Now, you probably have more than one entity. Let's say we've got a player controlled character and some boxes. When the player wants to move, you'd move the character and check if he collides with any boxes. That's where physics come into play. Depending on how physics are modelled, the character might just walk through the boxes, stop in front of the boxes or push the boxes.

Mind you, this only changes the internal state of the game world.

Then, after calculating movement and physics, you'd render a frame, e.g. draw the current state of the world on the screen.

OpenGL and DirectX are graphics APIs, they are only used to render stuff (e.g. the character) to the screen.

So, you're basically telling OpenGL/DirectX 'I want to draw the character at position1 and a box at position2, and ...'.

Of course, this is a gross oversimplification.

Anyway, since we don't want to walk through that procedure step by step all the time, we put that stuff into functions and classes. So, we might have a class physics which holds all the functions needed for the physics simulation, or a graphics class which interfaces with the graphics api and draws our entities. Et voila, we've got an engine.


转载链接:http://gamedev.stackexchange.com/questions/20706/how-do-engines-like-unreal-relate-to-opengl-or-d3d


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值