SDL/opengl 多重采样不起作用
我正在尝试使用 SDL/opengl 进行多重采样,但 SDL 不接受设置 SDL_MULTISAMPLEBUFFERS 和 SDL_MULTISAMPLESAMPLES。相反,这些值保留为 0,之后 SDL_SetVideoMode() 将失败。我知道我的硬件可以通过 4 倍多重采样来实现这种像素格式。我运行的是 Ubuntu 10.10。
代码:
SDL_Init( SDL_INIT_VIDEO );
SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 0 );
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, 0 );
SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, 1 );
SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 1 );
SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, 4 );
Uint32 flags;
flags = SDL_OPENGL;
if( m_bFullscreen )
{
flags = flags | SDL_FULLSCREEN;
}
SDL_SetVideoMode( m_sizeX, m_sizeY, 0, flags );
I'm trying to do multisampling with SDL/opengl but SDL won't accept setting SDL_MULTISAMPLEBUFFERS and SDL_MULTISAMPLESAMPLES. Instead these are left at 0 and SDL_SetVideoMode() will fail afterwards. I know my hardware can do this pixel format with 4x multisampling. I'm running Ubuntu 10.10.
Code:
SDL_Init( SDL_INIT_VIDEO );
SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 0 );
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, 0 );
SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, 1 );
SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 1 );
SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, 4 );
Uint32 flags;
flags = SDL_OPENGL;
if( m_bFullscreen )
{
flags = flags | SDL_FULLSCREEN;
}
SDL_SetVideoMode( m_sizeX, m_sizeY, 0, flags );
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加这些测试:
然后
观察您的 stderr 输出。
Add those tests :
and
then watch your stderr output.