I have vim
and clang_complete
installed but for some reason when I try to auto complete it doesn't see some of OpenGL's functions, such as glBindBuffer
, or glEnableVertexAttribArray
. I press CTRL + X and CTRL + U to force the auto complete and it shows the function names and parameters, but it's just missing some of the functions.
即使glfw
,我尝试自动完成GLFW_KEY_ESC
但它不在那里,我不知道为什么,它只是说User defined completion (^U^N^P) Pattern not found
有人有解决这个问题的办法吗?这很烦人,因为我经常使用这些功能并且需要自动完成。
Thanks.
编辑:我的包含头文件也是这样的:
#include <iostream>
#include <string>
#include <GL/glew.h>
#include <GL/glfw.h>
#include <glm/glm.hpp>
I'm on Arch Linux x64
顺便一提。
好吧,我找到了答案。因为 clang_complete 无法完成 GLEW 创建的参数(因为函数被定义为 #define FOO somefunction,而不是定义为: #define FOO(arg1, arg2, arg3) someFunction(arg1, arg2, arg3))
要解决此问题,您必须将此选项添加到 ~/.vimrc 文件中。
let g:clang_complete_macros = 1
现在,您将获得函数完成,但仍然没有参数完成。所以,你必须将 GLEW (不幸的是)替换为
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glext.h>
这将最终完成争论,不过,如果有解决这个问题的替代方法,我想听听。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)