⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wikilauncherappview.h

📁 这是在s60第五版上用Open GL开发的软件
💻 H
字号:
/* ====================================================================
 * File: WikiLauncherAppView.h
 * Created: 11/28/08
 * Author: 
 * Copyright (c): , All rights reserved
 * ==================================================================== */

#ifndef __WIKILAUNCHER_APPVIEW_H__
#define __WIKILAUNCHER_APPVIEW_H__


#include <coecntrl.h>

/*! 
@class CWikiLauncherAppView

@discussion An instance of the Application View object for the WikiLauncher 
example application
*/


#include <GLES/egl.h>
#include <GLES/gl.h>

#include "Direction.h"

class CSimpleCube;
class CTexture;

class CWikiLauncherAppView : public CCoeControl
{
public:
  
  enum TState
  {
    EIdle,
    EDragging,
    EMovement
  };

  static CWikiLauncherAppView* NewL(const TRect& aRect);
  static CWikiLauncherAppView* NewLC(const TRect& aRect);
  ~CWikiLauncherAppView();
  
private:

  void Draw(const TRect& aRect) const;
  
  // Handle any tap on the screen
  void HandlePointerEventL(const TPointerEvent& aPointerEvent);

  // Debug drawing methods
  void DrawAxis( CWindowGc& aGc ) const;
  void DrawActualCoord( CWindowGc& aGc ) const;
  void DrawHandStroke( CWindowGc& aGc ) const;
  void DrawLine( CWindowGc& aGc ) const;
  void DrawDirection( CWindowGc& aGc ) const;
    
  // Engine methods
  TBool CheckHandStroke(); 
  void CalculateLinearRegressionCoef();
  TPoint TransformCoord( TPoint aPoint ) const ;
  TPoint TransformCoordBack( TPoint aPoint ) const;
  TInt Angle( TReal& aAngleDeg ) const;
  TInt Direction( TRotationDirection& aDirection) const;
    
  // OpenGL methods
  TInt InitOpenGL();

  // Private constructors
  void ConstructL(const TRect& aRect);
  CWikiLauncherAppView();
  
  // Draw the rotated cube
  static TInt DrawCallBack( TAny* aInstance );
  
private:

  // Drag points
  RArray<TPoint> iPoints;
  
  // Line coef. y = iBx + iA
  TReal iA, iB;
  
  // Currentr state
  TState iState;
  
  /// Display where the OpenGL ES window surface resides
  EGLDisplay  iEglDisplay;
  
  // Window surface where the OpenGL ES rendering is blitted to
  EGLSurface  iEglSurface;  

  // OpenGL ES rendering context
  EGLContext  iEglContext;
  
  // Simple cube 3D object
  CSimpleCube* iSimpleCube;
  
  // Texture cube
  CTexture* iTextureCube;
  
  // Current rotation angle
  TInt iAngle;
  
  // Active object that is the timing source for the animation.
  CPeriodic*  iPeriodic;
  
  // Is 3D cube animated just now?
  TBool iAnimation;
  
  // Texture cube state
  TInt iTextureCubeState;
};


#endif // __WIKILAUNCHER_APPVIEW_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -