First public contribution.
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 @internalComponent - Internal Symbian test code
23 #include "tflowwindowopengl.h"
26 CTWindow* CTFlowWindowOpenGL::NewL(RWsSession &aWs,
27 const RWindowTreeNode &aParent,
28 const TPoint& aStartingPoint,
29 const TSize& aWindowSize)
31 CTFlowWindowOpenGL* self = new (ELeave)CTFlowWindowOpenGL(aStartingPoint, aWindowSize);
32 CleanupStack::PushL(self);
33 self->ConstructL(aWs, aParent);
34 CleanupStack::Pop(self);
38 CTFlowWindowOpenGL::CTFlowWindowOpenGL(const TPoint& aStartingPoint, const TSize& aWindowSize) :
39 CTWindow(aStartingPoint, aWindowSize)
45 * Constructs EGL environment, model and output objects which are used to render
49 void CTFlowWindowOpenGL::ConstructL(RWsSession &aWs, const RWindowTreeNode &aParent)
51 CTWindow::ConstructL(aWs, aParent);
52 iEglEnvironment = CEglEnvironment::NewL(iWindow);
53 iModel = CModel::NewL(iEglEnvironment->Display(), iEglEnvironment->Surface());
56 CTFlowWindowOpenGL::~CTFlowWindowOpenGL()
58 delete iEglEnvironment;
63 * Render one OpenGL ES scene and draw it to the screen.
65 void CTFlowWindowOpenGL::RenderL()
69 iModel->DrawToBuffer(iTime);
70 iEglEnvironment->DrawToWindow();
73 void CTFlowWindowOpenGL::SetResolutionL(TInt aResolution)
75 iModel->SetResolutionL(aResolution);