📄 opengl.h
字号:
// OpenGL.h: interface for the COpenGL class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_OPENGL_H__C4AE5F49_BC6D_4A5B_81BF_D8A8FD2E8C9B__INCLUDED_)
#define AFX_OPENGL_H__C4AE5F49_BC6D_4A5B_81BF_D8A8FD2E8C9B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <windows.h>
#include <io.h>
#include <stdio.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glaux.h>
#pragma comment(lib,"opengl32.lib")
#pragma comment(lib,"glu32.lib")
#pragma comment(lib,"glaux.lib")
class COpenGL
{
public:
COpenGL();
virtual ~COpenGL();
public:
HWND m_h_wnd;
HINSTANCE m_h_instance;
HDC m_h_dc;
HGLRC m_h_rc;
RECT m_rect;
int m_x_res;
int m_y_res;
int m_bit_depth;
GLfloat m_aspect;
//旋转角度
GLfloat m_tri_angle;
GLfloat m_quad_angle;
//理纹
GLuint m_texture[1];
public:
void SetWindowParam(HWND hWnd,HINSTANCE hInstance,int w, int h, int bitdepth);
bool ChangeResolution();
void DisableOpenGL();
void EnableOpenGL();
void SceneShow(GLvoid);
void SceneResizeViewport();
void SceneInit();
private:
int LoadTextures();
AUX_RGBImageRec* LoadBMP(char*filename);
//画平面三角形和矩形
void DrawTriangle();
void DrawRectangle();
//画立体锥体和正方体
void DrawTriangle_3d();
void DrawRectangle_3d();
//画有理纹的正方体
void DrawRectange_3d_picture();
};
#endif // !defined(AFX_OPENGL_H__C4AE5F49_BC6D_4A5B_81BF_D8A8FD2E8C9B__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -