• OpenGL ES探究1


    1,首先来对GLKViewController一探究竟

    #import <Foundation/Foundation.h>

     

    #import <UIKit/UIKit.h>

     

    #import <GLKit/GLKView.h>

     

    NS_ASSUME_NONNULL_BEGIN

    @protocol GLKViewControllerDelegate;

     

    #pragma mark -

    #pragma mark GLKViewController

    #pragma mark -

     //已被弃用

    OPENGLES_DEPRECATED(ios(5.0,12.0), tvos(9.0,12.0))

    API_UNAVAILABLE(macos)

    //继承自UIViewController,遵循NSCoding,GLKViewDelegate协议

    @interface GLKViewController : UIViewController <NSCoding, GLKViewDelegate>

    {

        

    }

     

    @property (nullable, nonatomic, assign) IBOutlet id <GLKViewControllerDelegate> delegate;

     

    /*

     For setting the desired frames per second at which the update and drawing will take place.

     The default is 30.

    设置帧率,每秒30次刷新和刻画

     */

    @property (nonatomic) NSInteger preferredFramesPerSecond;

     

    /*在给定preferredFramesPerSecond的值以及GLKView所在的屏幕的情况下,确定的每秒实际帧数。 选择的值将尽可能接近preferredFramesPerSecond,

    而不会超出屏幕的刷新率。 此值不考虑丢失的帧,因此它不是每秒统计帧的度量。 它是将对其进行更新的静态值。

     The actual frames per second that was decided upon given the value for preferredFramesPerSecond

     and the screen for which the GLKView resides. The value chosen will be as close to

     preferredFramesPerSecond as possible, without exceeding the screen's refresh rate. This value

     does not account for dropped frames, so it is not a measurement of your statistical frames per

     second. It is the static value for which updates will take place.

     */

    @property (nonatomic, readonly) NSInteger framesPerSecond;

     

    /*

     Used to pause and resume the controller.

    用来停止和恢复控制器

     */

    @property (nonatomic, getter=isPaused) BOOL paused;

     

    /*

     The total number of frames displayed since drawing began.

    从刻画开始所显示的帧数

     */

    @property (nonatomic, readonly) NSInteger framesDisplayed;

     

    /*

     Time interval since properties.

    自此以来时间间隔的属性

     */

    @property (nonatomic, readonly) NSTimeInterval timeSinceFirstResume;

    @property (nonatomic, readonly) NSTimeInterval timeSinceLastResume;

    @property (nonatomic, readonly) NSTimeInterval timeSinceLastUpdate;

    @property (nonatomic, readonly) NSTimeInterval timeSinceLastDraw;

     

    /*

    如果为true,则控制器将在应用程序收到willResignActive通知时暂停。

    如果为false,则控制器将不会暂停,并且预期在必要时其他某种机制将暂停控制器。

     If true, the controller will pause when the application recevies a willResignActive notification.

     If false, the controller will not pause and it is expected that some other mechanism will pause

     the controller when necessary.

     The default is true.

     */

    @property (nonatomic) BOOL pauseOnWillResignActive;

     

    /*

    如果为true,则控制器将在应用程序收到didBecomeActive通知时恢复运行。

    如果为false,则控制器将不会继续运行,并且在必要时可以期望其他某种机制来恢复控制器。

     If true, the controller will resume when the application recevies a didBecomeActive notification.

     If false, the controller will not resume and it is expected that some other mechanism will resume

     the controller when necessary.

     The default is true.

     */

    @property (nonatomic) BOOL resumeOnDidBecomeActive;

     

    @end

     

    #pragma mark -

    #pragma mark GLKViewControllerDelegate

    #pragma mark -

     

    @protocol GLKViewControllerDelegate <NSObject>

     

    @required

    /*

    实现GLKViewControllerDelegate的必需方法。 不子类化GLKViewController时,应使用此更新方法变体。

    如果GLKViewController对象已被子类化并实现,则不会调用此方法

     Required method for implementing GLKViewControllerDelegate. This update method variant should be used

     when not subclassing GLKViewController. This method will not be called if the GLKViewController object

     has been subclassed and implements -(void)update.

     */

    - (void)glkViewControllerUpdate:(GLKViewController *)controller;

     

    @optional

    /*

     Delegate method that gets called when the pause state changes. 

    暂停状态更改时调用的委托方法。

     */

    - (void)glkViewController:(GLKViewController *)controller willPause:(BOOL)pause;

     

    @end

  • 相关阅读:
    剑指offer——二叉树的深度
    剑指offer——约瑟夫环
    剑指offer——矩阵中的路径
    剑指offer——机器人的运动范围
    Java一些知识
    剑指offer——判断链表中是否有环
    无序数组array, 找到数组中两个数的最大差值
    剑指offer——二叉搜索树的第k个节点
    记录结果再利用的"动态规划"之背包问题
    倍增算法
  • 原文地址:https://www.cnblogs.com/vkSwift/p/13769147.html
Copyright © 2020-2023  润新知