examples/Graphics/coverflow/inc/openvgengine.h

Go to the documentation of this file.
00001 // openvgengine.h
00002 //
00003 // Copyright (c) 2005-2008 Symbian Ltd.  All rights reserved.
00004 //
00009 #ifndef __OPENVGENGINE_H__
00010 #define __OPENVGENGINE_H__
00011 
00012 #include <VG/openvg.h>
00013 #include <EGL/egl.h>
00014 #include "engine.h"
00015 // image Height/Width
00016 const TInt KImageSize = 128;
00017 
00018 // KMaxDisplayCoversExample3 refers to the number of album covers
00019 // visible on the screen at any given point
00020 const TInt KMaxDisplayCoversExample3 = 40;
00021 const TInt KMaxDisplayLeftExample3 = -3;
00022 const TInt KMaxDisplayRightExample3 = 3;
00023 
00024 
00025 // the max number of covers you can store
00026 const TInt KMaxCoversExample3 = 40;
00027 
00032 class  COpenVGEngine :  public CBase, public MEngine
00033         {
00034 public:
00035 
00036         static COpenVGEngine* NewL(TSize aSize,EGLDisplay& aDisplay, EGLSurface& aSurface, EGLContext& aContext);
00037         virtual ~COpenVGEngine();
00038         TInt GetSpeed();
00039         //From MEngine
00040         void ActivateL();
00041         void Deactivate();
00042         void Step();
00043         TBool IsPending();
00044         TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent);
00045 
00046 
00047 private:
00048         COpenVGEngine(TSize aSize,EGLDisplay& aDisplay, EGLSurface& aSurface, EGLContext& aContext);
00049 
00050         void DrawCover(TInt i);
00051 
00052         void NextCover();
00053         void PreviousCover();
00054 
00055         void ToggleCoverReflection();
00056         VGfloat GetMiddleCoverScalingFactor(VGfloat coverPosition);
00057 
00058 
00059 private:
00063         EGLDisplay& iDisplay;
00067         EGLSurface& iSurface;
00071         EGLContext& iContext;
00075         VGImage iImage;
00079         VGfloat iCoverLocation[KMaxCoversExample3];
00083         VGint iWantedCover;
00087     TBool iHasPendingDraw;
00091         VGfloat iSpeedOffset;
00095         TBool iShowMirror;
00099         TSize iSurfaceSize;
00103         VGfloat iSpeed;
00107         RArray<VGImage> iImages;
00111         TInt iCurrentImageIndex;
00115         VGPaint iShadowPaint;
00116         };
00117 
00118 
00119 #endif

Generated by  doxygen 1.6.2