将旧书中的代码更新为Xcode5

时间:2013-10-27 22:41:45

标签: ios opengl-es xcode5

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

0 个答案:

没有答案