glfw

[转载]Building Cocos2d-x on RHEL / Fedora / CentOS Linux

≡放荡痞女 提交于 2019-12-01 12:33:02
This guide is intended to help anyone who wishes to build Cocos2d-x from source on an RPM-based Linux machine (RHEL / Fedora / CentOS). At the time these instructions were tested, Cocos2d-x v2.2.1 was used on Fedora 19. For RPM-based systems, there are some issues with the archive you get from http://www.cocos2d-x.org/download . If you look closely at the install-deps-linux.sh file, you will notice the deb-based package manager commands, like ‘dpkg-query’ and ‘apt-get’ which indicate this release was intended for Debian-based systems. There is another issue related to the dependency of Cocos2d

Issue when updating stencil buffer in OpenGL

眉间皱痕 提交于 2019-12-01 11:07:55
I'm having issues when drawing using the stencil test in OpenGL on mac. When I first draw the scene, the stencil works fine. I draw a semi-transparent black rectangle in the middle, with writing to the stencil buffer enabled, and then a larger blue rectangle with writing to the stencil buffer disabled. I get the right result when the window first pops up, which looks like this: However, when I resize the window, and the rendering function gets called again, I get a result which looks like: or Sometimes the weird white space follows the middle rectangle, other times the white snaps between

GLEW and glfw compile error: undefined reference to symbol 'XConvertSelection'

谁说我不能喝 提交于 2019-12-01 05:08:15
问题 I'm trying to compile this code: #include <stdio.h> #include <stdlib.h> #include <GL/glew.h> #include <GLFW/glfw3.h> GLFWwindow* window; #include <glm/glm.hpp> using namespace glm; int main( void ) { // Initialise GLFW if( !glfwInit() ) { fprintf( stderr, "Failed to initialize GLFW\n" ); return -1; } glfwWindowHint(GLFW_SAMPLES, 4); glfwWindowHint(GLFW_RESIZABLE,GL_FALSE); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL

openGL起飞篇

廉价感情. 提交于 2019-12-01 04:24:17
现在我用鼠标打开了vs2017,新建了一个空项目,我发现 <VC++目录> 中的 <包含目录> 下面没有freeglut和glew的include路径,而 <库目录> 下面也没有freeglut和glew的lib路径 于是go on,先把这4个路径加进去。 <链接器>的<附加依赖项>加上glew32s.lib 可能GLFW比freeglut牛皮吧,虽然前面用了freeglut,但是我们现在把glfw加进来。 一样把glfw的include和lib路径加到<包含目录>和<库目录>下,再把glfw.lib加到<链接器>的<附加依赖项>上。 接下来是glm的安装,这个比较麻烦。就是直接把glm文件夹放到项目文件路径下(注意是外层的glm文件夹,不是里层的glm文件夹)。 来源: https://www.cnblogs.com/chuan-chuan/p/11653697.html

What does my choice of GLFW_SAMPLES actually do?

老子叫甜甜 提交于 2019-12-01 03:16:26
What does setting this variable do? For instance, if I set it to 4, what does that mean? I read a description on glfw.org (see here: GLFW Window Guide ) under the "Framebuffer related hints" section. The manual says "GLFW_SAMPLES specifies the desired number of samples to use for multisampling. Zero disables multisampling. GLFW_DONT_CARE means the application has no preference." I also read a description of multisampling in general (see here: Multisampling by Shawn Hargreaves). I have a rough idea of what multisampling means: when resizing and redrawing an image, the number of points used to

Creating a BufferedImage causes GLFW in the LWJGL to lock up (Java)

我的未来我决定 提交于 2019-12-01 01:39:46
There is a link to download the project below. The project already contains the LWJGL. Just open it with eclipse and tell me I'm not going crazy I'm experimenting with the LWJGL for the first time and have managed to get the sample code on the LWJGL website to work. The odd thing is, if I create an instance of a BufferedImage anywhere in the program, it causes the whole thing to lock up. I've managed to narrow it down to the ColorModel class (which is used by BufferedImage) but can't figure out why it is happening. I'll attach a zip file with my eclipse project to this post which demonstrates

Setting up GLFW with MinGW

痴心易碎 提交于 2019-11-30 20:37:06
I'm trying to learn OpenGL with GLFW, but I'm having some problems. This is my main.cpp: #include <GL/glfw.h> int main() { glfwInit(); glfwSleep( 1.0 ); glfwTerminate(); } This is my project's folder structure: Project +- glfw.dll +- main.cpp This is where I extracted the GLFW files: MinGW +- include | +- GL | +- glfw.h +- lib +- libglfw.a +- libglfwdll.a And this is how I try to build the program: g++ main.cpp -o main.exe -lglfwdll And these are the errors I'm getting: C:\Users\Dark\AppData\Local\Temp\cc0ZgTVp.o:main.cpp:(.text+0xf): undefined reference to `_glfwInit' C:\Users\Dark\AppData

一步一步带你在VS 2017中配置OpenGL

一曲冷凌霜 提交于 2019-11-30 19:29:04
在VS2017环境中配置OpenGL,我们分三步:配置GLFW、配置GLAD、导出项目模板。 配置GLFW 1.首先下载GLFW,点击 这里 ,进入Github下载。 或者 点击 这里 从百度云下载,提取码为yavo。(注:该链接由中国大学MOOC万琳老师计算机图形学课程讨论区提供)。 2.然后安装Cmake后,在..\glfw-3.3文件夹下创建build文件夹。 打开Cmake按下图进行配置: 接着点击左下角的Configure,选择对应的Visual Studio 15 2017(根据自己的ide自行选择)。 点击Finish。然后点击Generate进行生成。完成后效果如图所示。 3.接着我们打开VS 2017,新建一个空项目,然后右击项目,选择属性 然后我们点击左侧的VC++ 目录,我们将修改包含目录与库目录。 点击包含目录->编辑,点击右上角的新行后,出现一个新行,点击行末尾的三个小点,选中刚刚下载的GLFW文件夹中的include文件夹。 接着点击库目录,步骤与刚刚一致,只不过选中的是GLFW中的build文件夹中的src,然后选中src中的Debug文件夹。 接着我们点击左侧的链接器->输入->附加依赖项->编辑 在其中输入 opengl32.lib glfw3.lib 点击确定完成GLFW的配置!下面我们配置GLAD,暂时不要关闭VS。 配置GLAD 点击 这里

Undefined reference to `__ms_vsnprintf' when linking GLFW statically

天涯浪子 提交于 2019-11-30 19:12:45
问题 I am trying to compile the GLFW quickstart guide (Here) in windows 8 64-bit using mingw. I am using the official 32 bit windows binary from the glfw website. Everything works fine when I link the glfw library dynamically by linking -lglfw3dll -lgdi32 -lopengl32 -lglew32 and defining GLFW_DLL . When I try to link glfw statically, however, I get undefined reference to '__ms_vsnprintf' My command to link statically is mingw32-g++.exe -o bin\Release\test.exe obj\Release\main.o -s -lglfw3 -lgdi32

Class3-你好,窗口

╄→尐↘猪︶ㄣ 提交于 2019-11-30 12:10:16
3.1实例化GLFW窗口 调用 glfwInit 函数来初始化GLFW glfwWindowHint 函数来配置GLFW glfwWindowHint 函数的第一个参数代表选项的名称,我们可以从很多以 GLFW_ 开头的枚举值中选择;第二个参数接受一个整型,用来设置这个选项的值。 int main() { glfwInit(); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); //glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); return 0; } 3.2创建窗口 glfwCreateWindow 函数需要窗口的宽和高作为它的前两个参数。第三个参数表示这个窗口的名称(标题) 创建完窗口我们就可以通知GLFW将我们窗口的上下文设置为当前线程的主上下文了。 GLFWwindow* window = glfwCreateWindow(800, 600, "LearnOpenGL", NULL, NULL); if (window == NULL) { std: