Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: Meiner on February 02, 2013, 04:35:24 pm

Title: OGLPlus Library - nearly no CC
Post by: Meiner on February 02, 2013, 04:35:24 pm
Hi,

I've some problems with the CC when using the OGLPlus library (a c++ wrapper for OpenGL, http://kifri.fri.uniza.sk/~chochlik/oglplus/html/index.html (http://kifri.fri.uniza.sk/~chochlik/oglplus/html/index.html)). For example:

Code

#ifndef TRIANGLE_EXAMPLE_HPP
#define TRIANGLE_EXAMPLE_HPP

#include <GL3/gl3w.h>
#include <oglplus/all.hpp>

class Triangle
{
public:
    Triangle();
    ~Triangle();

    static void display();
private:
    oglplus::Context gl;
    oglplus::VertexShader vertexShader;
    oglplus::FragmentShader fragmentShader;
    oglplus::Program program;
    oglplus::VertexArray triangle;
    oglplus::Buffer vertices;
};

#endif // TRIANGLE_EXAMPLE_HPP

I get a CC-tooltip for the classes themselves (oglplus::Context,...) but when I try to use a member function like
Code
vertexShader.Source(..)
nothing happens. I think it has something to do with the (for me) relative complex structure of the library. For example the definition of the VertexShader class in line 393 in this file http://kifri.fri.uniza.sk/~chochlik/oglplus/html/shader_8hpp_source.html (http://kifri.fri.uniza.sk/~chochlik/oglplus/html/shader_8hpp_source.html) with a typedef inside a preprocessor part. Any idea how to fix that problem (if possible)?

I'm using the 12.11 version of CodeBlocks.

Greetings,
Meiner
Title: Re: OGLPlus Library - nearly no CC
Post by: ollydbg on February 03, 2013, 02:43:40 pm
Quote
I think it has something to do with the (for me) relative complex structure of the library. For example the definition of the VertexShader class in line 393 in this file http://kifri.fri.uniza.sk/~chochlik/oglplus/html/shader_8hpp_source.html with a typedef inside a preprocessor part. Any idea how to fix that problem (if possible)?
Yes, our codecompletion plugin's parser does not handle template/preprocessor quite well. To fix them, I think it was hard, either implement a full C++ parser, or use a clang/gcc based codecompletion, see: ClangComplete (https://github.com/Lalaland/ClangComplete)
Title: Re: OGLPlus Library - nearly no CC
Post by: Meiner on February 03, 2013, 05:58:05 pm
Thanks for the hint. I will give these Clang plugins a try.