Openframeworks 0.8.0 一个很重要的特性就是替换glut为 glfw3.0 (http://www.glfw.org/docs/3.0/index.html)。glut已经陈旧不堪,被替换是必然的。
glfw有一些很有意思的特性(http://www.glfw.org/docs/3.0/news.html)。
比如:
glfw有一些很有意思的特性(http://www.glfw.org/docs/3.0/news.html)。
比如:
Multi-monitor support
GLFW now explicitly supports multiple monitors. They can be enumerated with glfwGetMonitors, queried with glfwGetVideoModes, glfwGetMonitorPos,glfwGetMonitorName and glfwGetMonitorPhysicalSize, and specified at window creation to make the newly created window full screen on that specific monitor.行编辑.
如果你有多个显示器,并且想要全屏的话(ofwer一定知道在显示器使用扩展模式的话是不能真正全屏的),那么你可以这样做:
main.cpp
#include "ofAppGLFWWindow.h"
//========================================================================
int main( ){
ofAppGLFWWindow* window = new ofAppGLFWWindow();
window->setMultiDisplayFullscreen(true);
ofSetupOpenGL(window, 1024,768, OF_WINDOW); // <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp( new testApp());
}
试试吧,会有意外的发现。