游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1264|回复: 1

[opengl新手求助]

[复制链接]

4

主题

15

帖子

15

积分

新手上路

Rank: 1

积分
15
QQ
发表于 2004-7-3 20:11:00 | 显示全部楼层 |阅读模式
我将如下代码copy到一个vc的workspace
添加 "opengl32.lib glu32.lib glaux.lib" 到project>settings>link

执行错误:

error C2144: syntax error : missing ';' before type 'void'
error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
fatal error C1004: unexpected end of file found

#include <GL/gl.h>
#include <GL/glaux.h>
#include "glos.h"

void main(void)
{
  auxInitDisplayMode(AUX_SINGLE|AUX_RGBA);
  auxInitPosition(0,0,500,500);
  auxInitWindow("simple");

  glClearColor(0.0,0.0,0.0,0.0);
  glClear(GL_COLOR_BUFFER_BIT);

   glColor3f(1.0,0.0,0.0);
  glRectf(-0.5,-0.5,0.5,0.5);

   glFlush();
  _sleep(1000);
}

请知道答案的朋友赐教! 谢谢

4

主题

15

帖子

15

积分

新手上路

Rank: 1

积分
15
QQ
 楼主| 发表于 2004-7-3 21:41:00 | 显示全部楼层

Re:[opengl新手求助]

倒,没人知道啊! 刚上网查到答案:
#include <windows.h>
#include <GL/glu.h>
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-8-10 21:42

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表