我的一个openGL程序出问题了

我要做的是飘动的旗子,这是一本书上的代码,不对的地方都已经修改了,但是最后执行还是有错,大家帮帮忙阿!!!

// handGLView.h : interface of the CHandGLView class
//
/////////////////////////////////////////////////////////////////////////////
#include "gl\gl.h"
#include "gl\glu.h"
#if !defined(AFX_HANDGLVIEW_H__5BAB0C82_7D5E_11D2_83B3_0080C832FCF3__INCLUDED_)
#define AFX_HANDGLVIEW_H__5BAB0C82_7D5E_11D2_83B3_0080C832FCF3__INCLUDED_

#if _MSC_VER >=1000
#pragma once
#endif // _MSC_VER >= 1000

class CHandGLView : public CView
{

protected: // create from serialization only
CHandGLView();
DECLARE_DYNCREATE(CHandGLView)

// Attributes
public:
CHandGLDoc* GetDocument();
CClientDC *m_pDC;
CRect m_oldRect;
// Operations
public:

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CHandGLView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:

//}}AFX_VIRTUAL

// Implementation
public:

virtual ~CHandGLView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif

protected:
GLint m_framesNum;
GLint m_widthX,m_widthY;
GLint m_checkerSize;
GLint m_contouring;
GLint m_curFrame;
GLint m_nextFrame;

GLenum m_smooth;
GLenum m_lighting;
GLenum m_stepControl;
GLenum m_rotate;
GLenum m_clearMask;
GLenum m_depth;

GLfloat m_rotateAngle;
GLfloat m_height;

BOOL m_play;

struct m_facet{
float color[3];
float normal[3];
};
struct m_coord{
float vertex[3];
float normal[3];
};

struct mesh{
GLint m_widthX,m_widthY;
GLint numFacets;
GLint numCoords;
GLint numFrames;
struct m_coord * coords;
struct m_facet * facets;
} m_waveMesh;

// Generated message map functions
protected:
void OnTimer();
void KeyDown_R();
void KeyDown_F();
void KeyDown_K();
void KeyDown_D();
void KeyDown_L();
void KeyDown_S();
void KeyDown_T();
void Wave();
void InitTexture();
void InitMaterials();
void InitMesh();
void DrawScene();
BOOL bSetupPixelFormat();
void Init();
//{{AFX_MSG(CHandGLView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnDestroy();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnKeyDown(UINT nChar,UINT nRepCnt,UINT nFlags);

//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG // debug version in handGLView.cpp
inline CHandGLDoc* CHandGLView::GetDocument()
{ return (CHandGLDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_HANDGLVIEW_H__5BAB0C82_7D5E_11D2_83B3_0080C832FCF3__INCLUDED_)
不是这个原因阿,刚执行了一遍
但是真的非常感谢,真的谢谢你那么有耐心!!

// handGLView.cpp : implementation of the CHandGLView class
//

#include "stdafx.h"
#include "handGL.h"

#include "handGLDoc.h"
#include "handGLView.h"
#include <math.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////

#define PI 3.14159265358979323846
GLubyte contourTexture1[]={
255,255,255,255,
255,255,255,255,
255,255,255,255,
127,127,127,127,
};//纹理与亮度信息
GLubyte contourTexture2[]={
255,255,255,255,
255,127,127,127,
255,127,127,127,
255,127,127,127,
};//纹理与亮度信息
#define GETm_coord(frame,x,y)(&(m_waveMesh.coords[frame* \m_waveMesh.numCoords+(x)+(y)*(m_waveMesh.m_widthX+1)]))
#define GETm_facet(frame,x,y)(&(m_waveMesh.facets[frame* \m_waveMesh.numFacets+(x)+(y)*m_waveMesh.m_widthX]))
////////////////////////////////////////////////////////////////////////////
// CHandGLView
IMPLEMENT_DYNCREATE(CHandGLView, CView)

BEGIN_MESSAGE_MAP(CHandGLView, CView)
//{{AFX_MSG_MAP(CHandGLView)
ON_WM_CREATE()
ON_WM_DESTROY()
ON_WM_SIZE()
ON_WM_TIMER()
ON_WM_KEYDOWN()
//}}AFX_MSG_MAP
// Standard printing commands

END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHandGLView construction/destruction

CHandGLView::CHandGLView()
{
// TODO: add construction code here
m_pDC=NULL;
m_framesNum=10;
m_widthX=10;
m_widthY=10;
m_checkerSize=2;
m_height=0.2f;
m_smooth=GL_TRUE;
m_lighting=GL_TRUE;
m_stepControl=GL_FALSE;
m_rotate=GL_FALSE;
m_clearMask=GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT;
m_depth=GL_TRUE;
m_play=TRUE;
m_contouring=0;
m_curFrame=0;
m_nextFrame=0;
m_rotateAngle=0.0f;

}

CHandGLView::~CHandGLView()
{
}

BOOL CHandGLView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style|=WS_CLIPCHILDREN|WS_CLIPSIBLINGS;

return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CHandGLView drawing

void CHandGLView::OnDraw(CDC* pDC)
{
CHandGLDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
DrawScene();

}

/////////////////////////////////////////////////////////////////////////////
// CHandGLView diagnostics

#ifdef _DEBUG
void CHandGLView::AssertValid() const
{
CView::AssertValid();
}

void CHandGLView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}

CHandGLDoc* CHandGLView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CHandGLDoc)));
return (CHandGLDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CHandGLView message handlers

int CHandGLView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;

// TODO: Add your specialized creation code here

Init();
glFrontFace(GL_CW);
InitMaterials();
InitTexture();
InitMesh();
SetTimer(1,30,NULL);
return 0;
}

void CHandGLView::Init()
{
PIXELFORMATDESCRIPTOR pfd;
int n;
HGLRC hrc;
m_pDC=new CClientDC(this);
ASSERT(m_pDC!=NULL);
if(!bSetupPixelFormat())
return;
n=::GetPixelFormat(m_pDC->GetSafeHdc());
::DescribePixelFormat(m_pDC->GetSafeHdc(),n,sizeof(pfd),&pfd);
hrc=wglCreateContext(m_pDC->GetSafeHdc());
wglMakeCurrent(m_pDC->GetSafeHdc(),hrc);

GetClientRect(&m_oldRect);
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

}

BOOL CHandGLView::bSetupPixelFormat()
{
static PIXELFORMATDESCRIPTOR pfd=
{
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_DRAW_TO_WINDOW |
PFD_SUPPORT_OPENGL ,
PFD_TYPE_RGBA,
24,
0,0,0,0,0,0,
0,
0,
0,
0,0,0,0,
32,
0,
0,
PFD_MAIN_PLANE,
0,
0,0,0
};
int pixelformat;
if((pixelformat=ChoosePixelFormat(m_pDC->GetSafeHdc(),&pfd))==0)
{
MessageBox("ChoosePixelFormat failed");
return FALSE;
}
if (SetPixelFormat(m_pDC->GetSafeHdc(),pixelformat,&pfd)==FALSE)
{
MessageBox("SetPixelFormat failed");
return FALSE;
}
return TRUE;
}

void CHandGLView::OnDestroy()
{

// TODO: Add your message handler code here
HGLRC hrc;
if(m_play)KillTimer(1);
hrc=::wglGetCurrentContext();
::wglMakeCurrent(NULL,NULL);
if(hrc)
::wglDeleteContext(hrc);
if(m_pDC)
delete m_pDC;
CView::OnDestroy();
}

void CHandGLView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);

// TODO: Add your message handler code here
if(cy>0)
{
if((m_oldRect.right >cx)||(m_oldRect.bottom >cy))
RedrawWindow();
m_oldRect.right=cx;
m_oldRect.bottom=cy;

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0,1.0,-1.0,1.0,3.0,7.0);
glViewport(0,0,cx,cy);
}

}
void CHandGLView::DrawScene()
{
glClearColor(0.0f,0.0f,0.0f,1.0f);
glClear(m_clearMask);
glColor3f(1.0f,0.0f,0.0f);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0f,0.1f,-4.5f);

glScalef(2.0,2.0,2.0);
glRotatef(-35.0,1.0,0.0,0.0);
glRotatef(35.0,0.0,0.0,1.0);
Wave();
glFinish();
SwapBuffers(wglGetCurrentDC());
}

void CHandGLView::OnTimer(UINT nIDEvent)
{
Invalidate(FALSE);
CView::OnTimer(nIDEvent);

}
void CHandGLView::InitMesh()
{
struct m_coord *m_coord;
struct m_facet *m_facet;
float dp1[3],dp2[3];
float *pt1,*pt2,*pt3;
float angle,d,x,y;
GLint numFacets,numCoords,frameNum;
int i,j;
//旗帜的宽度和飘扬的高度
m_waveMesh.m_widthX =m_widthX;
m_waveMesh.m_widthY =m_widthY;
m_waveMesh.numFrames=m_framesNum;
//曲面的细化控制:旗帜小面的个数,顶点数
numFacets=m_widthX * m_widthY;
numCoords=(m_widthX+1)*(m_widthY+1);

m_waveMesh.numCoords=numCoords;
m_waveMesh.numFacets=numFacets;
//顶点信息内存分配
m_waveMesh.coords=(struct m_coord*)malloc(m_framesNum*numCoords*sizeof(struct m_coord));
//小面拓扑信息内存分配
m_waveMesh.facets=(struct m_facet*)malloc(m_framesNum*numFacets*sizeof(struct m_facet));
if(m_waveMesh.coords ==NULL||m_waveMesh.facets ==NULL)
{
MessageBox("Out of Memory!");
return;
}
//数据驱动机制的建立:数据流结构
//曲面的有限单元化
for(frameNum=0;frameNum<m_framesNum;frameNum++)
{
for(i=0;i<=m_widthX;i++)
{
x=i/(float)m_widthX;
for(j=0;j<=m_widthY;j++)
{
y=j/(float)m_widthY;
d=float(sqrt(x*x+y*y));
if(d==0.0) d=0.0001f;
angle=float(2*PI*d+(2*PI/m_framesNum*frameNum));
!!m_coord=GETm_coord(frameNum,i,j);
//顶点坐标
m_coord->vertex[0]=float(x-0.5);//x
m_coord->vertex[1]=float(y-0.5);//y
m_coord->vertex[2]=float((m_height-m_height*d)*cos(angle));//Z
//法线
m_coord->normal[0]=float(-(m_height/d)*x*((1-d)*2*PI*sin(angle)+cos(angle)));
m_coord->normal[1]=float(-(m_height/d)*y*((1-d)*2*PI*sin(angle)+cos(angle)));
m_coord->normal[2]=-1;
//发现归一化
d=float(1.0/sqrt(m_coord->normal[0]*m_coord->normal[0]+m_coord->normal[1]*m_coord->normal[1]+1));
m_coord->normal[0]*=d;
m_coord->normal[1]*=d;
m_coord->normal[2]*=d;
}
}
for(i=0;i<m_widthX;i++)
{
for(j=0;j<m_widthY;j++)
{
!!m_facet=GETm_facet(frameNum,i,j); //获取小面的拓扑信息
//赋给小面颜色:小面被分成棋块状
if(((i/m_checkerSize)%2)^(j/m_checkerSize)%2)
{
m_facet->color[0]=1.0f;
m_facet->color[1]=0.1f;
m_facet->color[2]=0.1f;
}
else
{
m_facet->color[0]=0.2f;
m_facet->color[1]=1.0f;
m_facet->color[2]=0.2f;
}
//获取小面顶点坐标
!!pt1=GETm_coord(frameNum,i,j)->vertex;
!!pt2=GETm_coord(frameNum,i,j+1)->vertex;
!!pt3=GETm_coord(frameNum,i+1,j+1)->vertex;
//计算小面法线
dp1[0]=pt2[0]-pt1[0];
dp1[1]=pt2[1]-pt1[1];
dp1[2]=pt2[2]-pt1[2];

dp2[0]=pt2[0]-pt1[0];
dp2[1]=pt2[1]-pt1[1];
dp2[2]=pt2[2]-pt1[2];

m_facet->normal[0]=dp1[1]*dp2[2]-dp1[2]*dp2[1];
m_facet->normal[1]=dp1[2]*dp2[0]-dp1[0]*dp2[2];
m_facet->normal[2]=dp1[0]*dp2[1]-dp1[1]*dp2[0];
//法线归一化
d=float(1.0/sqrt(m_facet->normal[0]*m_facet->normal[0]+m_facet->normal[1]*m_facet->normal[1]+m_facet->normal[2]*m_facet->normal[2]));

m_facet->normal[0]*=d;
m_facet->normal[1]*=d;
m_facet->normal[2]*=d;
}
}
}
}
void CHandGLView::InitMaterials()
{
float ambient[]={0.1f,0.1f,0.1f,1.0f};
float diffuse[]={0.5,1.0,1.0,1.0};
float position[]={4.0,6.0,10.0,0.0};
float front_mat_shininess[]={60.0};
float front_mat_specular[]={0.2f,0.2f,0.2f,1.0f};
float front_mat_diffuse[]={0.5f,0.28f,0.38f,1.0f};
float back_mat_shininess[]={60.0};
float back_mat_specular[]={0.5f,0.5f,0.2f,1.0f};
float back_mat_diffuse[]={1.0f,1.0f,0.2f,1.0f};
float model_ambient[]={1.0,1.0,1.0,1.0};
float model_twoside[]={GL_TRUE};
//光照与材质
glLightfv(GL_LIGHT0,GL_AMBIENT,ambient);
glLightfv(GL_LIGHT0,GL_DIFFUSE,diffuse);
glLightfv(GL_LIGHT0,GL_POSITION,position);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT,model_ambient);
glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE,model_twoside);

glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);

glMaterialfv(GL_FRONT,GL_SHININESS,front_mat_shininess);
glMaterialfv(GL_FRONT,GL_SPECULAR,front_mat_specular);
glMaterialfv(GL_FRONT,GL_DIFFUSE,front_mat_diffuse);
glMaterialfv(GL_BACK,GL_SHININESS,back_mat_shininess);
glMaterialfv(GL_BACK,GL_SPECULAR,back_mat_specular);
glMaterialfv(GL_BACK,GL_DIFFUSE,back_mat_diffuse);
//颜色材质
glColorMaterial(GL_FRONT_AND_BACK,GL_DIFFUSE);
glEnable(GL_COLOR_MATERIAL);
}
void CHandGLView::InitTexture()
{
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
}
void CHandGLView::Wave()
{
struct m_coord * m_coord;
struct m_facet * m_facet;
float * lastColor;
float * thisColor;
GLint i,j;

if(m_nextFrame||!m_stepControl)
{
m_curFrame++; //动画控制参数
}
if(m_curFrame>=m_waveMesh.numFrames)
{
m_curFrame=0;
}
if((m_nextFrame||!m_stepControl)&&m_rotate)
{
m_rotateAngle+=5.0f;
if(m_rotateAngle>360.0f)m_rotateAngle=0.0f;
glRotatef(m_rotateAngle,0.0f,0.0f,1.0f);
}
m_nextFrame=0;
//数据的流动:旗帜小面的重组
for(i=0;i<m_waveMesh.m_widthX;i++)
{
glBegin(GL_QUAD_STRIP);
lastColor=NULL;
for(j=0;j<m_waveMesh.m_widthY;j++)
{
!!m_facet=GETm_facet(m_curFrame,i,j); //获取即将计算的小面信息
//是否光照与光顺处理
if(!m_smooth&&m_lighting)
{
glNormal3fv(m_facet->normal);
}
if(m_lighting)
{
thisColor=m_facet->color;
glColor3fv(m_facet->color);
}
//颜色流动,获取顶点几何等信息
if(!lastColor||(thisColor[0]!=lastColor[0]&&m_smooth))
{
if(lastColor)
{
glEnd();
glBegin(GL_QUAD_STRIP);
}
!!m_coord=GETm_coord(m_curFrame,i,j);
if(m_smooth&&m_lighting)
{
glNormal3fv(m_coord->normal);
}
glVertex3fv(m_coord->vertex);
}
!!m_coord=GETm_coord(m_curFrame,i+1,j+1);
if(m_smooth&&m_lighting)
{
glNormal3fv(m_coord->normal);
}
glVertex3fv(m_coord->vertex);
lastColor=thisColor;
}
glEnd();
}
}
void CHandGLView::OnKeyDown(UINT nChar,UINT nRepCnt,UINT nFlags)
{
switch(nChar)
{
case'T': KeyDown_T(); break;
case'S': KeyDown_S(); break;
case'L': KeyDown_L(); break;
case'D': KeyDown_D(); break;
case'K': KeyDown_K(); break;
case'R': KeyDown_R(); break;
case'F': KeyDown_F(); break;
}
CView::OnKeyDown(nChar,nRepCnt,nFlags);
}
void CHandGLView::KeyDown_T()
{
//纹理控制
m_contouring++;
if(m_contouring==1)
{
static GLfloat map[4]={0,0,20,0};
glTexImage2D(GL_TEXTURE_2D,0,3,4,4,0,GL_LUMINANCE,GL_UNSIGNED_BYTE,(GLvoid*)contourTexture1);
glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEAR);
glTexGenfv(GL_S,GL_OBJECT_PLANE,map);
glTexGenfv(GL_T,GL_OBJECT_PLANE,map);
glEnable(GL_TEXTURE_2D);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
}
else if(m_contouring==2)
{
static GLfloat map[4]={0,0,20,0};
glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_EYE_LINEAR);
glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,GL_EYE_LINEAR);
glPushMatrix();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTexGenfv(GL_S,GL_EYE_PLANE,map);
glTexGenfv(GL_T,GL_EYE_PLANE,map);
glPopMatrix();
}
else
{
m_contouring=0;
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_TEXTURE_2D);
}
}
void CHandGLView::KeyDown_S()
{
//光顺控制
m_smooth=!m_smooth;
if(m_smooth){

glShadeModel(GL_SMOOTH);
}else{
glShadeModel(GL_FLAT);
}
}
void CHandGLView::KeyDown_L()
{
//光照控制
m_lighting=!m_lighting;
if(m_lighting){
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_COLOR_MATERIAL);
}
else
{
glDisable(GL_LIGHTING);
glDisable(GL_LIGHT0);
glDisable(GL_COLOR_MATERIAL);
}
}
void CHandGLView::KeyDown_D()
{
//深度测试控制
m_depth=!m_depth;
if(m_depth)
{
glEnable(GL_DEPTH_TEST);
m_clearMask|=GL_DEPTH_BUFFER_BIT;
}
else
{
glDisable(GL_DEPTH_TEST);
m_clearMask&=GL_DEPTH_BUFFER_BIT;
}
}
void CHandGLView::KeyDown_K()
{
m_stepControl=!m_stepControl;
m_play=!m_play;
if(m_play)
SetTimer(1,30,NULL);
else
KillTimer(1);
}
void CHandGLView::KeyDown_F()
{
//数据驱动机制的建立
if(m_stepControl)m_nextFrame=1;
}
void CHandGLView::KeyDown_R()
{
//运动控制参数
m_rotate=!m_rotate;
}

编译之后的错误:

全部都是一个错误error C2017: illegal escape sequence

出错的语句我用感叹号标出来了
温馨提示:内容为网友见解,仅供参考
第1个回答  2006-12-22
其实你的程序都是出现在宏:
#define GETm_coord(frame,x,y)(&(m_waveMesh.coords[frame* \m_waveMesh.numCoords+(x)+(y)*(m_waveMesh.m_widthX+1)]))
#define GETm_facet(frame,x,y)(&(m_waveMesh.facets[frame* \m_waveMesh.numFacets+(x)+(y)*m_waveMesh.m_widthX]))
中,可能的原因是 你的宏有问题。即:
#define GETm_coord(frame,x,y) (&(m_waveMesh.coords[frame*\ m_waveMesh.numCoords+(x)+(y)*(m_waveMesh.m_widthX+1)]))
#define GETm_facet(frame,x,y) (&(m_waveMesh.facets[frame* \m_waveMesh.numFacets+(x)+(y)*m_waveMesh.m_widthX]))
从上面看宏是不正确的,续行符\应该在上一行的结尾,而不是在下一行的开头。另外,请检查宏和定义间是否缺少空格,以及括号等是否匹配或正确。

opengl错误怎么解决
硬件问题也是引起OpenGL错误的一个常见原因。例如,显卡驱动过时、显存不足或硬件故障都可能导致OpenGL性能问题。在遇到这类问题时,检查显卡驱动是否最新、增加系统内存或更换故障硬件组件,可以有效解决问题。为确保OpenGL环境的正常运行,建议定期进行系统维护和更新,包括更新操作系统、驱动程序和相关软件包。同...

我的一个openGL程序出问题了
m_coord->normal[1]=float(-(m_height\/d)*y*((1-d)*2*PI*sin(angle)+cos(angle))); m_coord->normal[2]=-1; \/\/发现归一化 d=float(1.0\/sqrt(m_coord->normal[0]*m_coord->normal[0]+m_coord->normal[1]*m_coord->normal[1]+1)); m_coord->normal[0]*=d; m_coord->normal[1]...

OpenGL出错是什么原因?
原因:你当前显卡GPU性能远低于CPU性能时会发生此错误。从CPU发送到GPU的工作负载使GPU过载,导致NVIDIA OpenGL出现错误 解决方案:1,检查显卡驱动程序是否最新版本的。2、关闭无相关占用GPU资源软件 3、换个好点的显卡

是OpenGL的问题:无法找到OpenGL驱动程序,请安装显卡原装的驱动...
以上所述,可能是游戏要求的级别太高了,你的显卡跑不动这款游戏造成的。解决的办法只有换张好点的显卡,再装上最新的驱动。如果是你没有安装驱动造成的问题,问题就好解决多了,在设备管理器里重新安装一遍你的显卡驱动就OK了。

无法找到OPENGL,说要我更新显卡是什么意思,谁能帮帮我,
建议访问驱动之家网站,下载与你显卡型号相符的最新驱动。这一步至关重要,因为最新的显卡驱动通常包含了解决缺少OPENGL文件问题的程序代码。下载完成后,按照驱动程序的指示进行安装。安装过程中可能会提示你重启电脑,确保完成所有更新步骤。安装成功后,再次检查是否仍然存在缺少OPENGL的问题。通常情况下,问题...

OpenGL无法开启,是显卡的问题吗,如何解决
1.独立显卡的驱动很可能没有安装或安装好。将驱动卸载掉重新到官网或英伟达官网下载对应型号与系统的驱动安装使用 2.安装的系统与独立显卡驱动有一定冲突,或系统内的软件导致独立显卡驱动不能完全运行。建议将主板的系统重新安装并安装好主板驱动,最后官网或英伟达官网下载对应型号与系统的驱动安装使用 3....

求助一个简单的OpenGL程序运行不了的问题,请高手帮忙啊
点“工程”->“设置” 有个“连接”选项卡,在下面“对象\/模块库”里面加上 opengl32.lib和glu32.lib 试试行不行 这些错误肯定是又有没有链接库造成的,但有没有别的问题就不知道了

Python运行一个opengl程序,出现了这样的错误,怎么办
很明显,提示你是语法错误。如果我没看错的话,你的代码是 python2 复制过来的,而你现在的环境是 python3.5。其中,except 语法有所变化 试试把 except OSError, err:这句改为 except OSError as err:看看

Opengl程序错误:fatal error C1083: Cannot open include file: 'GL...
你这个问题应该通过第一步就解决了啊。。(1)“d:\\Program Files\\Microsoft Visual Studio\\VC98\\include\\GL文件夹”。把解压得到的glut.h放到这个GL文件夹里。没有GL文件夹可以自己建一个,一般都有的。还是同样的错误吗?

opengl程序中无法启动此程序,因为计算机中丢失glut.dll
系统文件glut.dll出错,是由于木马病毒、或不小心下载了流氓软件被感染所致。而该文件又是系统\/程序正常运行的前提条件,所以一旦不幸被感染,通常会伴随下几种情况:1、桌面图标无法删除(淘宝、小游戏、电影等等,重启同样不能正常删除)2、网络游戏打不开(DNF,穿越火线,魔兽世界等等)3、电脑无故蓝屏...

相似回答
大家正在搜