資源簡介
在一個漫天飄雪的冬天,一個孤零零的雪人,伴著天空之城的背景音,讓人陷入了無限沉思!!

代碼片段和文件信息
#include? //?Header?File?For?Windows
#include? //?PlaySound()
#include?
#include?
#include?
#include?“gl.h“ //?Header?File?For?The?OpenGL32?Library
#include?“glu.h“
#include?“OGL.h“????//?Header?File?For?The?GLu32?Library
#include?“glaux.h“? //?Header?File?For?The?Glaux?Library
HDC hDC=NULL; //?Private?GDI?Device?Context
HGLRC hRC=NULL; //?Permanent?Rendering?Context
HWND hWnd=NULL; //?Holds?Our?Window?Handle
HINSTANCE hInstance; //?Holds?The?Instance?Of?The?Application
bool keys[256]; //?Array?Used?For?The?Keyboard?Routine
bool active=TRUE; //?Window?Active?Flag?Set?To?TRUE?By?Default
bool fullscreen=TRUE; //?Fullscreen?Flag?Set?To?Fullscreen?Mode?By?Default
GLfloat?yrot;?//?Y?旋轉
GLfloat?LightAmbient[]=?{?0.5f?0.5f?0.5f?1.0f?};?//環境光參數?(?新增?)
GLfloat?LightDiffuse[]=?{?1.0f?1.0f?1.0f?1.0f?};?//?漫射光參數?(?新增?)
GLfloat?LightPosition[]=?{?0.0f?0.0f?2.0f?1.0f?};?//?光源位置?(?新增?)
#define?TEXTURECOUNT?4
#define?SNOWCOUNT?2000
LPTSTR?bmpfile[TEXTURECOUNT]={_T(“Data/2.bmp“)_T(“Data/3.bmp“)_T(“Data/4.bmp“)_T(“Data/5.bmp“)};
GLuint?texture[TEXTURECOUNT];
struct?TSnow
{
float?xyz;
float?xrotyrotzrot;
float?Dspeed;
float?Rspeed;
int?TextureIndex;
};
TSnow?Snow[SNOWCOUNT];
LRESULT CALLBACK?WndProc(HWND?UINT?WPARAM?LPARAM); //?Declaration?For?WndProc
AUX_RGBImageRec?*LoadBMP(LPTSTR?Filename) //?Loads?A?Bitmap?Image
{
FILE?*File=NULL; //?File?Handle
if?(!Filename) //?Make?Sure?A?Filename?Was?Given
{
return?NULL; //?If?Not?Return?NULL
}
File=_tfopen(Filename_T(“r“)); //?Check?To?See?If?The?File?Exists
if?(File) //?Does?The?File?Exist?
{
fclose(File); //?Close?The?Handle
return?auxDIBImageLoad(Filename); //?Load?The?Bitmap?And?Return?A?Pointer
}
return?NULL; //?If?Load?Failed?Return?NULL
}
int?LoadGLTextures() //?Load?Bitmaps?And?Convert?To?Textures
{
int?Status;
AUX_RGBImageRec?*TextureImage[1]; //?Create?Storage?Space?For?The?Texture
glGenTextures(TEXTURECOUNT?&texture[0]); //?Create?The?Texture
for(int?i=0;i {
Status=FALSE; //?Status?Indicator
memset(TextureImage0sizeof(void?*)*1);??????????? //?Set?The?Pointer?To?NULL
//?Load?The?Bitmap?Check?For?Errors?If?Bitmap‘s?Not?Found?Quit
if?(TextureImage[0]=LoadBMP(bmpfile[i]))
{
Status=TRUE; //?Set?The?Status?To?TRUE
//?創建線性濾波紋理
glBindTexture(GL_TEXTURE_2D?texture[i]);
glTexParameteri(GL_TEXTURE_2DGL_TEXTURE_MAG_FILTERGL_LINEAR);
glTexParameteri(GL_TEXTURE_2DGL_TEXTURE_MIN_FILTERGL_LINEAR);
glTexImage2D(GL_TEXTURE_2D?0?3?TextureImage[0]->sizeX?TextureImage[0]->sizeY?0?GL_RGB?GL_UNSIGNED_BYTE?TextureImage[0]->data);
}
if?(TextureImage[0]) //?If?Texture?Exists
{
if?(TextureImage[0]->data) //?If?Texture?Image?Exists
{
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????69083??2011-06-16?23:13??opengl課程設計張淼\GL.H
?????文件??????12065??2011-06-16?23:13??opengl課程設計張淼\GLAUX.H
?????文件????1312394??2011-06-16?23:14??opengl課程設計張淼\GLAUX.LIB
?????文件?????234006??2011-06-16?23:13??opengl課程設計張淼\glext.h
?????文件??????18282??2011-06-16?23:13??opengl課程設計張淼\GLU.H
?????文件?????130048??2009-07-14?09:15??opengl課程設計張淼\glu32.dll
?????文件??????12648??2011-06-16?23:14??opengl課程設計張淼\GLU32.LIB
?????文件??????27670??2011-06-16?23:13??opengl課程設計張淼\glut.h
?????文件?????237568??2001-11-08?02:27??opengl課程設計張淼\glut32.dll
?????文件??????71040??2011-06-10?12:39??opengl課程設計張淼\glut32.lib
?????文件????????641??2011-06-16?23:40??opengl課程設計張淼\OGL.h
?????文件???????4052??2011-06-16?23:17??opengl課程設計張淼\OpenGl.vcxproj
?????文件???????1228??2011-06-16?23:17??opengl課程設計張淼\OpenGl.vcxproj.filters
?????文件????????143??2011-06-16?23:08??opengl課程設計張淼\OpenGl.vcxproj.user
?????文件??????77112??2011-06-16?23:14??opengl課程設計張淼\OPENGL32.LIB
?????文件???????4187??2011-06-17?00:01??opengl課程設計張淼\Snow.dsp
?????文件????????514??2011-06-16?23:49??opengl課程設計張淼\Snow.dsw
?????文件?????312320??2011-07-01?17:13??opengl課程設計張淼\Snow.ncb
?????文件????????736??2011-07-01?17:13??opengl課程設計張淼\Snow.plg
?????文件????????543??2011-06-16?22:24??opengl課程設計張淼\OpenGLWork.dsw
?????文件??????33792??2011-06-17?19:23??opengl課程設計張淼\OpenGLWork.ncb
?????文件??????37888??2011-06-17?19:23??opengl課程設計張淼\OpenGLWork.opt
?????文件??????25417??2011-06-24?15:08??opengl課程設計張淼\myGL.cpp
?????文件??????12342??1999-12-21?22:25??opengl課程設計張淼\Data\2.bmp
?????文件??????12342??1999-12-21?22:26??opengl課程設計張淼\Data\3.bmp
?????文件??????12342??1999-12-21?22:26??opengl課程設計張淼\Data\4.bmp
?????文件?????196662??1999-12-21?20:20??opengl課程設計張淼\Data\5.bmp
?????文件?????115119??1997-06-03?05:03??opengl課程設計張淼\Data\OPEN4.WAV
?????文件????1922732??2011-06-17?20:07??opengl課程設計張淼\Data\music.wav
?????文件?????241703??2011-07-01?17:13??opengl課程設計張淼\Debug\Snow.exe
............此處省略13個文件信息
- 上一篇:三維點云數據的預處理研究
- 下一篇:手機紅外遙控器 布局 數據庫訪問
評論
共有 條評論