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

📄 ogles_demo_02.h

📁 此程序需要Brew sdk2.1版本以上,是关于OpenGL的手机编程.
💻 H
字号:
#ifndef __ogles_demo_02_H_
#define __ogles_demo_02_H_
/*=================================================================================
FILE:			ogles_demo_02.h
  
DESCRIPTION:	This file is provide as a standard sample Brew header file. 
				Please refer to this OpenGL(R)ES brew sample application as a 
				reference on how to use the standard OpenGL-ES and EGL APIs.
                          
ABSTRACT:		The ogles_demo_02 application header file 

AUTHOR:			QUALCOMM
                        
				Copyright (c) 2004 QUALCOMM Incorporated.
					   All Rights Reserved.
					QUALCOMM Proprietary/GTDR
=================================================================================*/

/*-------------------------------------------------------------------------------*
 *                      I N C L U D E   F I L E S                                *
 *-------------------------------------------------------------------------------*/

// GL
#include <gles/gl.h>
#include <gles/egl.h>
#include "igl.h"

// ogles_demo_02 Resource Files
#include "ogles_demo_02.bid"
#include "ogles_demo_02_res.h"

// BREW
#include "AEEAppGen.h"
#include "AEEModGen.h"
#include "AEEStdLib.h"
#include "AEEFile.h"
#include "AEEMenu.h"
#include "AEEGL.h"

// image
#include "tga_image.h"

/*-------------------------------------------------------------------------------*
 *                            M A C R O S                                        *
 *-------------------------------------------------------------------------------*/
#define f16(X)			            ((int32) ((X) * 65535))
#define ITOX(i)						((i) << 16)

/*-------------------------------------------------------------------------------*
 *                      E N U M   T Y P E S                                      *
 *-------------------------------------------------------------------------------*/


/*-------------------------------------------------------------------------------*
 *                            C U B E   C L A S S                                *
 *-------------------------------------------------------------------------------*/
class cube
{
	
public:
	
	void Init(AEEApplet*);
	cube(){};
	~cube();
	
	GLshort		texCoords[48];
	GLint		colors[96];
	GLubyte		indices[24];
	GLint		vertices[72];
	
	
	// Our application, Shell, and Display
	AEEApplet*	m_applet;
	IBitmap*	m_pDDBitmap;	
	
	// File I/O
	IFileMgr*	m_pIFileMgr;
	
	TGA_IMAGE	m_images[7]; 
    GLuint		texID[7];
	GLboolean	isLoaded;
	
	int			m_offset;
	int			m_depthView;
	int			flag;
	
	// speed to spin the cube
	int			m_spinFactor;
	int			m_up_down;
	int			m_left_right;
	boolean		m_auto;
	int			m_pos1;
	int			m_pos2;
    int			type;
	
	int			counter;

	//member functions
	void FreeData( void );
    void Render( void);
	void LoadTextures(IShell *m_pIShell);
	boolean KeyEvent( uint16 wParam);
	
	
};

/*-------------------------------------------------------------------------------*
 *                      S I M P L E 3 D   C L A S S                              *
 *-------------------------------------------------------------------------------*/


class ogles_demo_02
{

public:

	ogles_demo_02();
	~ogles_demo_02();

	// Our application, Shell, and Display
	AEEApplet		m_applet;

	IBitmap*        m_pDDBitmap;
	AEEBitmapInfo   m_DDBitmapInfo;

	cube			Cube;

	// File I/O
	IFileMgr*		m_pIFileMgr;

	// IGL and IEGL
	IGL*			m_pIGL;
	IEGL*			m_pIEGL;

	// EGL Variables
	EGLDisplay		m_eglDisplay;
	EGLSurface		m_eglSurface;
	EGLContext		m_eglContext;

	int				m_iFontHeight;
	int             m_depthView;

	int             m_key_state;
	uint16			m_key_wParam;

	//member functions
    boolean	Init();
	boolean	SetupGL();
	boolean	SetupEGL();

    void		RenderTriangle(void);
	void		RenderFrame();
	static void NextFrame(ogles_demo_02*);

    boolean KeyEvent( uint16 wParam);
	boolean CmdEvent( uint16 wParam);

	int GetScreenWidth(void)  { return m_DDBitmapInfo.cx;};
	int GetScreenHeight(void) { return m_DDBitmapInfo.cy;};
	int GetScreenDepth(void)  { return m_DDBitmapInfo.nDepth;};
	int GetFontHeight(void)   { return m_iFontHeight;};

    static void		Destroy(ogles_demo_02*);
    static boolean	HandleEvent( ogles_demo_02 *pi, AEEEvent eCode, uint16 wParam, uint32 dwParam );

	void	CleanUp(void);
};

#endif//__ogles_demo_02_H_

⌨️ 快捷键说明

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