是否可以创建固定大小的过剩窗口? [英] is it possible to create a fixed size glut window?

查看:64
本文介绍了是否可以创建固定大小的过剩窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能使用glut创建固定大小的窗口,因此窗口尺寸的任何更改都将被忽略.

is it possible to create a fixed size window using glut, so any changes with the window's dimensions will be disregarded.

对于我来说,回到SDL或类似的版本还为时已晚.

it's kinda too late for me switching back to SDL or anything similar.

推荐答案

显然,这是不可能的,但是您可以在glutReshapeFunc -callback中使用glutReshapeWindow,以在发布老鼠.这是非常有效的,并且据我所知是最好的解决方案.仅使用freeglut测试:

Apparently, it's not possible in a legit way, but you can use glutReshapeWindow inside your glutReshapeFunc-callback, to snap it back right after release of mouse. It's quite effective, and to my knowledge the best solution. Only tested with freeglut:

glutReshapeFunc(resize);

void resize(int width, int height) {
    // we ignore the params and do:
    glutReshapeWindow( 800, 600);
}

这篇关于是否可以创建固定大小的过剩窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆