egl/sfegltest/inc/eglrendering.h
author Gareth Stockwell <gareth.stockwell@accenture.com>
Fri, 05 Nov 2010 17:31:20 +0000
branchbug235_bringup_0
changeset 215 097e92a68d68
parent 211 3804ba25b23f
permissions -rw-r--r--
Added GLES 1.x spinning cube-rendering code to eglbringuptest The coordinate, color and index data are uploaded to server-side buffers by the CGLES1Cube::KhrSetup function. CGLES1Cube::KhrPaint just sets the view matrix and issues a draw command. Which demo to display can be selected by passing its name on the command line, e.g. eglbringuptest vgline eglbringuptest gles1cube If no name is provided, the application defaults to vgline.
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>
215
097e92a68d68 Added GLES 1.x spinning cube-rendering code to eglbringuptest
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 211
diff changeset
    20
#include <egl/egl.h>
097e92a68d68 Added GLES 1.x spinning cube-rendering code to eglbringuptest
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 211
diff changeset
    21
#include <vg/openvg.h>
097e92a68d68 Added GLES 1.x spinning cube-rendering code to eglbringuptest
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 211
diff changeset
    22
#include <gles/gl.h>
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
    23
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
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
    25
	{
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
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
    27
	~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
    28
211
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    29
	static TInt TimerCallBack(TAny* aDemo);
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    30
    void Redraw();
210
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    31
211
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    32
protected:
215
097e92a68d68 Added GLES 1.x spinning cube-rendering code to eglbringuptest
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 211
diff changeset
    33
    CEGLRendering(RWindow& aWindow, EGLenum aApi);
211
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    34
    void ConstructL();
215
097e92a68d68 Added GLES 1.x spinning cube-rendering code to eglbringuptest
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 211
diff changeset
    35
    TSize WindowSize() const;
210
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    36
211
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    37
	void StartRedrawTimer();
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    38
	void StopRedrawTimer();
210
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    39
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    40
    static void EGLCheckError();
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    41
    static void EGLCheckReturnError(EGLBoolean aBool);
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    42
    static void VGCheckError();
215
097e92a68d68 Added GLES 1.x spinning cube-rendering code to eglbringuptest
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 211
diff changeset
    43
    static void GLCheckError();
211
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    44
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    45
private:
210
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    46
    void EglSetupL();
211
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    47
    virtual void KhrSetup() = 0;
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    48
    virtual void KhrPaint() = 0;
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    49
    void EglSwapBuffers();
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    50
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
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
    52
	RWindow& iWindow;
215
097e92a68d68 Added GLES 1.x spinning cube-rendering code to eglbringuptest
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 211
diff changeset
    53
	const EGLenum iApi;
211
3804ba25b23f Refactored eglbringuptest to separate EGL and VG code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 210
diff changeset
    54
	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
    55
	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
    56
	EGLSurface iSurface;
210
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    57
	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
    58
	};
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
    59
210
da03feddbab7 Cleaned up eglbringuptest code
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 193
diff changeset
    60
#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
    61