- 1、本文档共20页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
基于openGl的三维旋转魔方源代码
基于openGl的三维旋转魔方源代码
/*
* This Code Was Created By Jeff Molofee 2000
* A HUGE Thanks To Fredric Echols For Cleaning Up
* And Optimizing The Base Code, Making It More Flexible!
* If Youve Found This Code Useful, Please Let Me Know.
* Visit My Site At nehe.gamedev.net
*/
// Header File For Standard Input/Output
#include MoFang.h
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 xrot; // X Rotation ( NEW )
GLfloat yrot; // Y Rotation ( NEW )
GLfloat zrot; // Z Rotation ( NEW )
GLfloat RX;
GLfloat RY;
GLuint texture[24]; // Storage For One Texture ( NEW )
GLboolean b_RX,b_RY;
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); // Declaration For WndProc
AUX_RGBImageRec *LoadBMP(char *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=fopen(Filename,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=FALSE; // Status Indicator
AUX_RGBImageRec *TextureImage[1]; // Create Storage Space For The Texture
memset(TextureImage,0,sizeof(void *)*1); // Set The Pointer To NULL
// Load The Bitmap, Check For Errors, If Bitmaps Not Found Quit
if (TextureImage[0]=LoadBMP(Data/NeHe.bmp))
{
Status=TRUE; // Set The Status To TRUE
g
您可能关注的文档
- 坡屋面维修方案.doc.doc
- 坦克射击时的稳定性测试.doc
- 垃圾综合处理场垃圾搬迁工程施工组织设计.doc
- 垫圈内径检测装置机课程设计.doc
- 垫片冲裁模具设计及制造开题报告.doc
- 垫江县人民医院门诊综合楼`外科及手术用房新建工程(中央空调.doc
- 埃森哲战略咨询的基础框架和工具.ppt.ppt
- 埃贡席勒构图形式对我创作启示.doc
- 埃菲尔和巴黎埃菲尔铁塔武际可.doc
- 埃菲尔铁塔的设计.doc
- 中国国家标准 GB/T 18233.4-2024信息技术 用户建筑群通用布缆 第4部分:住宅.pdf
- GB/T 18233.4-2024信息技术 用户建筑群通用布缆 第4部分:住宅.pdf
- GB/T 18978.210-2024人-系统交互工效学 第210部分:以人为中心的交互系统设计.pdf
- 《GB/T 18978.210-2024人-系统交互工效学 第210部分:以人为中心的交互系统设计》.pdf
- 中国国家标准 GB/T 18978.210-2024人-系统交互工效学 第210部分:以人为中心的交互系统设计.pdf
- GB/T 16649.2-2024识别卡 集成电路卡 第2部分:带触点的卡 触点的尺寸和位置.pdf
- 《GB/T 16649.2-2024识别卡 集成电路卡 第2部分:带触点的卡 触点的尺寸和位置》.pdf
- 中国国家标准 GB/T 16649.2-2024识别卡 集成电路卡 第2部分:带触点的卡 触点的尺寸和位置.pdf
- GB/T 17889.4-2024梯子 第4部分:铰链梯.pdf
- 《GB/T 17889.4-2024梯子 第4部分:铰链梯》.pdf
文档评论(0)