egl/sfegltest/inc/eglrendering.h
author Gareth Stockwell <gareth.stockwell@accenture.com>
Fri, 22 Oct 2010 22:42:40 +0100
branchbug235_bringup_0
changeset 211 3804ba25b23f
parent 210 da03feddbab7
child 215 097e92a68d68
permissions -rw-r--r--
Refactored eglbringuptest to separate EGL and VG code This allows for a more complex demo (e.g. one which includes animated rendering) to be implemented simply by writing a new class derived from CEglRendering, and modifying CWsApp::ConstructL to create an instance of this new class.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
193
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     1
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     2
// All rights reserved.
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     7
//
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     8
// Initial Contributors:
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    10
//
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    11
// Contributors:
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    12
//
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    13
// Description:
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    14
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    15
#ifndef __EGLRENDERING_H__
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    16
#define __EGLRENDERING_H__
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    17
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    18
#include <e32base.h>
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    19
#include <w32std.h>
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    20
#include <EGL/egl.h>
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    21
#include <VG/openvg.h>
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    22
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    23
class CEGLRendering : public CBase
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    24
	{
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    25
public:
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    26
	~CEGLRendering();
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    27
211
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    28
	static TInt TimerCallBack(TAny* aDemo);
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    29
    void Redraw();
210
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    30
211
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    31
protected:
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    32
    CEGLRendering(RWindow& aWindow);
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    33
    void ConstructL();
210
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    34
211
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    35
	void StartRedrawTimer();
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    36
	void StopRedrawTimer();
210
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    37
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    38
    static void EGLCheckError();
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    39
    static void EGLCheckReturnError(EGLBoolean aBool);
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    40
    static void VGCheckError();
211
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    41
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    42
private:
210
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    43
    void EglSetupL();
211
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    44
    virtual void KhrSetup() = 0;
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    45
    virtual void KhrPaint() = 0;
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    46
    void EglSwapBuffers();
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    47
193
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    48
private:
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    49
	RWindow& iWindow;
211
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    50
	CPeriodic* iRedrawTimer;
193
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    51
	EGLDisplay iDisplay;
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    52
	EGLSurface iSurface;
210
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    53
	EGLContext iContext;
193
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    54
	};
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    55
210
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    56
#endif
193
bbf967b65d9e Add a bringup test program. Rom build is: buildrom syborg minigui_simulator eglbringuptest.iby The command to run is called ebt. See mmp file for documentation.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    57