本文整理汇总了C++中VideoMode::getHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoMode::getHeight方法的具体用法?C++ VideoMode::getHeight怎么用?C++ VideoMode::getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoMode
的用法示例。
在下文中一共展示了VideoMode::getHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setVideoMode
void Window::setVideoMode( const VideoMode& mode ) {
log << "Setting video mode " << mode << ".\n";
if(!mode.isValid()) {
log << "VideoModeNotSupportedException raised.\n";
throw VideoModeNotSupportedException();
}
if( mode == mode_ ) {
log << "No changes detected. Not doing anything.\n";
return;
}
bool opOk;
int w = mode.getWidth();
int h = mode.getHeight();
int bpp = mode.getBpp();
int flags = SDL_OPENGL;
if( mode.isFullscreen() )
flags |= SDL_FULLSCREEN;
if( !mode.isDecorated() )
flags |= SDL_NOFRAME;
_putenv(_strdup("SDL_VIDEO_CENTERED=1"));
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER,1);
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL,mode.hasVSync()?1:0);
opOk = SDL_SetVideoMode(w,h,bpp,flags) != 0;
if( !opOk ) {
log << "Warning: Mode reported it was valid, but SDL_SetVideoMode() failed.\n";
throw VideoModeNotSupportedException();
}
mode_ = mode;
log << "Video mode set.\n";
}