Author Topic: OGLPlus Library - nearly no CC  (Read 7563 times)

Offline Meiner

  • Multiple posting newcomer
  • *
  • Posts: 12
OGLPlus Library - nearly no CC
« 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). 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 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

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: OGLPlus Library - nearly no CC
« Reply #1 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
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Meiner

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: OGLPlus Library - nearly no CC
« Reply #2 on: February 03, 2013, 05:58:05 pm »
Thanks for the hint. I will give these Clang plugins a try.