VIM铛完整没有看到的OpenGL的一些功能 [英] vim clang complete doesn't see some functions of opengl

查看:172
本文介绍了VIM铛完整没有看到的OpenGL的一些功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VIM clang_complete 安装,但因为当我尝试自动某种原因,完成它不看一些OpenGL的的功能,如 glBindBuffer glEnableVertexAttribArray 。我preSS <大骨节病> CTRL + <大骨节病> X 和<大骨节病> CTRL + <大骨节病> U 强制自动完成的,它显示了功能名称和参数,但它只是缺少一些功能。

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 ,但它不存在,我不知道为什么,它只是说用户自定义完成后(为^ U ^ N ^ P)模式没找到

Even with glfw, I try auto completing GLFW_KEY_ESC but it's not there, I don't know why, it just says User defined completion (^U^N^P) Pattern not found

有没有人有办法解决这个问题?这是非常讨厌,因为我使用这些功能很多,需要自动完成。

Does anyone have a solution to this problem? It's very annoying because I use these functions a lot and need the auto complete.

感谢。

编辑:也有我的包含头文件是这样的:

Also my include header files are this:

#include <iostream>
#include <string>
#include <GL/glew.h>
#include <GL/glfw.h>
#include <glm/glm.hpp>

我在的Arch Linux的x64 的方式。

推荐答案

好吧,我找到了答案。因为不能够完成GLEW创建的参数clang_complete的(因为函数被定义为的#define FOO somefunction,并且不被定义为:#定义FOO(ARG1,ARG2,ARG3)someFunction(ARG1,ARG2,ARG3))

All right I found the answer. Because of clang_complete not being able to complete the arguments created by GLEW (because the functions are defined as #define FOO somefunction, and not defined as: #define FOO(arg1, arg2, arg3) someFunction(arg1, arg2, arg3))

要解决这个问题,你有这个选项添加到你的〜/ .vimrc文件。

To fix this, you have to add this option to your ~/.vimrc file.

let g:clang_complete_macros = 1

现在,您将获得功能完成,但仍然没有完成论证。所以,你必须与更换GLEW(黯然)

Now, you'll get function completion, but still no argument completion. So, you'll have to replace GLEW (sadly) with

#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glext.h>

这将最终完成的论据,虽然,如果有在做解决这个问题的一个选择,我想听到的。

This will finally complete the arguments, although, if there's an alternative to doing fixing this problem, I'd like to hear.

这篇关于VIM铛完整没有看到的OpenGL的一些功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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