Code::Blocks Forums

User forums => Help => Topic started by: rust on May 19, 2008, 05:04:00 pm

Title: OpenGL Auto Completion
Post by: rust on May 19, 2008, 05:04:00 pm
hello everyone,

I'm new at Code::Blocks. I have to work on a OpenGL Project, so I downloaded C::B for Mac (intel) for my macbook.

I followed wizard to create a simple glut application ( GLUT Shapes Demo
). GLUT example is running but in the editor auto Completion is not working.

I tried to write gl... (ctrl+space) in the existing code, but nothing.

Any ideas?

thank you
Title: Re: OpenGL Auto Completion
Post by: Deschamps on May 19, 2008, 10:19:40 pm
If I'm not wrong, code completion needs at least you write 4 chars (for objects or members names) before it shows you the possible choices.

Regards.
Title: Re: OpenGL Auto Completion
Post by: rust on May 20, 2008, 06:56:16 pm
mmm no.. it's not running even typing 4 chars
Title: Re: OpenGL Auto Completion
Post by: XayC on May 20, 2008, 10:15:32 pm
The Code Completion plug-in has some known issues. It may not be able to correctly parse some headers; if the OpenGL/GLUT header that you are using is one of them I don't know, but it may be the cause of your problem.

If you want more information about this you can look in the Code Completion Redesign section of the forums or in the bugs list for the Code Completion component on Berlios.

Regards, XayC
Title: Re: OpenGL Auto Completion
Post by: dje on May 21, 2008, 08:40:35 am
If I'm not wrong, code completion needs at least you write 4 chars (for objects or members names) before it shows you the possible choices.

Regards.


I think the 4 chars are those after which autocompletion panel appears automatically but you can press Ctrl+space before those 4 chars.

Dje
Title: Re: OpenGL Auto Completion
Post by: Ibbur on May 21, 2008, 11:06:43 am
I think the problem is, that externs are skipped (http://forums.codeblocks.org/index.php/topic,8422.0.html).

The gl... functions are preceded with the macro GLAPI. Now look, how GLAPI is defined in gl.h:
Quote from: gl.h
Code
#if !defined(GLAPI)
#  if defined(_MSC_VER)                        /* Microsoft Visual C++ */
#    define GLAPI __declspec(dllimport)
#  elif defined(__LCC__) && defined(__WIN32__) /* LCC-Win32 */
#    define GLAPI __stdcall
#  else                                        /* Others (e.g. MinGW, Cygwin, non-win32) */
#    define GLAPI extern
#  endif
#endif
Title: Re: OpenGL Auto Completion
Post by: dje on May 21, 2008, 11:09:58 am
AFAIK, macro are not managed by code completion plugin, that's why your symbols are not found.

Dje
Title: Re: OpenGL Auto Completion
Post by: Ibbur on May 21, 2008, 11:35:12 am
Preprocessor parsing can be enabled in the editor settings dialog:
(http://img53.imageshack.us/img53/8319/preprocessorle8.png)

Using a patched version (look at the link, posted above), that does not skip externs, completion with gl... functions works for me:
(http://img391.imageshack.us/img391/9634/glcompletionmk9.png)
Title: Re: OpenGL Auto Completion
Post by: lowtraxx on May 23, 2008, 02:48:58 am
Hi,

tried this workaround, but doesnt work here. (Applied the patch, but i think the file changed since the last entry.) Still getting no Autocompletion of gl.h. Does someone have another solution?

thx

Low