0

对 iOS 开发来说是全新的。我在 2010 年出版了一本书,名为 iPhone 3d Programming。第 23 页解释了一个文件,它不会在 XCode5 中编译。有人可以告诉我我做错了什么或如何更新此代码以使其编译吗?

我收到如下错误:

Expected ';' at end of declaration list

Unknown type name 'virtual'

IRendereringEngine.hpp

#ifndef HelloArrow_IRenderingEngine_hpp
#define HelloArrow_IRenderingEngine_hpp

// Physical orientation of a handheld device, equivalent to UIDeviceOrientation
enum DeviceOrientation {
    DeviceOrientationUnknown,
    DeviceOrientationPortrait,
    DeviceOrientationPortraitUpsideDown,
    DeviceOrientationLandscapeLeft,
    DeviceOrientationLandscapeRight,
    DeviceOrientationFaceUp,
    DeviceOrientationFaceDown
};

// Creates an instance of the renderer and setus up various OpenGL state
struct IRenderingEngine* CreateRenderer1();

// Interface to the OpenGL ES renderer, consumed by GLView
struct IRenderingEngine {
    virtual void Initialize (int width, int height) = 0;
    virtual void Render() const = 0;
    virtual void UpdateAnimation(float timeStep) = 0;
    virtual void OnRotate(DeviceOrientation newOrientation) = 0;
    virtual ~IRenderingEngine();
};

#endif
4

0 回答 0