visual-studio-2010 - 使用 openGL 将 Visual Studio 设置到 Windows 子系统?

标签 visual-studio-2010 winapi opengl glfw

如何设置我的项目,以便它打开一个窗口而不是控制台?

#include <GL\glew.h>
#include <GL\glfw.h>

int main()
{
    glfwInit();
    glfwOpenWindow(0, 0, 0, 0, 0, 0, 0, 0, GLFW_WINDOW);
    glfwTerminate();
    return 0;
}

此代码打开一个窗口,但它也打开一个控制台,如何设置我的项目以便只显示窗口? 使用VS 2010。

最佳答案

在这里查看我的答案:https://stackoverflow.com/a/6882500/524368

(逐字引用):


在项目中设置链接器选项

/SUBSYSTEM:windows
/ENTRY:mainCRTStartup

或者在源文件中使用以下#pragma以及int main(...)

#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")

关于visual-studio-2010 - 使用 openGL 将 Visual Studio 设置到 Windows 子系统?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10458798/

相关文章:

python - 将 PyOpenGL 从 PyGame 转移到 PyQt5 的困惑

c# - 如何使用 Razor 单选按钮正确实现 MVC3?

winapi - GetDC() 和 BeginPaint() 之间的区别?

c++ - 如何关闭Win8平板电脑的显示

macos - Mac OS X Lion 上的 FreeGLUT

c++ - OpenGL wglMakeCurrent() 报告资源繁忙

c# - 从 blob url 容器读取文件

visual-studio-2010 - 如何删除有关 "The ' VSTS for Database Professionals 包未正确加载的弹出窗口。”?

c# - 在 Visual Studio 2012 解决方案中混合 Visual Studio 2010 和 2012 项目

c - ListEntry 类的使用