游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1120|回复: 0

OPENGL问题

[复制链接]

5

主题

13

帖子

19

积分

新手上路

Rank: 1

积分
19
发表于 2006-2-16 14:26:00 | 显示全部楼层 |阅读模式
成功编译,且正确连接,可运行.但是是黑屏,不用主函数循环时,可正常显示.请问是什么原因?
代码如下:

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


void myinit(void);
void CALLBACK myDisplay(void);

void main()
{
        auxInitDisplayMode(AUX_SINGLE|AUX_RGBA);
        auxInitPosition(50,50,550,550);
        auxInitWindow("_vc program");
        myinit();
        auxMainLoop(myDisplay);
}

void myinit(void)
{
        glClearColor(0.0,0.0,0.0,0.0);
        glClear(GL_COLOR_BUFFER_BIT);
}

void CALLBACK myDisplay(void)
{
        glColor3f(1.0,1.0,0.0);
        auxWireSphere(1.0);
        glFlush();
}


[em17]
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2026-1-23 11:49

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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