1

如何在 OpenGL ES 中将 1 个纹理分配给另一个纹理?

我有一个名为 Objects 的类,它有一个名为纹理的成员。它有一个复制构造函数来复制所有数据。如果我传递一个已经设置了纹理并分配它的对象,

texture = obj.texture

这没用。我该怎么做才能让它发挥作用?

实际上它被称为gameObjects。这是复制构造函数

GameObject::GameObject(const GameObject &dummy)
{
orientation = dummy.orientation;
speed = dummy.speed;
deltax = dummy.deltax;
deltay = dummy.deltay;
position = dummy.position;
active =true;
name = dummy.name;
texture = dummy.texture;
rect = dummy.rect;
fixedWidthRatio = dummy.fixedWidthRatio;
fixedHeightRatio = dummy.fixedHeightRatio;

currentWidthRatio = dummy.currentWidthRatio;
currentHeightRatio = dummy.currentHeightRatio;

}
4

0 回答 0